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

Function train

rl3/a2c/main.py:33–49  ·  view source on GitHub ↗
(env_id, num_timesteps, num_cpu)

Source from the content-addressed store, hash-verified

31
32
33def train(env_id, num_timesteps, num_cpu):
34 def make_env(rank):
35 def _thunk():
36 env = make_atari(env_id)
37 env.seed(SEED + rank)
38 gym.logger.setLevel(logging.WARN)
39 env = wrap_deepmind(env)
40
41 # wrap the env one more time for getting total reward
42 env = Monitor(env, rank)
43 return env
44 return _thunk
45
46 env = SubprocVecEnv([make_env(i) for i in range(num_cpu)])
47 learn(CNN, env, SEED, total_timesteps=int(num_timesteps * 1.1))
48 env.close()
49 pass
50
51
52def main():

Callers 4

mainFunction · 0.70
mainFunction · 0.50
mainFunction · 0.50
fit_to_inputMethod · 0.50

Calls 4

closeMethod · 0.95
SubprocVecEnvClass · 0.90
learnFunction · 0.90
make_envFunction · 0.85

Tested by

no test coverage detected