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:
BaseAgentBaseTraining 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 defines the network structure which the agent uses
If given the str identifies the Custom Feature Extractor to be added.
use the custom feature extractor with out a final linear layer
additional arguments to be passed to the policy on creation
tensorboard_logbase directory of the tensorboard logs if given an experiment name with a current timestamp is also added.
save_locationDefinition of the save location of the logs and validation results.
logger_namename 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.