'Register a monitor to the trainer.
It can only be called before :meth:`Trainer.train` gets called.'

def register_monitor(self, mon):

    assert isinstance(mon, TrainingMonitor), mon
    assert (not isinstance(self.monitors, Monitors)), 'Cannot    register    more    monitors    after    trainer    was    setup!'
    if ((not self.is_chief) and mon.chief_only):
        logger.warn('Monitor    {}    is    chief-only,    skipped.'.format(str(mon)))
    else:
        self.monitors.append(mon)
        self.register_callback(mon)
