ConstraintStep¶
Chainable step that allows parameters (or in some cases, gradients) to be constrained by projecting them into the desired form.
This node can be used to apply different types of constraints, including non- negativity and zeroing out NaNs. Generally this node should be the last one in the chain, and follow any negation step. Version 0.2.0
Ports/Properties¶
gradients¶
Gradients to be transformed.
- verbose name: Gradients
- default value: None
- port type: DataPort
- value type: object (can be None)
- data direction: INOUT
weights¶
Optional current weights.
- verbose name: Weights
- default value: None
- port type: DataPort
- value type: object (can be None)
- data direction: IN
state¶
Explicit state of the node.
- verbose name: State
- default value: None
- port type: DataPort
- value type: object (can be None)
- data direction: INOUT
projection¶
Optional projection operation.
- verbose name: Projection
- default value: None
- port type: DataPort
- value type: BaseNode (can be None)
- data direction: IN
constraint¶
Constraint to apply. Non-negative maintains non-negative parameters, zeroing out any negative values. Zero-nans zeros out any NaN values from gradients. general-projection can be used to implement projected gradient descent, but in this case this node must be the final step in the chain, and must be preceded by the negative rescaling.
- verbose name: Constraint
- default value: nonnegative
- port type: ComboPort
- value type: str (can be None)
param¶
Parameter of the constraint, if any.
- verbose name: Param
- default value: None
- port type: Port
- value type: object (can be None)
set_breakpoint¶
Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.
- verbose name: Set Breakpoint (Debug Only)
- default value: False
- port type: BoolPort
- value type: bool (can be None)
metadata¶
User-definable meta-data associated with the node. Usually reserved for technical purposes.
- verbose name: Metadata
- default value: {}
- port type: DictPort
- value type: dict (can be None)