chainerx.clip¶
-
chainerx.clip(a, a_min, a_max)¶ Clips the values of an array to a given interval.
Given an interval, values outside the interval are clipped to the interval edges. For example, if an interval of
[0, 1]is specified, values smaller than 0 become 0, and values larger than 1 become 1.- Parameters
a (ndarray) – Array containing elements to clip.
a_min (scalar) – Maximum value.
a_max (scalar) – Minimum value.
- Returns
An array with the elements of
a, but where values <a_minare replaced witha_min, and those >a_maxwitha_max.- Return type
Note
The
ndarraytypeda_minanda_maxare not supported yet.Note
During backpropagation, this function propagates the gradient of the output array to the input array
a.See also