releso.agent.BaseTrainingAgent

class releso.agent.BaseTrainingAgent(*, save_location: Path, logger_name: str | None = None, tensorboard_log: str | None = None, policy: Literal['MlpPolicy', 'CnnPolicy', 'MultiInputPolicy'], use_custom_feature_extractor: Literal['resnet18', 'mobilenet_v2'] | None = None, cfe_without_linear: bool = False, policy_kwargs: Dict[str, Any] | None = None)

Bases: BaseAgent

BaseTraining agent definition.

The class BaseAgent should be used as the base class for all classes defining agents for the ReLeSO framework.

__init__(**data: Any) None

Constructor for the ReLeSO basemodel object.

Methods

convert_to_pathlib_add_datetime(v)

Add timestamp to save_location, of applicable.

get_additional_kwargs(**kwargs)

Add additional keyword arguments for agent instantiation.

get_logger()

Gets the currently defined environment logger.

get_next_tensorboard_experiment_name()

Return tensorboard experiment name.

set_logger_name_recursively(logger_name)

Set the logger_name variable for all child elements.

Attributes

policy

policy defines the network structure which the agent uses

use_custom_feature_extractor

If given the str identifies the Custom Feature Extractor to be added.

cfe_without_linear

use the custom feature extractor with out a final linear layer

policy_kwargs

additional arguments to be passed to the policy on creation

tensorboard_log

base directory of the tensorboard logs if given an experiment name with a current timestamp is also added.

save_location

Definition of the save location of the logs and validation results.

logger_name

name of the logger.

cfe_without_linear: bool

use the custom feature extractor with out a final linear layer

get_additional_kwargs(**kwargs) Dict[str, Any]

Add additional keyword arguments for agent instantiation.

Reads and gets the additional keyword arguments for the agent definition.

Returns:

Dictionary of the needed additional keywords.

Return type:

Dict[str, Any]

policy: Literal['MlpPolicy', 'CnnPolicy', 'MultiInputPolicy']

policy defines the network structure which the agent uses

policy_kwargs: Dict[str, Any] | None

additional arguments to be passed to the policy on creation

use_custom_feature_extractor: Literal['resnet18', 'mobilenet_v2'] | None

If given the str identifies the Custom Feature Extractor to be added.