|
akreon-convex
Typed convex modeling, conic canonicalization, and primal-dual optimization in C++26.
|
forward declaration - huber More...
#include <huber.hpp>
Public Types | |
| using | ConvexBase = Atom< Meta, Huber< Meta, Child >, Child > |
| bring into scope the convex fn alias / helpers | |
Public Types inherited from convex::Atom< Meta, Huber< 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 | Huber (T delta_in, const Child &child_in) |
| CTOR. | |
| constexpr | Huber (T delta_in, 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 |
| canonicalize impl | |
Public Member Functions inherited from convex::Atom< Meta, Huber< 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 Huber< Meta, Child > & | self () const |
| Return this object as the CRTP-derived atom type. | |
Public Attributes | |
| T | delta |
| member vars | |
| affine::AffineMap< LiftedVarMat< T > > | lift_map |
| const int | idx {-1} |
Public Attributes inherited from convex::Atom< Meta, Huber< 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, Huber< 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 - huber
huber loss convex atom
|
inlineexplicitconstexpr |
|
inlineconstexpr |
add
| scalar |
Definition at line 172 of file huber.hpp.
References convex::Atom< Meta, Huber< Meta, Child >, Child >::children, convex::Huber< Meta, Child >::delta, convex::dom_size_v, and convex::Huber< Meta, Child >::lift_map.
|
inlineconstexpr |
canonicalize impl
L_delta(a) = piecewise{ 0.5 a^2, for |a| <= delta, delta(|a| - 0.5 delta) otherwise }
Variational Form h(x, delta) = min_{u, v, gamma, q, t} t s.t. x = u + v, gamma >= |v|, q >= u^2, t >= q + delta gamma
Convex [ a -1 -1 0 0 0 ] hat{x} + [ b ] [ -a 1 1 0 0 0 ] [ -b ] [ 0 1 0 1 0 0 ] [ 0 ] [ 0 -1 0 1 0 0 ] [ 0 ] [ 0 0 0 1 0 0 ] [ 0 ] [ 0 0 0 -delta -1 1 ] [ 0 ] [ 0 0 1 0 0 0 ] [ 0 ] [ 0 0 0 0 0 0 ] [ 1/2 ] [ 0 0 0 0 1 0 ] [ 0 ]
Concave row 5 becomes [ 0 0 0 -delta -1 -1 ] so t <= -(q + delta gamma)
hat{x} = [ x; v; u; gamma; q; t ]
| builder |
Definition at line 211 of file huber.hpp.
References convex::Atom< Meta, Huber< Meta, Child >, Child >::children, convex::CONVEX, convex::Huber< Meta, Child >::delta, convex::dom_size_v, convex::Huber< Meta, Child >::idx, convex::Huber< Meta, Child >::lift_map, and convex::Huber< Meta, Child >::Tag.
eval impl
| point | x in domain |
Definition at line 121 of file huber.hpp.
References convex::CONVEX, convex::Huber< Meta, Child >::delta, convex::dom_size_v, convex::Huber< Meta, Child >::lift_map, and convex::Huber< Meta, Child >::Tag.
Referenced by convex::Huber< Meta, Child >::operator()().
|
inlineconstexpr |
mono
Definition at line 83 of file huber.hpp.
References convex::CONVEX, convex::dom_size_v, convex::NONDEC, convex::NONINC, convex::NONNEG, convex::NONPOS, convex::Huber< Meta, Child >::Tag, and convex::UNKNOWN.
|
inlineconstexpr |
mul
Definition at line 145 of file huber.hpp.
References convex::Atom< Meta, Huber< Meta, Child >, Child >::children, convex::CONCAVE, convex::Huber< Meta, Child >::delta, convex::dom_size_v, convex::Huber< Meta, Child >::lift_map, and convex::Huber< Meta, Child >::Tag.
|
inlineconstexpr |
eval via operator overload
| point | x |
Definition at line 112 of file huber.hpp.
References convex::Huber< Meta, Child >::eval().
member vars
Definition at line 273 of file huber.hpp.
Referenced by convex::Huber< Meta, Child >::add(), convex::Huber< Meta, Child >::canonicalize_impl(), convex::Huber< Meta, Child >::eval(), and convex::Huber< Meta, Child >::mul().
Definition at line 275 of file huber.hpp.
Referenced by convex::Huber< Meta, Child >::canonicalize_impl().
| affine::AffineMap<LiftedVarMat<T> > convex::Huber< Meta, Child >::lift_map |
Definition at line 274 of file huber.hpp.
Referenced by convex::Huber< Meta, Child >::add(), convex::Huber< Meta, Child >::canonicalize_impl(), convex::Huber< Meta, Child >::eval(), and convex::Huber< Meta, Child >::mul().
|
staticconstexpr |
curvature tag
Definition at line 53 of file huber.hpp.
Referenced by convex::Huber< Meta, Child >::canonicalize_impl(), convex::Huber< Meta, Child >::eval(), convex::Huber< Meta, Child >::monotonicity(), and convex::Huber< Meta, Child >::mul().