piglot.optimiser.Optimiser

class Optimiser(name: str, objective: Objective)[source]

Bases: ABC

Interface for implementing different optimization algorithms.

Methods

_init_optimiser(n_iter, parameters, pbar, loss, stop_criteria):

constructs the attributes for the optimiser.

optimise(loss, n_iter, parameters, stop_criteria = StoppingCriteria()):

initiates optimiser.

_optimise(self, func, n_dim, n_iter, bound, init_shot):

performs the optimization.

_progress_check(self, i_iter, curr_value, curr_solution):

evaluates the optimiser progress.

Methods

optimise

Optimiser for the outside world.

optimise(n_iter: int, parameters: ~piglot.parameter.ParameterSet, output_dir: str, stop_criteria: ~piglot.optimiser.StoppingCriteria = <piglot.optimiser.StoppingCriteria object>, verbose: bool = True) Tuple[float, ndarray][source]

Optimiser for the outside world.

Parameters

objectiveObjective

Objective function to optimise.

n_iterint

Maximum number of iterations.

parametersParameterSet

Set of parameters to optimise.

output_dirstr

Whether to write output to the output directory, by default None.

stop_criteriaStoppingCriteria

List of stopping criteria, by default none attributed.

verbosebool

Whether to output progress status, by default True.

Returns

float

Best observed objective value.

np.ndarray

Observed optimum of the objective.