NormConstraint¶
A constraint projection forcing the given solution to have a norm of at most or exactly the given scale.
This can be used to constrain the length of a vector (using the l2 norm), limit the values to a uniform box (using the l-infinity norm), or encourage sparsity (using the l1 norm). In all cases, the orientation of the solution vector remains unchanged, and only the norm is constrained. Like all constraint nodes, this is normally used as part of an optimization problem formulation given to a (typically convex) solver node. Version 1.0.0
Ports/Properties¶
data¶
Data to process.
scale¶
Value of the norm to which the solution shall be constrained.
constraint¶
Whether the norm constraint is an upper bound (at most) or an equality (exactly). The constraint set is then also called the norm "sphere" (equality) or norm "ball" (upper bound).
norm¶
The type of norm to use. The default l2 norm is the Euclidean distance; the corresponding constraint set has a sphere shape centered at the coordinate origin whose radius is the configured scale. The L1 norm is the sum of absolute values, whose constraint set has a diamond shape, and the L-infinity norm is the maximum absolute value; the constraint set is then a cube.
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.