athena.utils.metric_check
¶
MetricChecker
Module Contents¶
Classes¶
Hold and save best metric checkpoint |
- class athena.utils.metric_check.MetricChecker(optimizer)¶
Hold and save best metric checkpoint
- Parameters
name – MetricChecker name
maximum – more greater more better
- __call__(loss, metrics, evaluate_epoch=-1)¶
summary the basic metrics like loss, lr :param metrics: average loss of all previous steps in one epoch
if training is False, it must be provided
- Parameters
evaluate_epoch – if evaluate_epoch >= 0: <evaluate mode> if evaluate_epoch == -1: <train mode> if evaluate_epoch < -1: <evaluate_log mode> (no tf.summary.write)
- Returns
return average and best(if improved) loss if training is False
- Return type
logging_str
- summary_train(loss, metrics)¶
generate summary of learning_rate, loss, metrics, speed and write on Tensorboard
- summary_evaluate(loss, metrics, epoch=-1)¶
If epoch > 0, return a summary of loss and metrics on dev set and write on Tensorboard Otherwise, just return evaluate loss and metrics