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
BaseAgent
class.- __init__(saver=None, storegate=None, task_scheduler=None, metric=None, metric_args=None)
Initialize base agent.
- Parameters:
saver (Saver or str) –
Saver
class instance. Ifsaver
is None,Saver
class instance is created without any args. If Ifsaver
is str, Saver` class instance is created with givensave_dir
.storegate (StoreGate or dict) –
StoreGate
class instance. If dict is given,StoreGate
class instance is created with given dict args.task_scheduler (TaskScheduler or list) –
TaskScheduler
class instance. If ordered tasks (list) are given,TaskScheduler
is initialized with ordered tasks. Please seeTaskScheduler
class 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_args
below.metric_args (dict) – arbitrary args of Metric class. This option is valid only if
metric
is 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) –
Saver
class instance. Ifsaver
is None,Saver
class instance is created without any args. If Ifsaver
is str, Saver` class instance is created with givensave_dir
.storegate (StoreGate or dict) –
StoreGate
class instance. If dict is given,StoreGate
class instance is created with given dict args.task_scheduler (TaskScheduler or list) –
TaskScheduler
class instance. If ordered tasks (list) are given,TaskScheduler
is initialized with ordered tasks. Please seeTaskScheduler
class 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_args
below.metric_args (dict) – arbitrary args of Metric class. This option is valid only if
metric
is str.