Commit 3dcd7d32 authored by Yuxin Wu's avatar Yuxin Wu

update docs

parent 978f06a6
...@@ -140,8 +140,8 @@ class HyperParamSetter(Callback): ...@@ -140,8 +140,8 @@ class HyperParamSetter(Callback):
""" """
ret = self._get_value_to_set() ret = self._get_value_to_set()
if ret is not None and ret != self.last_value: if ret is not None and ret != self.last_value:
logger.info("{} at epoch {} will change to {:.8f}".format( logger.info("After epoch {}, {} will change to {:.8f}".format(
self.param.readable_name, self.epoch_num + 1, ret)) self.epoch_num, self.param.readable_name, ret))
self.last_value = ret self.last_value = ret
return ret return ret
......
...@@ -95,7 +95,11 @@ class Trainer(object): ...@@ -95,7 +95,11 @@ class Trainer(object):
@property @property
def epoch_num(self): def epoch_num(self):
""" """
The number of epochs that have finished. The number of the currently ongoing epoch.
An epoch is defined to cover the moment before calling `before_epoch` until after calling `trigger_epoch`.
i.e., in the `trigger_epoch` of epoch 3, `self.epoch_num` is 3.
If you need use `self.epoch_num` in your callback, you'll need to know this.
""" """
if self._epoch_num is not None: if self._epoch_num is not None:
# has started training # has started training
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment