Skip to main content

hard_sigmoid

Function hard_sigmoid 

pub fn hard_sigmoid<const D: usize>(
    tensor: Tensor<D>,
    alpha: f64,
    beta: f64,
) -> Tensor<D>
Expand description

Applies the hard sigmoid function element-wise.

hard_sigmoid(x) = max(0, min(1, alpha * x + beta))