chainer.functions.clipped_relu(x, z=20.0)[source]

Clipped Rectifier Unit 関数。

 

z(>0)でクリッピングするために、

ClippedReLU ( x , z ) = min ( max ( 0 , x ) , z ) .

を計算する。

 

Parameters:
Returns:

出力値。 A (s_1, s_2, ..., s_n)型の float 配列。

Return type:

Variable

 

Example

 


>>> x = np.random.uniform(-100, 100, (10, 20)).astype('f')
>>> z = 10.0
>>> np.any(x < 0)
True
>>> np.any(x > z)
True
>>> y = F.clipped_relu(x, z=z)
>>> np.any(y.data < 0)
False
>>> np.any(y.data > z)
False