[tune] Add PyTorch MNIST Example + Misc. Tweaks (#2708)

This commit is contained in:
Richard Liaw
2018-08-30 16:18:56 -07:00
committed by GitHub
parent 224d38cbb2
commit 0347e6418b
8 changed files with 492 additions and 17 deletions
+6 -5
View File
@@ -115,11 +115,12 @@ class FunctionRunner(Trainable):
time.sleep(1)
result = self._status_reporter._get_and_clear_status()
curr_ts_total = result.get(TIMESTEPS_TOTAL,
self._last_reported_timestep)
result.update(
timesteps_this_iter=(curr_ts_total - self._last_reported_timestep))
self._last_reported_timestep = curr_ts_total
curr_ts_total = result.get(TIMESTEPS_TOTAL)
if curr_ts_total is not None:
result.update(
timesteps_this_iter=(
curr_ts_total - self._last_reported_timestep))
self._last_reported_timestep = curr_ts_total
return result