mm.math.constraint_func¶
- math.constraint_func()¶
Returns a constraint function for the given bounds.
A constraint function will clip the value to the interval given by the bounds.
Note
The upper and/or lower bounds can be
None
, in which case the constraint function will not clip the value.- Parameters:
bounds (
Tuple
[Optional
[float
],Optional
[float
]]) – The bounds of the constraint.- Return type:
Optional
[Callable
]- Returns:
The constraint function.
code/api/mrmustard.math.constraint_func
Download Python script
Download Notebook
View on GitHub