nazaruka / gym-http-api

NSGA2-based Sonic agent + experimental code
MIT License
1 stars 1 forks source link

Don't watch every episode #4

Closed schrum2 closed 5 years ago

schrum2 commented 5 years ago

Learning can seem slow if you are watching every episode, but it is unsatisfying to just watch performance numbers scroll by. Make it so env.render() only executes if the i_episode is divisible by a certain number ... for example 10, so that you only look at the agent performance every 10 episodes. We can tweak this number.

nazaruka commented 5 years ago

I solved this issue (#4) by adding the following code: if i_episode % 10 == 0: env.render() before the act = agent.step(obs0) declaration. This code enables the agent to render the zeroth (initial, on-load) episode and any episode with IDs of multiples of 10, rather than rendering every single one. Adding this code will guarantee the issue solved in any file where the following block of code is written before the aforementioned declaration:

env = gym.make('Pendulum-v0')
env.seed(1)
env = env.unwrapped

Some notes:

schrum2 commented 5 years ago

Some of this documentation seems to correspond to different issues. However, the specific issue of not watching every episode seems to be resolved ... can this issue be closed?