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 and x_max are regarded as 1.

Parameters
Returns

Output variable.

Return type

Variable