Template Class ActivationModelSmooth1NormTpl
Defined in File smooth-1norm.hpp
Inheritance Relationships
Base Type
public crocoddyl::ActivationModelAbstractTpl< _Scalar >(Template Class ActivationModelAbstractTpl)
Class Documentation
-
template<typename _Scalar>
class ActivationModelSmooth1NormTpl : public crocoddyl::ActivationModelAbstractTpl<_Scalar> 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()andcaldDiff(), respectively.See also
Public Types
-
typedef MathBaseTpl<Scalar> MathBase
-
typedef ActivationModelAbstractTpl<Scalar> Base
-
typedef ActivationDataAbstractTpl<Scalar> ActivationDataAbstract
-
typedef ActivationDataSmooth1NormTpl<Scalar> Data
Public Functions
-
inline explicit ActivationModelSmooth1NormTpl(const std::size_t nr, const Scalar eps = Scalar(1.))
Initialize the smooth-abs activation model.
The default
epsvalue is defined as 1.- Parameters:
nr – [in] Dimension of the residual vector
eps – [in] Smoothing factor (default: 1.)
-
virtual ~ActivationModelSmooth1NormTpl() = default
Compute the smooth-abs function.
- Parameters:
data – [in] Smooth-abs activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
Compute the derivatives of the smooth-abs function.
- Parameters:
data – [in] Smooth-abs activation data
r – [in] Residual vector \(\mathbf{r}\in\mathbb{R}^{nr}\)
-
inline virtual std::shared_ptr<ActivationDataAbstract> createData() override
Create the smooth-abs activation data.
- Returns:
the activation data
-
template<typename NewScalar>
inline ActivationModelSmooth1NormTpl<NewScalar> cast() const
-
inline virtual void print(std::ostream &os) const override
Print relevant information of the smooth-1norm model.
- Parameters:
os – [out] Output stream object
Public Members
- EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef _Scalar Scalar
Protected Attributes
-
Scalar eps_
< Dimension of the residual vector
Smoothing factor
-
typedef MathBaseTpl<Scalar> MathBase