Nous.Eval.Optimizer.Strategies.GridSearch (nous v0.15.5)

View Source

Exhaustive grid search optimization strategy.

Grid search evaluates all combinations of parameter values in the search space. Best for small search spaces where you want to guarantee finding the global optimum.

Options

  • :max_trials - Maximum number of trials (default: unlimited)
  • :timeout - Total timeout in ms (default: 3600000 = 1 hour)
  • :parallel - Number of parallel trials (default: 1)
  • :early_stop - Stop if score reaches threshold
  • :verbose - Print progress (default: true)
  • :shuffle - Randomize order of configurations (default: false)

Example

Optimizer.optimize(suite, params,
  strategy: :grid_search,
  metric: :score,
  max_trials: 100,
  verbose: true
)

Limitations

Grid search becomes impractical for large search spaces. For N parameters with M values each, the total combinations is M^N. Consider using :random or :bayesian strategies for larger spaces.