|
|
lucid
0.0.1
Lifting-based Uncertain Control Invariant Dynamics
|
Interface for objects that can be optimised using gradient-based methods (e.g., LbfgsTuner). More...
#include <GradientOptimizable.h>
Public Member Functions | |
| double | objective_value () const |
| Get read-only access to the objective value of the this object. | |
| const Vector & | gradient () const |
| Get read-only access to the gradient of the this object. | |
Public Member Functions inherited from lucid::Estimator | |
| Estimator (Parameters parameters=NoParameters, const std::shared_ptr< const Tuner > &tuner=nullptr) | |
| Construct a new Estimator object. | |
| Matrix | operator() (ConstMatrixRef x) const |
| A model is a function that takes a \( n \times d_x \) matrix of row vectors in the input space \( \mathcal{X}
\) and returns a \( n \times d_y \) matrix of row vectors in the output space \( \mathcal{Y} \). | |
| virtual Matrix | predict (ConstMatrixRef x) const =0 |
| A model is a function that takes a \( n \times d_x \) matrix of row vectors in the input space \( \mathcal{X}
\) and returns a \( n \times d_y \) matrix of row vectors in the output space \( \mathcal{Y} \). | |
| Estimator & | fit (ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, const Tuner &tuner) |
| Fit the model to the given data. | |
| Estimator & | fit (ConstMatrixRef training_inputs, ConstMatrixRef training_outputs) |
| Fit the model to the given data. | |
| Estimator & | fit_online (ConstMatrixRef training_inputs, const OutputComputer &training_outputs, const Tuner &tuner) |
Fit the model to the data produced by the training_outputs OutputComputer. | |
| Estimator & | fit_online (ConstMatrixRef training_inputs, const OutputComputer &training_outputs) |
Fit the model to the data produced by the training_outputs OutputComputer. | |
| Estimator & | consolidate (ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, const Request request=Request::_) |
| Consolidate the model, making sure it is ready for use. | |
| Estimator & | consolidate (ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, Requests requests) |
| Consolidate the model, making sure it is ready for use. | |
| virtual double | score (ConstMatrixRef evaluation_inputs, ConstMatrixRef evaluation_outputs) const =0 |
Score the estimator assigning a numerical value to its accuracy in predicting the evaluation_outputs given the evaluation_inputs. | |
| const std::shared_ptr< const Tuner > & | tuner () const |
| Get read-only access to the tuner of the estimator. | |
| std::shared_ptr< const Tuner > & | m_tuner () |
| Get read-write access to the tuner of the estimator. | |
| virtual std::unique_ptr< Estimator > | clone () const =0 |
| Clone the estimator by creating a new instance with the same parameters. | |
| virtual std::string | to_string () const |
| Obtain the string representation of this object. | |
Public Member Functions inherited from lucid::Parametrizable | |
| template<IsAnyOf< int, double, const Vector & > T> | |
| T | get (Parameter parameter) const |
Get the value of the specified parameter. | |
| template<Parameter P> | |
| internal::ParameterType< P >::ref_type | get () const |
Get the value of the specified parameter. | |
| std::variant< int, double, Vector > | get (Parameter parameter) const |
Get the value of the specified parameter. | |
| void | set (Parameter parameter, const std::variant< int, double, Vector > &value) |
Set the parameter to the indicated value. | |
| template<Parameter P> | |
| void | set (const std::variant< int, double, Vector > &value) |
Set the parameter to the indicated value. | |
| void | set (Parameter parameter, std::size_t idx, const std::variant< std::vector< int >, std::vector< double >, std::vector< Vector > > &values) |
Set the parameter to the index-th value among the indicated values. | |
| template<Parameter P> | |
| void | set (std::size_t idx, const std::variant< std::vector< int >, std::vector< double >, std::vector< Vector > > &values) |
Set the parameter to the index-th value among the indicated values. | |
| virtual void | set (Parameter parameter, int value) |
Set the parameter to the indicated value. | |
| virtual void | set (Parameter parameter, double value) |
Set the parameter to the indicated value. | |
| virtual void | set (Parameter parameter, const Vector &value) |
Set the parameter to the indicated value. | |
| template<Parameter P> | |
| void | set (typename internal::ParameterType< P >::ref_type value) |
Set the parameter to the indicated value. | |
| bool | has (const Parameter parameter) const |
Check whether the parameter is present in this object. | |
| Parameters | parameters () const |
| Get read-only access to the parameters of the parametrizable object. | |
| std::vector< Parameter > | parameters_list () const |
| Get read-only access to the list of parameters of the parametrizable object. | |
| Parametrizable & | load (const Parametrizable &o) |
Load parameters from another Parametrizable object. | |
Protected Attributes | |
| double | objective_value_ |
| Objective value of the optimisation problem. | |
| Vector | gradient_ |
| Gradient of the objective function. | |
Protected Attributes inherited from lucid::Parametrizable | |
| Parameters | parameters_ |
| Parameters supported by this object. | |
Additional Inherited Members | |
Protected Member Functions inherited from lucid::Estimator | |
| virtual Estimator & | consolidate_impl (ConstMatrixRef training_inputs, ConstMatrixRef training_outputs, Requests requests)=0 |
| Concrete implementation of the consolidate method. | |
Protected Member Functions inherited from lucid::Parametrizable | |
| virtual int | get_i (Parameter parameter) const |
Get the value of the specified parameter. | |
| virtual double | get_d (Parameter parameter) const |
Get the value of the specified parameter. | |
| virtual const Vector & | get_v (Parameter parameter) const |
Get the value of the specified parameter. | |
Interface for objects that can be optimised using gradient-based methods (e.g., LbfgsTuner).
It provides access to the objective value and the gradient of the objective function needed for optimisation.
|
inlinenodiscard |
Get read-only access to the gradient of the this object.
If it has not been computed, it will be a vector of size 0.
|
inlinenodiscard |
Get read-only access to the objective value of the this object.
If it has not been computed, it will be \( -\infty \).