Grid Search
Grid Search tests all possible combinations of your specified parameter values.
It's the most thorough approach, every combination gets evaluated. This works well when you have a manageable parameter space and want exhaustive results.
💡 Tip: For large parameter spaces, consider Random Search or Bayesian Optimization to reduce execution count.
Before you start
You need at least one step with parameters defined in your valohai.yaml:
- step:
name: train-model
image: tensorflow/tensorflow:2.6.0
command:
- python train.py {parameters}
parameters:
- name: learning_rate
default: 0.001
type: float
- name: batch_size
default: 32
type: integerYou can also launch a Task from a completed execution without editing your YAML.
Parameter types
When creating a Grid Search Task, you can define parameters using these types:
Single: Use one specific value for this parameter across all executions.
Multiple: Provide a list of discrete values. Valohai will test every combination with other parameters.
Linear: Generate evenly spaced values between a minimum and maximum (e.g., 0.001, 0.002, 0.003).
Logspace: Generates values that are evenly spaced on a logarithmic scale, which means each step multiplies by a constant factor rather than adding a constant amount.

Create a Grid Search from Git
Open your project in Valohai
Go to the Tasks tab
Click Create Task
Select the step that contains your parameters
Scroll to Parameters
Confirm Grid search is selected as the Task type (this is the default)
For each parameter:
Choose the type (Single, Multiple, Linear, Logspace)
Enter the values:
Multiple: One value per line
Linear/Logspace: Min, max, and count
Click Create task
Valohai will queue executions for every parameter combination and start running them in parallel.
Create a Grid Search from an execution
If you've already run an execution and want to explore variations:
Open your project in Valohai
Go to the Executions tab and open a completed execution
Click the Task button in the top-right corner
Scroll to Parameters
Confirm Grid search is selected
Configure parameter values as described above
Click Create task
Example: Grid Search Task
This configuration creates 12 executions (3 learning rates × 4 batch sizes):
Parameter
Type
Values
learning_rate
Multiple
0.001, 0.01, 0.1
batch_size
Multiple
16, 32, 64, 128
Each execution will train with one unique combination, and you can compare results in the Task view.
Next steps
Bayesian Optimization for intelligent hyperparameter search
Manual Sweeps to specify exact parameter combinations
Task Blueprints to define Tasks in your YAML
Last updated
Was this helpful?
