sage.plotting.loss_curves

Filename : loss_curves.py Description : Short description of the file

Created on 2026-03-21 17:41:20

__author__ = Narenraju Nagarajan __copyright__ = Copyright 2026, ProjectName __license__ = MIT Licence __version__ = 0.0.1 __maintainer__ = Narenraju Nagarajan __affiliation__ = N/A __email__ = N/A __status__ = [‘inProgress’, ‘Archived’, ‘inUsage’, ‘Debugging’]

GitHub Repository: NULL

Documentation: NULL

Functions

plot_loss_curves(training_loss, validation_loss[, ...])

Plot training and validation loss curves with optional best-epoch markers.

Module Contents

plot_loss_curves(training_loss, validation_loss, export_dir=None, save=True, best_epoch=None)[source]

Plot training and validation loss curves with optional best-epoch markers.

Generates two figures when training_loss has more than one column:

  1. Total loss — column 0 of both arrays.

  2. Per-parameter PE losses — remaining columns.

Parameters:
  • training_loss (numpy.ndarray, shape (E, L)) – Training losses per epoch; column 0 is the total loss, subsequent columns are individual PE component losses.

  • validation_loss (numpy.ndarray, shape (E, L)) – Validation losses in the same layout.

  • export_dir (str or None) – Directory to save figures (loss_curves.png, pe_loss_curves.png).

  • save (bool) – If True, save to disk; otherwise display interactively.

  • best_epoch (int or None) – Zero-based epoch index to mark with a star on all curves.