multiml.agent.basic.sequential module
SequentialAgent module.
- class multiml.agent.basic.sequential.SequentialAgent(differentiable=None, diff_pretrain=False, diff_task_args=None, num_trials=None, **kwargs)
Bases:
BaseAgent
Agent execute sequential tasks.
Examples
>>> task0 = your_task0 >>> task1 = your_task1 >>> task2 = your_task2 >>> >>> agent = SequentialAgent(storegate=storegate, >>> task_scheduler=[task0, task1, task2], >>> metric=your_metric) >>> agent.execute() >>> agent.finalize()
- __init__(differentiable=None, diff_pretrain=False, diff_task_args=None, num_trials=None, **kwargs)
Initialize sequential agent.
- Parameters:
differentiable (str) –
keras
orpytorch
. If differentiable is given,ConnectionTask()
is created based on sequential tasks. If differentiable is None (default), sequential tasks are executed step by step.diff_pretrain (bool) – If True, each subtask is trained before creating ConnectionTask()`.
diff_task_args (dict) – arbitrary args passed to
ConnectionTask()
.num_trials (ine) – number of trials. Average value of trials is used as final metric.
- property result
Return result of execution.
- execute()
Execute sequential agent.
- finalize()
Finalize sequential agent.
- execute_subtasktuples(subtasktuples, counter)
Execute given subtasktuples.
- execute_pipeline(subtasktuples, counter, trial=None)
Execute pipeline.
- execute_differentiable(subtasktuples, counter, trial=None)
Execute connection model.