AIcrowd / real_robots

Gym environments for Robots that learn to interact with the environment autonomously
https://www.aicrowd.com/challenges/neurips-2019-robot-open-ended-autonomous-learning
MIT License
34 stars 18 forks source link

Bug set_goals_dataset_path(self, path) makes the phase extrinsic #12

Closed emilio-cartoni closed 5 years ago

emilio-cartoni commented 5 years ago

If you run the local evaluation with extrinsic_timesteps less than intrinsic_timesteps, you will see that the intrinsic phase stops exactly after the extrinsic_timesteps.

i.e. when using: result = real_robots.evaluate( RandomPolicy, intrinsic_timesteps=5000, extrinsic_timesteps=100, extrinsic_trials=12, visualize=False, goals_dataset_path="./goals.npy.npz", ) intrinsic will stop after 100 timesteps.

This is actually due to set_goals_dataset_path. The line: self.goal_idx = 0 should be removed there, otherwise the environment thinks the extrinsic phase is running. (goal_idx must be -1 while intrinsic phase is running).

Can't do a pull request at the moment, I will leave the issue here meanwhile.

emilio-cartoni commented 5 years ago

Fixed by a8f236b6ff3702123d3be42d68c12cf37f159abb

emilio-cartoni commented 5 years ago

I had actually to "fix some more" -> 09cfd7b4a385e41fa1e6a80e24110af39f4c914e I have added some tests to ensure we do not go backward :)