multiml.agent.BaseAgent
- class multiml.agent.BaseAgent(saver=None, storegate=None, task_scheduler=None, metric=None, metric_args=None)
Base class of agent.
All agent class need to inherit this
BaseAgentclass.- __init__(saver=None, storegate=None, task_scheduler=None, metric=None, metric_args=None)
Initialize base agent.
- Parameters:
saver (Saver or str) –
Saverclass instance. Ifsaveris None,Saverclass instance is created without any args. If Ifsaveris str, Saver` class instance is created with givensave_dir.storegate (StoreGate or dict) –
StoreGateclass instance. If dict is given,StoreGateclass instance is created with given dict args.task_scheduler (TaskScheduler or list) –
TaskSchedulerclass instance. If ordered tasks (list) are given,TaskScheduleris initialized with ordered tasks. Please seeTaskSchedulerclass for details.metric (str or BaseMetric) – str or Metric class instance. If str is given, Metric class is searched from multiml.agent.metric, and initialized with
metric_argsbelow.metric_args (dict) – arbitrary args of Metric class. This option is valid only if
metricis str.
Methods
__init__([saver, storegate, task_scheduler, ...])Initialize base agent.
execute()Execute base agent.
Execute and finalize base agent.
finalize()Finalize base agent.
Attributes
Return metric of base agent.
Return saver of base agent.
Return storegate of base agent.
Return task_scheduler of base agent.
- __init__(saver=None, storegate=None, task_scheduler=None, metric=None, metric_args=None)
Initialize base agent.
- Parameters:
saver (Saver or str) –
Saverclass instance. Ifsaveris None,Saverclass instance is created without any args. If Ifsaveris str, Saver` class instance is created with givensave_dir.storegate (StoreGate or dict) –
StoreGateclass instance. If dict is given,StoreGateclass instance is created with given dict args.task_scheduler (TaskScheduler or list) –
TaskSchedulerclass instance. If ordered tasks (list) are given,TaskScheduleris initialized with ordered tasks. Please seeTaskSchedulerclass for details.metric (str or BaseMetric) – str or Metric class instance. If str is given, Metric class is searched from multiml.agent.metric, and initialized with
metric_argsbelow.metric_args (dict) – arbitrary args of Metric class. This option is valid only if
metricis str.