chainer.functions.clip¶
-
chainer.functions.
clip
(x, x_min, x_max)[source]¶ Clips (limits) elements of input variable.
Given an interval
[x_min, xmax]
, elements outside the interval are clipped to the interval edges.Its gradients at
x_min
andx_max
are regarded as 1.- Parameters
x (
Variable
or N-dimensional array) – Input variable to be clipped.x_min (float) – Minimum value.
x_max (float) – Maximum value.
- Returns
Output variable.
- Return type