Smooth-2Norm activation. More...
#include <smooth-2norm.hpp>
Public Types | |
| typedef ActivationDataAbstractTpl< Scalar > | ActivationDataAbstract |
| typedef ActivationModelAbstractTpl< Scalar > | Base |
| 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 | |
| ActivationModelSmooth2NormTpl (const std::size_t nr, const Scalar eps=Scalar(1.)) | |
| Initialize the smooth-2Norm activation model. | |
| virtual void | calc (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the smooth-2Norm function. | |
| virtual void | calcDiff (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the derivatives of the smooth-2Norm function. | |
| template<typename NewScalar> | |
| ActivationModelSmooth2NormTpl< NewScalar > | cast () const |
| virtual std::shared_ptr< ActivationDataAbstract > | createData () override |
| Create the smooth-2norm activation data. | |
| 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 Member Functions | |
| virtual void | print (std::ostream &os) const override |
| Print relevant information of the smooth-1norm model. | |
Protected Attributes | |
| Scalar | eps_ |
| < Dimension of the residual vector | |
| std::size_t | nr_ |
| Protected Attributes inherited from ActivationModelAbstractTpl< _Scalar > | |
| std::size_t | nr_ |
Smooth-2Norm activation.
This activation function describes a smooth representation of a 2-norm of a residual vector, i.e.
![\[ \begin{equation} \sqrt{\epsilon + sum^nr_{i=0}
\|r_i\|^2} \end{equation} \]](form_38.png)
where 



The computation of the function and it derivatives are carried out in calc() and caldDiff(), respectively.
Definition at line 32 of file smooth-2norm.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 39 of file smooth-2norm.hpp.
| typedef ActivationModelAbstractTpl<Scalar> Base |
Definition at line 40 of file smooth-2norm.hpp.
| typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract |
Definition at line 41 of file smooth-2norm.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 42 of file smooth-2norm.hpp.
| typedef MathBase::MatrixXs MatrixXs |
Definition at line 43 of file smooth-2norm.hpp.
| inlineexplicit |
Initialize the smooth-2Norm 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 53 of file smooth-2norm.hpp.
| inlineoverridevirtual |
Compute the smooth-2Norm function.
| [in] | data | Smooth-2Norm activation data |
| [in] | r | Residual vector ![]() |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 68 of file smooth-2norm.hpp.
| inlineoverridevirtual |
Compute the derivatives of the smooth-2Norm function.
| [in] | data | Smooth-2Norm activation data |
| [in] | r | Residual vector ![]() |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 85 of file smooth-2norm.hpp.
| inlineoverridevirtual |
Create the smooth-2norm activation data.
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 102 of file smooth-2norm.hpp.
| inline |
Definition at line 108 of file smooth-2norm.hpp.
| inlineoverrideprotectedvirtual |
Print relevant information of the smooth-1norm model.
| [out] | os | Output stream object |
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 120 of file smooth-2norm.hpp.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 38 of file smooth-2norm.hpp.
| protected |
| protected |
Definition at line 68 of file activation-base.hpp.