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 delta=Scalar(1.)) | |
| Initialize the smooth-abs activation model. | |
| virtual void | calc (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the smooth-abs function. | |
| virtual void | calcDiff (const std::shared_ptr< ActivationDataAbstract > &data, const Eigen::Ref< const VectorXs > &r) override |
| Compute the derivatives of the smooth-abs function. | |
| template<typename NewScalar> | |
| ActivationModelSmooth1NormTpl< NewScalar > | cast () const |
| virtual std::shared_ptr< ActivationDataAbstract > | createData () override |
| Create the smooth-abs activation data. | |
| Scalar | get_delta () const |
| virtual void | print (std::ostream &os) const override |
| 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 | delta_ |
| < Dimension of the residual vector | |
| std::size_t | nr_ |
| Protected Attributes inherited from ActivationModelAbstractTpl< _Scalar > | |
| std::size_t | nr_ |
Smooth-abs activation.
This activation function describes a smooth representation of the 1-norm of a residual vector:
![\[ a(\mathbf{r}) =
\sum_{i=0}^{nr-1}
\delta^2\left(\sqrt{1 + (r_i/\delta)^2} - 1\right).
\]](form_34.png)
Here, 







The computation of the function and its derivatives are carried out in calc() and calcDiff(), respectively.
Definition at line 42 of file smooth-1norm.hpp.
| typedef MathBaseTpl<Scalar> MathBase |
Definition at line 49 of file smooth-1norm.hpp.
| typedef ActivationModelAbstractTpl<Scalar> Base |
Definition at line 50 of file smooth-1norm.hpp.
| typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract |
Definition at line 51 of file smooth-1norm.hpp.
| typedef ActivationDataSmooth1NormTpl<Scalar> Data |
Definition at line 52 of file smooth-1norm.hpp.
| typedef MathBase::VectorXs VectorXs |
Definition at line 53 of file smooth-1norm.hpp.
| typedef MathBase::MatrixXs MatrixXs |
Definition at line 54 of file smooth-1norm.hpp.
| inlineexplicit |
Initialize the smooth-abs activation model.
The default delta value is defined as 1.
| [in] | nr | Dimension of the residual vector |
| [in] | delta | Strictly positive smoothing scale (default: 1) |
Definition at line 64 of file smooth-1norm.hpp.
| inlineoverridevirtual |
Compute the smooth-abs function.
| [in] | data | Smooth-abs activation data |
| [in] | r | Residual vector |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 80 of file smooth-1norm.hpp.
| inlineoverridevirtual |
Compute the derivatives of the smooth-abs function.
| [in] | data | Smooth-abs activation data |
| [in] | r | Residual vector |
Implements ActivationModelAbstractTpl< _Scalar >.
Definition at line 100 of file smooth-1norm.hpp.
| inlineoverridevirtual |
Create the smooth-abs activation data.
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 121 of file smooth-1norm.hpp.
| inline |
Definition at line 126 of file smooth-1norm.hpp.
| inline |
Definition at line 132 of file smooth-1norm.hpp.
| inlineoverridevirtual |
Print relevant information of the smooth-1norm model.
| [out] | os | Output stream object |
Reimplemented from ActivationModelAbstractTpl< _Scalar >.
Definition at line 139 of file smooth-1norm.hpp.
| EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar |
Definition at line 48 of file smooth-1norm.hpp.
| protected |
| protected |
Definition at line 68 of file activation-base.hpp.