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 gradient_free_optimizers import GridSearchOptimizer

...

opt = GridSearchOptimizer(search_space, step_size=3)
opt.search(objective_function, n_iter=100)

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

direction

The direction the grid-search will walk through the search-space.

  • type: str
  • default: "diagonal"
  • possible values: "diagonal", "orthogonal"