multiml.task.BaseTask
- class multiml.task.BaseTask(saver=None, input_saver_key='tmpkey', output_saver_key='tmpkey', storegate=None, data_id=None, name=None)
Base task class for the default functions.
All subtasks defined by users, need to inherit this
BaseTask
. In user defined class, super.__init__() must be called in __init__() method. A task class is assumed to call its methods by following sequence:set_hps()
->execute()
->finalize()
. If task class instance is registered toTaskScheduler
as subtask,self._task_id
andself._subtask_id
are automatically set byTaskScheduler
.Examples
>>> task = BaseTask() >>> task.set_hps({'hp_layer': 5, 'hp_epoch': 256}) >>> task.execute() >>> task.finalize()
- __init__(saver=None, input_saver_key='tmpkey', output_saver_key='tmpkey', storegate=None, data_id=None, name=None)
Initialize base task.
- Parameters:
saver (Saver) –
Saver
class instance to record metadata data.input_saver_key (int) – unique saver key to retrieve metadata.
output_saver_key (int) – unique saver key to save metadata.
storegate (Storegate) –
Storegate
class instance to manage data.data_id (str) – data_id of
Storegate
, which is set by set_hps().name (str) – task’s name. If None,
classname
is used alternatively.
Methods
__init__
([saver, input_saver_key, ...])Initialize base task.
execute
()Execute base task.
finalize
()Finalize base task.
Returns unique identifier of task.
set_hps
(params)Set hyperparameters to this task.
Attributes
Return input_saver_key.
Return job_id of task.
Return name of task.
Return output_saver_key.
Return pool_id of task.
Return saver of task.
Return storegate of task.
Return subtask_id of task.
Return task_id of task.
Return trial_id of task.
- __init__(saver=None, input_saver_key='tmpkey', output_saver_key='tmpkey', storegate=None, data_id=None, name=None)
Initialize base task.
- Parameters:
saver (Saver) –
Saver
class instance to record metadata data.input_saver_key (int) – unique saver key to retrieve metadata.
output_saver_key (int) – unique saver key to save metadata.
storegate (Storegate) –
Storegate
class instance to manage data.data_id (str) – data_id of
Storegate
, which is set by set_hps().name (str) – task’s name. If None,
classname
is used alternatively.