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

Method reset_stats

examples/DeepQNetwork/expreplay.py:241–254  ·  view source on GitHub ↗

Returns: mean, max: two stats of the runners, to be added to backend

(self)

Source from the content-addressed store, hash-verified

239 self._runners[0].step(exploration)
240
241 def reset_stats(self):
242 """
243 Returns:
244 mean, max: two stats of the runners, to be added to backend
245 """
246 scores = list(itertools.chain.from_iterable([v.total_scores for v in self._runners]))
247 for v in self._runners:
248 v.total_scores.clear()
249
250 try:
251 return np.mean(scores), np.max(scores)
252 except Exception:
253 logger.exception("Cannot compute total scores in EnvRunner.")
254 return None, None
255
256
257class ExpReplay(DataFlow, Callback):

Callers 1

_triggerMethod · 0.80

Calls 2

meanMethod · 0.80
maxMethod · 0.80

Tested by

no test coverage detected