Skip to main content

ClikaRT::ops::elu

function

elu()

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

Exponential linear unit.

elu(x)={scalexx>0scaleα(einput_scalex1)x0\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

  • x: 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 x.

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 692