MCPcopy Create free account
hub / github.com/rlcode/reinforcement-learning / _load_ge

Function _load_ge

4-atari-hard/extract_demo.py:32–45  ·  view source on GitHub ↗

Import 2-go-explore.py (ExperienceLog/DONE_KEY) with env stubbed.

()

Source from the content-addressed store, hash-verified

30
31
32def _load_ge():
33 """Import 2-go-explore.py (ExperienceLog/DONE_KEY) with env stubbed."""
34 here = Path(__file__).resolve().parent
35 import types
36 stub = types.ModuleType("env_go_explore")
37 stub.ENV_IDS = {"montezuma_goexplore": "ALE/MontezumaRevenge-v5"}
38 for name in ("RunLogger", "make_restore_env", "parse_args"):
39 setattr(stub, name, lambda *a, **k: None)
40 sys.modules["env_go_explore"] = stub
41 spec = importlib.util.spec_from_file_location("_ge", here / "2-go-explore.py")
42 mod = importlib.util.module_from_spec(spec)
43 spec.loader.exec_module(mod)
44 del sys.modules["env_go_explore"]
45 return mod
46
47
48def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected