2-norm barrier activation More...
#include <2norm-barrier.hpp>
Public Types | |
| typedef ActivationDataAbstractTpl< Scalar > | ActivationDataAbstract |
| typedef ActivationModelAbstractTpl< Scalar > | Base |
| typedef ActivationData2NormBarrierTpl< Scalar > | Data |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef MathBase::VectorXs | VectorXs |
| Public Types inherited from ActivationModelAbstractTpl< _Scalar > | |
| typedef ActivationDataAbstractTpl< Scalar > | ActivationDataAbstract |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef MathBase::MatrixXs | MatrixXs |
| typedef MathBase::VectorXs | VectorXs |
Public Member Functions | |
| ActivationModel2NormBarrierTpl (const std::size_t nr, const Scalar alpha=Scalar(0.1), const bool true_hessian=false) | |
| Initialize the 2-norm barrier activation model. | |
| virtual void | calc (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the 2-norm barrier function. | |
| virtual void | calcDiff (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the derivatives of the 2norm-barrier function. | |
| template<typename NewScalar> | |
| ActivationModel2NormBarrierTpl< NewScalar > | cast () const |
| virtual std::shared_ptr< ActivationDataAbstract > | createData () override |
| Create the 2norm-barrier activation data. | |
| const Scalar & | get_alpha () const |
| Get and set the threshold factor. | |
| virtual void | print (std::ostream &os) const override |
| Print relevant information of the 2-norm barrier model. | |
| void | set_alpha (const Scalar &alpha) |
| Public Member Functions inherited from ActivationModelAbstractTpl< _Scalar > | |
| ActivationModelAbstractTpl (const std::size_t nr) | |
| std::size_t | get_nr () const |
Public Attributes | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
| Public Attributes inherited from ActivationModelAbstractTpl< _Scalar > | |
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar | Scalar |
Protected Attributes | |
| Scalar | alpha_ |
| < Dimension of the residual vector | |
| std::size_t | nr_ |
| bool | true_hessian_ |
| Protected Attributes inherited from ActivationModelAbstractTpl< _Scalar > | |
| std::size_t | nr_ |
2-norm barrier activation
This activation function describes a quadratic barrier of the 2-norm of a residual vector, i.e.,
![\[\Bigg\{\begin{aligned}
&\frac{1}{2} (d - \alpha)^2, &\textrm{if} \,\,\, d < \alpha \\
&0, &\textrm{otherwise},
\end{aligned}
\]](form_27.png)
where 


The computation of the function and it derivatives are carried out in calc() and calcDiff(), respectively.
Definition at line 39 of file 2norm-barrier.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 46 of file 2norm-barrier.hpp.
| typedef ActivationModelAbstractTpl<Scalar> Base |
Definition at line 47 of file 2norm-barrier.hpp.
| typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract |
Definition at line 48 of file 2norm-barrier.hpp.
| typedef ActivationData2NormBarrierTpl<Scalar> Data |
Definition at line 49 of file 2norm-barrier.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 50 of file 2norm-barrier.hpp.
| inlineexplicit |
Initialize the 2-norm barrier activation model.
The default alpha value is defined as 0.1.
| [in] | nr | Dimension of the residual vector |
| [in] | alpha | Threshold factor (default 0.1) |
| [in] | true_hessian | Boolean indicating whether to use the Gauss-Newton approximation or true Hessian in computing the derivatives (default: false) |
Definition at line 62 of file 2norm-barrier.hpp.
| inlineoverridevirtual |
Compute the 2-norm barrier function.
| [in] | data | 2-norm barrier activation data |
| [in] | r | Residual vector ![]() |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 78 of file 2norm-barrier.hpp.
| inlineoverridevirtual |
Compute the derivatives of the 2norm-barrier function.
| [in] | data | 2-norm barrier activation data |
| [in] | r | Residual vector ![]() |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 101 of file 2norm-barrier.hpp.
| inlineoverridevirtual |
Create the 2norm-barrier activation data.
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 132 of file 2norm-barrier.hpp.
| inline |
Definition at line 137 of file 2norm-barrier.hpp.
| inline |
Get and set the threshold factor.
Definition at line 146 of file 2norm-barrier.hpp.
| inline |
Definition at line 147 of file 2norm-barrier.hpp.
| inlineoverridevirtual |
Print relevant information of the 2-norm barrier model.
| [out] | os | Output stream object |
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 154 of file 2norm-barrier.hpp.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 45 of file 2norm-barrier.hpp.
| protected |
| protected |
Use true Hessian in calcDiff if true, Gauss-Newton approximation if false
Definition at line 162 of file 2norm-barrier.hpp.
| protected |
Definition at line 68 of file activation-base.hpp.