Smooth-abs activation. More...
#include <smooth-1norm.hpp>
Public Types | |
| typedef ActivationDataAbstractTpl< Scalar > | ActivationDataAbstract |
| typedef ActivationModelAbstractTpl< Scalar > | Base |
| typedef ActivationDataSmooth1NormTpl< Scalar > | Data |
| typedef MathBaseTpl< Scalar > | MathBase |
| typedef MathBase::MatrixXs | MatrixXs |
| 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 | |
| ActivationModelSmooth1NormTpl (const std::size_t nr, const Scalar eps=Scalar(1.)) | |
| Initialize the smooth-abs activation model. | |
| virtual void | calc (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) |
| Compute the smooth-abs function. | |
| virtual void | calcDiff (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) |
| Compute the derivatives of the smooth-abs function. | |
| virtual std::shared_ptr< ActivationDataAbstract > | createData () |
| Create the smooth-abs activation data. | |
| virtual void | print (std::ostream &os) const |
| Print relevant information of the smooth-1norm model. | |
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 | eps_ |
| < Dimension of the residual vector | |
Protected Attributes inherited from ActivationModelAbstractTpl< _Scalar > | |
| std::size_t | nr_ |
Smooth-abs activation.
This activation function describes a smooth representation of an absolute activation (1-norm) for each element of a residual vector, i.e.
\[ \begin{equation} sum^nr_{i=0} \sqrt{\epsilon + \|r_i\|^2} \end{equation} \]
where \(\epsilon\) defines the smoothing factor, \(r_i\) is the scalar residual for the \(i\) constraints, \(nr\) is the dimension of the residual vector.
The computation of the function and it derivatives are carried out in calc() and caldDiff(), respectively.
calc(), calcDiff(), createData() Definition at line 37 of file smooth-1norm.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 43 of file smooth-1norm.hpp.
| typedef ActivationModelAbstractTpl<Scalar> Base |
Definition at line 44 of file smooth-1norm.hpp.
| typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract |
Definition at line 45 of file smooth-1norm.hpp.
| typedef ActivationDataSmooth1NormTpl<Scalar> Data |
Definition at line 46 of file smooth-1norm.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 47 of file smooth-1norm.hpp.
| typedef MathBase::MatrixXs MatrixXs |
Definition at line 48 of file smooth-1norm.hpp.
|
inlineexplicit |
Initialize the smooth-abs activation model.
The default eps value is defined as 1.
| [in] | nr | Dimension of the residual vector |
| [in] | eps | Smoothing factor (default: 1.) |
Definition at line 58 of file smooth-1norm.hpp.
|
inlinevirtual |
Definition at line 70 of file smooth-1norm.hpp.
|
inlinevirtual |
Compute the smooth-abs function.
| [in] | data | Smooth-abs activation data |
| [in] | r | Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\) |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 78 of file smooth-1norm.hpp.
|
inlinevirtual |
Compute the derivatives of the smooth-abs function.
| [in] | data | Smooth-abs activation data |
| [in] | r | Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\) |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 97 of file smooth-1norm.hpp.
|
inlinevirtual |
Create the smooth-abs activation data.
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 116 of file smooth-1norm.hpp.
|
inlinevirtual |
Print relevant information of the smooth-1norm model.
| [out] | os | Output stream object |
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 125 of file smooth-1norm.hpp.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 42 of file smooth-1norm.hpp.
|
protected |
< Dimension of the residual vector
Smoothing factor
Definition at line 131 of file smooth-1norm.hpp.