-
Notifications
You must be signed in to change notification settings - Fork 86
/
run_elm.py
38 lines (29 loc) · 994 Bytes
/
run_elm.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
This module gives an example of how to run the main ELM class.
It uses the hydra library to load the config from the config dataclasses in
configs.py.
This config file demonstrates an example of running ELM with the Sodarace
environment, a 2D physics-based environment in which robots specified by
Python dictionaries are evolved over.
"""
import hydra
from hydra.core.hydra_config import HydraConfig
from omegaconf import OmegaConf
from openelm import ELM
@hydra.main(
config_name="elmconfig",
version_base="1.2",
)
def main(config):
config.output_dir = HydraConfig.get().runtime.output_dir
print("----------------- Config ---------------")
print(OmegaConf.to_yaml(config))
print("----------------- End -----------------")
config = OmegaConf.to_object(config)
elm = ELM(config)
print(
"Best Individual: ",
elm.run(init_steps=config.qd.init_steps, total_steps=config.qd.total_steps),
)
if __name__ == "__main__":
main()