| 17 | |
| 18 | |
| 19 | def get_agent(env, nsteps=5, nstack=1, total_timesteps=int(80e6), |
| 20 | vf_coef=0.5, ent_coef=0.01, max_grad_norm=0.5, lr=7e-4, |
| 21 | epsilon=1e-5, alpha=0.99): |
| 22 | # Note: nstack=1 since frame_stack=True, during training frame_stack=False |
| 23 | agent = Agent(Network=CNN, ob_space=env.observation_space, |
| 24 | ac_space=env.action_space, nenvs=1, nsteps=nsteps, nstack=nstack, |
| 25 | ent_coef=ent_coef, vf_coef=vf_coef, max_grad_norm=max_grad_norm, |
| 26 | lr=lr, alpha=alpha, epsilon=epsilon, total_timesteps=total_timesteps) |
| 27 | return agent |
| 28 | |
| 29 | |
| 30 | def main(): |