MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / cb

Method cb

examples/A3C-Gym/train-atari.py:172–182  ·  view source on GitHub ↗
(outputs)

Source from the content-addressed store, hash-verified

170 Launch forward prediction for the new state given by some client.
171 """
172 def cb(outputs):
173 try:
174 distrib, value = outputs.result()
175 except CancelledError:
176 logger.info("Client {} cancelled.".format(client.ident.decode('utf-8')))
177 return
178 assert np.all(np.isfinite(distrib)), distrib
179 action = np.random.choice(len(distrib), p=distrib)
180 client.memory.append(TransitionExperience(
181 state, action, reward=None, value=value, prob=distrib[action]))
182 self.send_queue.put([client.ident, dumps(action)])
183 self.async_predictor.put_task([state], cb)
184
185 def _process_msg(self, client, state, reward, isOver):

Callers

nothing calls this directly

Calls 5

formatMethod · 0.80
allMethod · 0.80
appendMethod · 0.80
putMethod · 0.80

Tested by

no test coverage detected