Monitoring and Tracking

The monitor module provides training monitoring and experiment tracking.

Training Tracker

Training tracker for monitoring and logging training progress.

class fit.monitor.tracker.TrainingTracker(experiment_name: str | None = None, log_dir: str = './logs', early_stopping: Dict | None = None, save_best: bool = True, verbose: int = 1)[source]

Bases: object

Comprehensive training tracker for monitoring metrics, early stopping, and logging.

__init__(experiment_name: str | None = None, log_dir: str = './logs', early_stopping: Dict | None = None, save_best: bool = True, verbose: int = 1)[source]

Initialize training tracker.

Parameters:
  • experiment_name – Name of the experiment

  • log_dir – Directory to save logs

  • early_stopping – Early stopping configuration

  • save_best – Whether to save best model state

  • verbose – Verbosity level (0=silent, 1=normal, 2=verbose)

start_training()[source]

Mark the start of training.

update(epoch: int, metrics: Dict[str, float]) bool[source]

Update tracker with metrics for current epoch.

Parameters:
  • epoch – Current epoch number

  • metrics – Dictionary of metric names and values

Returns:

True if training should stop (early stopping), False otherwise

log_epoch_time(epoch_time: float)[source]

Log time taken for current epoch.

log_learning_rate(lr: float)[source]

Log current learning rate.

plot_metrics(metrics: List[str] | None = None, save_path: str | None = None)[source]

Plot training metrics.

Parameters:
  • metrics – List of metrics to plot (default: all)

  • save_path – Path to save plot (optional)

export(filepath: str | None = None, format: str = 'json') str[source]

Export training logs to file.

Parameters:
  • filepath – Path to save file (auto-generated if None)

  • format – Export format (“json” or “csv”)

Returns:

Path to exported file

load(filepath: str) bool[source]

Load training logs from file.

Parameters:

filepath – Path to log file (.json)

Returns:

True if successful, False otherwise

summary() Dict[str, Any][source]

Get training summary.

Returns:

Dictionary with training summary

__str__() str[source]

String representation of tracker.

Metrics

Callbacks