An important operation for reinforcement learning contexts is to clamp an input to the nearest point within a set. Does anyone have objections to implementing Base.clamp and Base.clamp! for some sets in this package?
This would be similar to what is currently implemented in IntervalSets: clamp(3, 1..2) returns 2.
An important operation for reinforcement learning contexts is to clamp an input to the nearest point within a set. Does anyone have objections to implementing
Base.clampandBase.clamp!for some sets in this package?This would be similar to what is currently implemented in IntervalSets:
clamp(3, 1..2)returns2.