Fix #313 bug on reporting progress in torch TrainingPlan
See #313 (closed) for the bug description.
Main changes:
- Introduced a test that reproduces the problem
- I reordered the
batch_maxnum
exit condition to be after the logging, otherwise there was no logging output during the last batch (especially frustrating in the common scenario wherebatch_maxnum=1
-
batch_size
is no longer inferred fromlen(data)
, but it is obtained directly from the data loader. - to report progress on the number of samples processed until now, only doing
batch_size*batch_
may lead to problems in the last batch; instead, I wrapped it in a min functionmin(batch_size*batch_, total_num_samples)
- Fixed researcer-side reporting as well (did not implement the corresponding test for this)