mapping_networks.callbacks.MetricLogger¶
- class mapping_networks.callbacks.MetricLogger(log_every_n_batches: int = 10)¶
Log training and validation metrics using the standard
loggingmodule.- Parameters:
log_every_n_batches – Log batch metrics every N batches.
Example:
trainer = MappingTrainer( ..., callbacks=[MetricLogger(log_every_n_batches=50)], )
- __init__(log_every_n_batches: int = 10) None¶
Methods
__init__([log_every_n_batches])on_batch_end(trainer, batch_idx, loss_output)Called after processing each batch with the loss output.
on_batch_start(trainer, batch_idx)Called before processing each batch.
on_epoch_end(trainer, epoch, metrics)Called at the end of each epoch with aggregated metrics.
on_epoch_start(trainer, epoch)Called at the beginning of each epoch.
on_fit_end(trainer)Called once at the end of
fit().on_fit_start(trainer)Called once at the beginning of
fit().on_validation_end(trainer, metrics)Called after the validation loop with validation metrics.
on_validation_start(trainer)Called before the validation loop.