Skip to content

Grid Search

Introduction

The grid search explores the search space by starting from a corner and progressing step_size-steps per iteration. Increasing the step_size enables a more uniform exploration of the search space.

Example

from hyperactive import Hyperactive
from hyperactive.optimizers import GridSearchOptimizer

...

optimizer = GridSearchOptimizer(step_size=3)

hyper = Hyperactive()
hyper.add_search(model, search_space, n_iter=50, optimizer=optimizer)
hyper.run()

About the implementation

The implementation of this grid-search was realized by Thomas Gak-Deluen and his team. The algorithm works by choosing a direction in the beginning and moving through the search space one 2-dimensional-plane at a time.

Parameters

step_size

The number of steps the grid search takes after each iteration. If this parameter is set to 3 the grid search won't select the next position, but the one it would normally select after 3 iterations. This way we get a sparse grid after the first pass through the search space. After the first pass is done the grid search starts at the beginning and does a second pass with the same step size. And a third pass after that.

  • type: int
  • default: 1
  • typical range: 1 ... 1000