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

Method run

rl2/a3c/worker.py:147–169  ·  view source on GitHub ↗
(self, sess, coord, t_max)

Source from the content-addressed store, hash-verified

145 self.returns_list = returns_list # Global returns list to plot later
146
147 def run(self, sess, coord, t_max):
148 with sess.as_default(), sess.graph.as_default():
149 # Assign the initial state
150 self.state = repeat_frame(self.img_transformer.transform(self.env.reset()))
151
152 try:
153 while not coord.should_stop():
154 # Copy weights from global networks to local networks
155 sess.run(self.copy_params_op)
156
157 # Collect some experience
158 steps, global_step = self.run_n_steps(t_max, sess)
159
160 # Stop once the max number of global steps has been reached
161 if self.max_global_steps is not None and global_step >= self.max_global_steps:
162 coord.request_stop()
163 return
164
165 # Update the global networks using local gradients
166 self.update(steps, sess)
167
168 except tf.errors.CancelledError:
169 return
170
171 def sample_action(self, state, sess):
172 # Make input N x D (N = 1)

Callers 15

transformMethod · 0.45
copy_fromMethod · 0.45
saveMethod · 0.45
loadMethod · 0.45
predictMethod · 0.45
updateMethod · 0.45
dqn_tf.pyFile · 0.45
init_varsMethod · 0.45
predictMethod · 0.45
copy_fromMethod · 0.45
perturb_paramsMethod · 0.45
partial_fitMethod · 0.45

Calls 5

run_n_stepsMethod · 0.95
updateMethod · 0.95
repeat_frameFunction · 0.85
transformMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected