|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward declaration - softplus fn More...
#include <softplus.hpp>
Public Types | |
| using | ConvexBase = Atom< Meta, Softplus< Meta, Child >, Child > |
| bring into scope convex fn alias / helpers | |
| using | Space = dom_space_t< meta_dom_t< Meta > > |
| alias to extract space type | |
Public Types inherited from convex::Atom< Meta, Softplus< Meta, Child >, Child > | |
| using | Domain = meta_dom_t< Meta > |
| Atom input domain. | |
| using | Codomain = meta_codom_t< Meta > |
| Atom output codomain. | |
| using | ChildrenT = std::tuple< atom_decay_t< Cs >... > |
| Tuple of decayed child atom types. | |
| using | T = dom_type_t< Domain > |
| Scalar field for the atom domain. | |
| using | PointT = dom_point_t< Domain > |
| Point type accepted by the atom domain. | |
Public Member Functions | |
| constexpr | Softplus (const Child &child_in) |
| CTOR. | |
| constexpr | Softplus (const Child &child_in, const affine::AffineMap< LiftedVarMat< T > > &map_in) |
| CTOR. | |
| constexpr MonotonicityType | monotonicity () const |
| mono | |
| constexpr T | operator() (const PointT &x) const |
| eval via operator overload | |
| constexpr T | eval (const PointT &x) const |
| eval impl | |
| template<T Scalar> | |
| constexpr auto | mul () const |
| mul | |
| constexpr auto | add (T beta) const |
| add | |
| template<AtomType Type, conic::BuilderLike Builder> | |
| constexpr auto | canonicalize_impl (const Builder &builder) const |
| softplus canonicalization | |
Public Member Functions inherited from convex::Atom< Meta, Softplus< Meta, Child >, Child > | |
| constexpr | Atom () |
| Construct a leaf atom with no children. | |
| constexpr | Atom (ChildrenT child_in) |
| Construct an atom with normalized children. | |
| constexpr void | validate_fn_domain (const auto &child) const |
| Validate DCP composition for a function child. | |
| constexpr void | validate_domain () const |
| Validate child domains, signs, curvature, and composition rules. | |
| constexpr auto | canonicalize (const Builder &builder) const |
| Dispatch canonicalization to the derived atom. | |
| constexpr const Softplus< Meta, Child > & | self () const |
| Return this object as the CRTP-derived atom type. | |
Public Attributes | |
| affine::AffineMap< LiftedVarMat< T > > | lift_map |
| member vars | |
| const int | idx {-3} |
Public Attributes inherited from convex::Atom< Meta, Softplus< Meta, Child >, Child > | |
| ChildrenT | children |
| Tuple of normalized child atoms. | |
Static Public Attributes | |
| static constexpr CurvatureType | Tag = meta_curv_v<Meta> |
| curvature tag | |
Static Public Attributes inherited from convex::Atom< Meta, Softplus< Meta, Child >, Child > | |
| static constexpr std::size_t | N |
| Domain dimension. | |
| static constexpr std::size_t | M |
| Codomain dimension. | |
| static constexpr CurvatureType | Curvature |
| Curvature declared by atom metadata. | |
| static constexpr VarType | DomSign |
| Domain sign declared by atom metadata. | |
| static constexpr VarType | CodomSign |
| Codomain sign declared by atom metadata. | |
forward declaration - softplus fn
softplus function
f(x) = log(1 + x)
Definition at line 50 of file softplus.hpp.
bring into scope convex fn alias / helpers
Definition at line 52 of file softplus.hpp.
| using convex::Softplus< Meta, Child >::Space = dom_space_t<meta_dom_t<Meta> > |
alias to extract space type
Definition at line 58 of file softplus.hpp.
|
inlineexplicitconstexpr |
|
inlineexplicitconstexpr |
|
inlineconstexpr |
add
| scalar |
Definition at line 153 of file softplus.hpp.
References convex::dom_size_v.
|
inlineconstexpr |
softplus canonicalization
(1) f(x) = log(1 + exp(x)) K = { (x,t) | 1 + exp(x) <= exp(t) }... { (x,t) | exp(-t) + exp(x-t) <= 1 } K_exp1 = (-t, 1, r) K_exp2 = (x-t, 1, s) K_nonneg = 0 <= 1 - s - r
[ 0 -1 0 0 ] [ x; t; r; s ] + [ 0; 1; 0; b; 1; 0 | 1 ] [ 0 0 0 0 ] [ 0 0 1 0 ] [ a^T -1 0 0 ] [ 0 0 0 0 ]
[ 0 0 -1 -1 ]
(2) -f(x) = -log(1 + exp(x)) K = { (x,t) | exp(0) + exp(x) >= exp(-t) } K_exp1 = (t, 1, r) K_exp2 = (x+t, 1, s) K_nonneg = 0 <= 1 - r - s
[ 0 1 0 0 ] [ x; t; r; s ] + [ 0; 1; 0; b; 1; 0 | 1 ] [ 0 0 0 0 ] [ 0 0 1 0 ] [ a^T 1 0 0 ] [ 0 0 0 0 ]
[ 0 0 -1 -1 ]
| builder |
Definition at line 197 of file softplus.hpp.
References convex::CONVEX, and convex::dom_size_v.
eval impl
| x | in R |
Definition at line 108 of file softplus.hpp.
References convex::CONVEX, and convex::dom_size_v.
|
inlineconstexpr |
mono
Definition at line 87 of file softplus.hpp.
References convex::CONVEX, convex::NONDEC, and convex::NONINC.
|
inlineconstexpr |
mul
Definition at line 127 of file softplus.hpp.
References convex::CONCAVE, and convex::dom_size_v.
|
inlineconstexpr |
eval via operator overload
| point | x |
Definition at line 99 of file softplus.hpp.
Definition at line 244 of file softplus.hpp.
| affine::AffineMap<LiftedVarMat<T> > convex::Softplus< Meta, Child >::lift_map |
member vars
Definition at line 243 of file softplus.hpp.
|
staticconstexpr |
curvature tag
Definition at line 61 of file softplus.hpp.