Skip to content

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.

python
from pyhectiqlab import Step
with Step() as step:
    pass
python
import pyhectiqlab.functional as hl
hl.start_step()
python
from pyhectiqlab import Step
step = Step()
ParameterTypeDescription
namestrThe name of the step.
descriptionstrThe description of the step.
metadatadictThe metadata of the step.
statusstrThe status of the step.
run_idstrThe 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.

python
from pyhectiqlab import Step
with Step() as step:
    pass
# The step will be ended automatically
python
import pyhectiqlab.functional as hl
hl.start_step()
hl.end_step()
python
step = Step()
step.end()

Update a step ​

You can update a step using the update method.

python
import pyhectiqlab.functional as hl
hl.update_step(name="My new name")
python
step.update(name="My new name")
bash
hectiq-lab Step.update --step 9c29ckw0 --name "My new name"