Shortcuts

Source code for lumin.nn.callbacks.callback

from typing import Optional

from .abs_callback import AbsCallback
from ..models.abs_model import AbsModel
from ...plotting.plot_settings import PlotSettings

__all__ = ['Callback']


[docs]class Callback(AbsCallback): r''' Base callback class from which other callbacks should inherit. Arguments: model: model to refer to during training plot_settings: PlotSettings class ''' def __init__(self, model:Optional[AbsModel]=None, plot_settings:PlotSettings=PlotSettings()): if model is not None: self.set_model(model) self.set_plot_settings(plot_settings)
[docs] def set_model(self, model:AbsModel) -> None: r''' Sets the callback's model in order to allow the callback to access and adjust model parameters Arguments: model: model to refer to during training ''' self.model = model
[docs] def set_plot_settings(self, plot_settings:PlotSettings) -> None: r''' Sets the plot settings for any plots produced by the callback Arguments: plot_settings: PlotSettings class ''' self.plot_settings = plot_settings
Read the Docs v: v0.4.0.1
Versions
latest
stable
v0.4.0.1
v0.3.1
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.

Docs

Access comprehensive developer and user documentation for LUMIN

View Docs

Tutorials

Get tutorials for beginner and advanced researchers demonstrating many of the features of LUMIN

View Tutorials