def observe_lr(optimizer_name='main', observation_key='lr'):
 return observe_value(observation_key, (lambda trainer: trainer.updater.get_optimizer(optimizer_name).lr))

def observe_lr ( optimizer_name = 'main' , observation_key = 'lr' ) : return observe_value ( observation_key , ( lambda trainer : trainer . updater . get_optimizer ( optimizer_name ) . lr ) )
returns a trainer extension to record the learning rate .