GridOptimizer

class hoomd.tune.GridOptimizer(n_bins: int = 5, n_rounds: int = 1, maximize: bool = True)

Bases: Optimizer

Optimize by consistently narrowing the range where the extrema is.

The algorithm is as follows. Given a domain \(d = [a, b]\), \(d\) is broken up into n_bins subsequent bins. For the next n_bins calls, the optimizer tests the function value at each bin center. The next call does one of two things. If the number of rounds has reached n_rounds the optimization is done, and the center of the best bin is the solution. Otherwise, another round is performed where the bin’s extent is the new domain.

Warning

Changing a tunables domain during usage of a GridOptimizer results in incorrect behavior.

Parameters:
  • n_bins (int, optional) – The number of bins in the range to test (defaults to 5).

  • n_rounds (int, optional) – The number of rounds to perform the optimization over (defaults to 1).

  • maximize (bool, optional) – Whether to maximize or minimize the function (defaults to True).

__eq__(other)

Test for equality.

reset()

Reset all solving internals.

solve_one(tunable)

Perform one step of optimization protocol.