MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / get_agent

Function get_agent

rl3/a2c/play.py:19–27  ·  view source on GitHub ↗
(env, nsteps=5, nstack=1, total_timesteps=int(80e6),
              vf_coef=0.5, ent_coef=0.01, max_grad_norm=0.5, lr=7e-4,
              epsilon=1e-5, alpha=0.99)

Source from the content-addressed store, hash-verified

17
18
19def 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
30def main():

Callers 1

mainFunction · 0.85

Calls 1

AgentClass · 0.90

Tested by

no test coverage detected