tabensemb.trainer.Trainer.plot_loss#

method

Trainer.plot_loss(program: str, model_name: str, ax=None, train_val: str = 'both', restored_epoch_mark: bool = True, restored_epoch_mark_if_last: bool = False, legend: bool = True, clr: Iterable | None = None, plot_kwargs: Dict | None = None, scatter_kwargs: Dict | None = None, legend_kwargs: Dict | None = None, figure_kwargs: Dict | None = None, savefig_kwargs: Dict | None = None, save_show_close: bool = True) Axes[source]#

Plot loss curves for a model.

Parameters:
program

The selected model base.

model_name

The selected model in the model base.

ax

matplotlib.axes.Axes

train_val

“train” to plot training loss only. “val” to plot validation loss only. “both” to plot both of them.

restored_epoch_mark

Plot the best epoch from where the model is restored after training.

restored_epoch_mark_if_last

Plot the best epoch when it is the last epoch.

legend

Show legends.

clr

A seaborn color palette or an Iterable of colors. For example seaborn.color_palette(“deep”).

plot_kwargs

Arguments for plt.plot

scatter_kwargs

Arguments for plt.scatter (used to plot the restored epoch).

legend_kwargs

Arguments for plt.legend.

figure_kwargs

Arguments for plt.figure.

savefig_kwargs

Arguments for plt.savefig

save_show_close

Whether to save, show (in the notebook), and close the figure if ax is not given.

Returns:
matplotlib.axes.Axes