noether.core.callbacks.default.lr

Classes

LrCallback

Callback to log the learning rate of the optimizer.

Module Contents

class noether.core.callbacks.default.lr.LrCallback(*args, **kwargs)

Bases: noether.core.callbacks.periodic.PeriodicCallback

Callback to log the learning rate of the optimizer.

This callback is initialized by the BaseTrainer and should not be added manually to the trainer’s callbacks.

Parameters:
  • callback_config – Configuration for the callback. See CallBackBaseConfig for available options.

  • trainer – Trainer of the current run.

  • model – Model of the current run.

  • data_containerDataContainer instance that provides access to all datasets.

  • trackerBaseTracker instance to log metrics to stdout/disk/online platform.

  • log_writerLogWriter instance to log metrics.

  • checkpoint_writerCheckpointWriter instance to save checkpoints.

  • metric_property_providerMetricPropertyProvider instance to access properties of metrics.

  • name – Name of the callback.

  • args (Any)

  • kwargs (Any)

periodic_callback(**_)

Hook called periodically based on the configured intervals.

This method is the primary entry point for periodic actions in subclasses. It is triggered when any of the configured intervals (every_n_epochs, every_n_updates, or every_n_samples) are reached.

Subclasses should override this method to implement periodic logic such as:

  • Calculating and logging expensive validation metrics

  • Saving specific model checkpoints or artifacts

  • Visualizing training progress (e.g., plotting samples)

  • Adjusting training hyperparameters or model state

Note

This method is executed within a torch.no_grad() context.

Parameters:
  • interval_type – “epoch”, “update”, “sample” or “eval” indicating which interval triggered this callback.

  • update_counterUpdateCounter instance providing details about the current training progress (epoch, update, sample counts).

  • **kwargs – Additional keyword arguments passed from the triggering hook (e.g., from after_epoch() or after_update()).

Return type:

None