multiml.agent.basic.base module
BaseAgent module.
- class multiml.agent.basic.base.BaseAgent(saver=None, storegate=None, task_scheduler=None, metric=None, metric_args=None)
Bases:
Agent
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.
- execute()
Execute base agent.
Users need to implement algorithms.
- finalize()
Finalize base agent.
- execute_finalize()
Execute and finalize base agent.
- property storegate
Return storegate of base agent.
- property saver
Return saver of base agent.
- property task_scheduler
Return task_scheduler of base agent.
- property metric
Return metric of base agent.