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.

Parameters:
  • x (Variable) – Input variable to be clipped.
  • x_min (float) – Minimum value.
  • x_max (float) – Maximum value.
Returns:

Output variable.

Return type:

Variable