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

Method _trigger

tensorpack/callbacks/monitor.py:387–398  ·  view source on GitHub ↗

Add stats to json and dump to disk. Note that this method is idempotent.

(self)

Source from the content-addressed store, hash-verified

385 self._stat_now[name] = val
386
387 def _trigger(self):
388 """
389 Add stats to json and dump to disk.
390 Note that this method is idempotent.
391 """
392 if len(self._stat_now):
393 self._stat_now['epoch_num'] = self.epoch_num
394 self._stat_now['global_step'] = self.global_step
395
396 self._stats.append(self._stat_now)
397 self._stat_now = {}
398 self._write_stat()
399
400 def _write_stat(self):
401 tmp_filename = self._fname + '.tmp'

Callers 3

_before_trainMethod · 0.95
_trigger_stepMethod · 0.95
_trigger_epochMethod · 0.95

Calls 2

_write_statMethod · 0.95
appendMethod · 0.80

Tested by

no test coverage detected