Trainers
Reference information for the Trainers
API.
eva.core.trainers.Trainer
Bases: Trainer
Core trainer class.
This is an extended version of lightning's core trainer class.
For the input arguments, refer to ::class::lightning.pytorch.Trainer
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
args |
Any
|
Positional arguments of ::class:: |
()
|
default_root_dir |
str
|
The default root directory to store the output logs.
Unlike in ::class:: |
'logs'
|
n_runs |
int
|
The amount of runs (fit and evaluate) to perform in an evaluation session. |
1
|
kwargs |
Any
|
Kew-word arguments of ::class:: |
{}
|
Source code in src/eva/core/trainers/trainer.py
default_log_dir: str
property
Returns the default log directory.
setup_log_dirs
Setups the logging directory of the trainer and experimental loggers in-place.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
subdirectory |
str
|
Whether to append a subdirectory to the output log. |
''
|
Source code in src/eva/core/trainers/trainer.py
run_evaluation_session
Runs an evaluation session out-of-place.
It performs an evaluation run (fit and evaluate) the model
self._n_run
times. Note that the input base_model
would
not be modified, so the weights of the input model will remain
as they are.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model |
ModelModule
|
The base model module to evaluate. |
required |
datamodule |
DataModule
|
The data module. |
required |