pybop.optimisers.base_optimiser#
Classes#
A base class for defining optimisation methods. |
|
A base class for optimiser options. |
Module Contents#
- class pybop.optimisers.base_optimiser.BaseOptimiser(problem: pybop.problems.problem.Problem, options: OptimiserOptions | None = None)[source]#
A base class for defining optimisation methods.
This class serves as a base class for creating optimisers. It provides a basic structure for an optimisation algorithm, including the initial setup and a method stub for performing the optimisation process. Child classes should override _set_up_optimiser and the _run method with a specific algorithm.
- Parameters:
problem (pybop.Problem) – The problem to optimise.
options (pybop.OptimiserOptions , optional) – Options for the optimiser, such as multistart.
- abstractmethod _run() pybop._result.OptimisationResult[source]#
Contains the logic for the optimisation algorithm.
This method should be implemented by child classes to perform the actual optimisation.
- Raises:
NotImplementedError – If the method has not been implemented by the subclass.
- abstractmethod _set_up_optimiser()[source]#
Parse optimiser options and prepare the optimiser.
This method should be implemented by child classes.
- Raises:
NotImplementedError – If the method has not been implemented by the subclass.
- static default_options() OptimiserOptions[source]#
Returns the default options for the optimiser.
- abstractmethod name() str[source]#
Returns the name of the optimiser, to be overwritten by child classes.
- Returns:
The name of the optimiser
- Return type:
str
- run() pybop._result.OptimisationResult[source]#
Run the optimisation and return the optimised parameters and final cost.
- Returns:
results – The pybop optimisation result class.
- Return type:
- property logger: pybop._logging.Logger | None[source]#
- property options: OptimiserOptions[source]#
Returns the options for the optimiser.
- property problem: pybop.problems.problem.Problem[source]#
Returns the optimisation problem object.