ConfigurableBaseEstimator

class lightkit.ConfigurableBaseEstimator(*, default_params=None, user_params=None, overwrite_params=None)[source]

Bases: lightkit.estimator.base.BaseEstimator, Generic[lightkit.estimator.configurable.M]

Extension of the base estimator which allows to manage a single model that uses the lightkit.nn.Configurable mixin.

Parameters
  • default_params (dict[str, Any] | None) -- Estimator-specific parameters that provide defaults for configuring the PyTorch Lightning trainer. An example might be setting max_epochs. Overwrites the default parameters established by the base estimator.

  • user_params (dict[str, Any] | None) -- User-specific parameters that configure the PyTorch Lightning trainer. This dictionary should be passed through from a trainer_params init argument in subclasses. Overwrites any of the default parameters.

  • overwrite_params (dict[str, Any] | None) -- PyTorch Lightning trainer flags that need to be ensured independently of user-provided parameters. For example, max_epochs could be fixed to a certain value.

Methods

load_attributes

Loads the fitted attributes that are stored at the fitted path.

save_attributes

Saves the fitted attributes of this estimator.

Inherited Methods

clone

Clones the estimator without copying any fitted attributes.

get_params

Returns the estimator's parameters as passed to the initializer.

load

Loads the estimator and (if available) the fitted model.

load_parameters

Initializes this estimator by loading its parameters.

save

Saves the estimator to the provided directory.

save_parameters

Saves the parameters of this estimator.

set_params

Sets the provided values on the estimator.

trainer

Returns the trainer as configured by the estimator.

Attributes

persistent_attributes

Returns the list of fitted attributes that ought to be saved and loaded.

model_