DRecPy.Evaluation package

DRecPy.Evaluation.loss_tracker module

class DRecPy.Evaluation.loss_tracker.LossTracker

Bases: object

add_epoch_callback_result(name, result, epoch)

Adds a new epoch callback result.

Parameters:
  • name – A string representing the name of the evaluated metric.
  • result – A number representing the evaluated value for the current metric.
  • epoch – A number representing the epoch for which the evaluated metric showed the passed result.
add_epoch_loss(loss)

Adds a new epoch loss.

Parameters:loss – The loss value obtained during the epoch.
display_graph(model_name=None, stopping_epoch=None, block=False)

Displays a graph containing the average batch loss per epoch, as well as the epoch callback results for each metric, if they exist.

Parameters:
  • model_name – A string representing the name of the model. If this is provided, the model name will be displayed on the title of the figure. Default: None.
  • stopping_epoch – An integer representing the epoch for which early stopping has been applied and therefore all network weights were reverted to.
  • block – A boolean indicating whether the displayed graph should block code execution or not. Default: False.
get_epoch_avg_loss()

Gets the current average epoch loss.

Returns:The current average epoch loss, computed from the provided epoch losses.
reset_epoch_losses()

Resets the stored epoch losses and sets the epoch average loss to 0.