Skip to content

provider

provider

Protocol for components that declare training callbacks.

CallbackProvider

Bases: Protocol

Components that provide training callbacks implement this protocol.

Decoders, algorithms, and loss modules can declare callbacks by adding a get_callbacks method. The workspace collects these at training setup. Uses @runtime_checkable so components don't need to import or inherit this protocol.

get_callbacks

get_callbacks(experiment_config)

Return training callbacks contributed by this component.

Source code in src/versatil/training/callbacks/provider.py
def get_callbacks(self, experiment_config: ExperimentConfig) -> list[Callback]:
    """Return training callbacks contributed by this component."""
    ...