See also

For the technical specifications, go to valohai.yaml step.parameters section.

The Wikipedia definition of a hyperparameter is: “a parameter whose value is set before the learning process begins.” This definition exists to differentiate these values that control how the machine learning is conducted from parameters such as neural network weights that are actively changed during training. Thus, hyperparameters are a subset of parameters.

In the context of Valohai, all parameters to be recorded are defined before launching an execution. If you wish to record something that is defined or changes during runtime, use Valohai metadata.


Valohai supports numerous workloads in addition to normal machine learning training such as data generation and feature extraction. Check out What is Valohai? page to learn what else could be achieved.

This is the reason why we don’t always use the training-centric hyperparameter term.

Defining parameters

To keep track of parameters in Valohai, you add them as part of your YAML step.parameters.

Example of a valohai.yaml with a step defining 3 parameters:

- step:
    name: train
    image: python:3.6
      - python {parameters}
      - name: max_steps
        pass-as: --max_steps={v}
        type: float
        default: 300
      - name: learning_rate
        pass-as: --learning_rate={v}
        type: float
        default: 0.001
      - name: dropout
        pass-as: --dropout={v}
        type: float
        default: 0.9

The above would generate the following command by default:

python --max_steps=300 --learning_rate=0.001 --dropout=0.9

You can then parse the command-line arguments in your script.

import argparse

def parse_args():
   parser = argparse.ArgumentParser()
   parser.add_argument('--max_steps', type=int, default=300)
   parser.add_argument('--learning_rate', type=float, default=0.001)
   parser.add_argument('--dropout', type=float, default=0.9)
   return parser.parse_args()

args = parse_args()
print("Max steps: %s" % args.max_steps)


Python users can use the valohai-utils helper library to define and parse parameters.

import valohai

my_parameters = {
   'max_steps': 300,
   'learning_rate': 0.001,
   'dropout': 0.9,

valohai.prepare(step="helloworld", default_parameters=my_parameters)

print("Max steps: %s" % valohai.parameters('max_steps').value)

and generate valohai.yaml configuration file with the parameter definitions:

vh yaml step
vh exec run helloworld --adhoc

Selecting values

When you are creating a new Valohai execution using the web user interface, look for the Parameters subsection at the bottom.

Execution parameters.

Default values of the parameters are defined by the valohai.yaml, but they can be tweaked in the web user interface, command-line client or the API. All changes are version controlled as part of a Valohai execution.

🐞 Give feedback about this page