Skip to main content

ClikaRT::ops::elu

function

elu()​

Tensor elu(
    Tensor input,
    double alpha = 1.0,
    double scale = 1.0,
    double input_scale = 1.0
)

Exponential linear unit.

elu(x)={scale⋅xx>0scale⋅α (e input_scale⋅x−1)x≤0\mathrm{elu}(x) = \begin{cases} \mathrm{scale}\cdot x & x > 0 \\ \mathrm{scale}\cdot\alpha\,(e^{\,\mathrm{input\_scale}\cdot x}-1) & x \le 0 \end{cases}

Elementwise; input_scale feeds only the exponential's argument.

Parameters

  • input: the input tensor.
  • alpha: the negative-side saturation value. Default 1.0.
  • scale: multiplies the whole result. Default 1.0.
  • input_scale: scales the exponent on the negative side. Default 1.0.

Throws

  • ClikaRT::Error: when the input's dtype is not served for this operation (the machine-readable reason rides code_name()).

Returns: a new tensor, same shape and dtype as input.

auto y = ClikaRT::ops::elu(x); // standard ELU
auto s = ClikaRT::ops::elu(x, 1.67, 1.05); // SELU-shaped constants

Declared in ClikaRT/compute/ops.h, line 693