Skip to content

clamp() and clamp!() #115

@zsunberg

Description

@zsunberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions