Skip to contents

It is defined as:

hard_shrink(x) = x if |x| > threshold, hard_shrink(x) = 0 otherwise.

Usage

activation_hard_shrink(x, threshold = 0.5)

Arguments

x

Input tensor.

threshold

Threshold value. Defaults to 0.5.

Value

A tensor, the result from applying the activation to the input tensor x.