callbacks
_callbacks
This file is a base class for implementation of Callbacks.
- class scalr.nn.callbacks._callbacks.CallbackBase(dirpath='.')[source]
Bases:
object
Base class to build callbacks.
- class scalr.nn.callbacks._callbacks.CallbackExecutor(dirpath: str, callbacks: list[dict])[source]
Bases:
object
Wrapper class to execute all enabled callbacks.
Enabled callbacks are executed with the early stopping callback executed last to return a flag for continuation or stopping of model training
early_stopping
This file is an implementation of early stopping callback.
- class scalr.nn.callbacks.early_stopping.EarlyStopping(dirpath: str = None, patience: int = 3, min_delta: float = 0.0001)[source]
Bases:
CallbackBase
Implements early stopping based upon validation loss.
- patience
Number of epochs with no improvement after which training will be stopped.
- min_delta
Minimum change in the monitored quantity to qualify as an improvement,
- i.e. an absolute change of less than min_delta, will count as no improvement.
model_checkpoint
This file is an implementation of model checkpoint callback.
- class scalr.nn.callbacks.model_checkpoint.ModelCheckpoint(dirpath: str, interval: int = 5)[source]
Bases:
CallbackBase
Model checkpointing to save model weights at regular intervals.
- epoch
An interger count of epochs trained.
- max_validation_acc
Keeps track of the maximum validation accuracy across all epochs.
- interval
Regular interval of model checkpointing.
tensorboard_logger
This file is an implementation of Tensorboard logging callback.
- class scalr.nn.callbacks.tensorboard_logger.TensorboardLogger(dirpath: str = '.')[source]
Bases:
CallbackBase
Tensorboard logging of the training process.
- epoch
An interger count of epochs trained.
- writer
Object that writes to tensorboard.
test_early_stopping
This is a test file for early_stopping.py