nemos.solvers.SolverSpec#
- class nemos.solvers.SolverSpec(algo_name, backend, implementation)[source]#
Bases:
objectSolver specification representing an entry in the solver registry.
A solver is specified by: - the name of the algorithm it implements - its backend (optimization library or custom) - the class implementing the optimization method
(ideally compatible with the AbstractSolver and SolverProtocol interface)
Examples
>>> import nemos as nmo >>> spec = nmo.solvers.SolverSpec("BFGS", "optimistix", nmo.solvers._optimistix_solvers.OptimistixBFGS) >>> spec.algo_name 'BFGS' >>> spec.backend 'optimistix' >>> spec.implementation <class 'nemos.solvers._optimistix_solvers.OptimistixBFGS'>
Attributes
- Parameters:
algo_name (str)
backend (str)
implementation (Type[SolverProtocol])
- __init__(algo_name, backend, implementation)#
- Parameters:
algo_name (str)
backend (str)
implementation (Type[SolverProtocol])
- Return type:
None
Methods
__init__(algo_name, backend, implementation)- implementation: Type[SolverProtocol]#