facebookresearch / ReAgent

A platform for Reasoning systems (Reinforcement Learning, Contextual Bandits, etc.)
https://reagent.ai
BSD 3-Clause "New" or "Revised" License
3.57k stars 521 forks source link

Example to run SAC doesn't run #209

Closed MrCartoonology closed 4 years ago

MrCartoonology commented 4 years ago

When I try to run the SAC example

(reagent) ~/code/ReAgent$ python ml/rl/test/gym/run_gym.py -p ml/rl/test/gym/sac_pendulum_v0.json 

I get an error that something in the json config is not defined in the Dataclass.

AssertionError: Item in dict missing from <class 'ml.rl.training.sac_trainer.SACTrainerParameters'>: use_value_network

~/Code/ReAgent/ml/rl/json_serialize.py(73)from_json()

badrinarayan commented 4 years ago

Thank you for bringing it up @MrCartoonology - we have now fixed it. The default config runs for a 1000 episodes, if you want to stop after we reach a score of -300, you can also do

python ml/rl/test/gym/run_gym.py -p ml/rl/test/gym/sac_pendulum_v0.json -s -300

This took about 40 episodes to reach with the hyperparams in the provided config.

image