trainer
Implement the trainer interface.
Classes:
| Name | Description |
|---|---|
Trainer |
Interface to train a model along with its explanations. |
FrozenModelTrainer |
Interface to train explanations only; frozen model mode. |
Functions:
| Name | Description |
|---|---|
wrapped_from_dict |
Overwrite from_dict method of ExplainableTrainerParameters class. |
Trainer
#
Interface to train a model along with its explanations.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
_Loss
|
The loss to use during the training. |
required |
|
partial[Optimizer]
|
A partial torch optimizer. |
required |
|
list[Callback] | None
|
Optional list of callbacks to use during training. |
None
|
|
DictMetrics | None
|
Optional dictionary of metrics to use during training. |
None
|
|
int
|
|
required |
|
int
|
|
0
|
|
int | None
|
|
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
loss |
XpdeepLoss
|
|
optimizer |
partial[Optimizer]
|
|
FrozenModelTrainer(max_epochs: int, start_epoch: int = 0)
#
Interface to train explanations only; frozen model mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
XpdeepLoss | None
|
|
required |
|
partial[Optimizer] | None
|
|
required |
|
int
|
|
required |
|
int
|
|
0
|
|
list[Union[EarlyStopping, Scheduler, ModelCheckpoint]] | None
|
|
None
|
|
DictMetrics | None
|
|
None
|
|
int | None
|
|
None
|
Source code in src/xpdeep/trainer/trainer.py
wrapped_from_dict(cls: type[ExplainableTrainerParameters], src_dict: Mapping[str, object]) -> ExplainableTrainerParameters
#
Overwrite from_dict method of ExplainableTrainerParameters class.