Steps ​
Steps is an abstract concept to organize your tasks. In many situations, a run will be a regular task (a training for example) and you will want to organize it in a more granular way. This is where steps come in. A step is a sub-task of a run. It can be a training epochs, a validation, a test, a data preprocessing, etc.
We have designed the interface so that we roughly have ten steps per run. If you need more, you should reduce the number of steps or organize them in a more granular way.
WARNING
Steps must always be a part of a run. If you attempt to create a step without a run, the step will not be created.
Start a step ​
You can create a step using the create_step
method. You can also create a step using the Step
context manager.
INFO
We highly recommend using the Step
context manager to create a step. It will automatically end the step when the context is exited. It also handles the errors and exceptions in a more elegant way.
from pyhectiqlab import Step
with Step() as step:
pass
import pyhectiqlab.functional as hl
hl.start_step()
from pyhectiqlab import Step
step = Step()
Parameter | Type | Description |
---|---|---|
name | str | The name of the step. |
description | str | The description of the step. |
metadata | dict | The metadata of the step. |
status | str | The status of the step. |
run_id | str | The ID of the run to which the step belongs. If not provided, the step will be created in the current run. |
End a step ​
If you have used the functional or object-oriented approach to create a step, you can end it using the end
method. If you have used the contextual approach, the step will be ended automatically when the context is exited.
from pyhectiqlab import Step
with Step() as step:
pass
# The step will be ended automatically
import pyhectiqlab.functional as hl
hl.start_step()
hl.end_step()
step = Step()
step.end()
Update a step ​
You can update a step using the update
method.
import pyhectiqlab.functional as hl
hl.update_step(name="My new name")
step.update(name="My new name")
hectiq-lab Step.update --step 9c29ckw0 --name "My new name"