Experimenting with different hyperparameters individually can be a time-consuming process. Valohai simplifies hyperparameter tuning through parallel executions and grid searches.
When initiating a task, instead of specifying a single value for a single hyperparameter, you have the option to define multiple values simultaneously. Various modes are available for this purpose, including:
- Single: Assign a single value for the hyperparameter.
- Multiple: Define multiple specific values for the hyperparameter.
- Linear: Specify a range of values with linear spacing.
- Logspace: Define values in a logarithmic space.
- Random: Select values randomly within a specified range.
Create a Grid Search
What do you need?
To create a Grid Search -task you’ll need to have atleast one step with parameters defined in your valohai.yaml
You can also use the web app to launch a task based on an completed execution.
From Git
Here’s how to create a Task for a grid search in Valohai:
- Open your project in Valohai
- Navigate to the Task tab.
- Click “Create Task.”
- Select the Step that contains the parameters you want to use for the grid search.
- Scroll down to the “Parameters” section.
- Choose “Grid search” as the Task type (this is the default).
- Set the values for each parameter based on your search requirements.
- For each parameter, choose the type from options like “Single,” “Multiple,” “Linear,” “Logspace,” or “Random.”
- Input the corresponding values for the selected type (for multiple values, input one value per line).
- Click on “Create task.”
From an adhoc execution
Here’s how to create a Task from an adhoc execution:
- Open your project in Valohai
- Open a completed execution
- Click on the “Task” button, which is located in the top right corner of the details page.
- Scroll down to the “Parameters” section.
- Choose “Grid search” as the Task type (this is the default).
- Set the values for each parameter based on your search requirements.
- For each parameter, choose the type from options like “Single,” “Multiple,” “Linear,” “Logspace,” or “Random.”
- Input the corresponding values for the selected type (for multiple values, input one value per line).
- Click on “Create task.”