Skip to content
class

EluBackward

EluBackward

Python wrappers

Public Python APIs implemented by this engine symbol.

Autograd node for the Exponential Linear Unit y=xy = x if x≥0x \ge 0 else α (ex−1)\alpha\,(e^x - 1) (Clevert et al. 2015).

Like Leaky ReLU, the scalar hyper-parameter α\alpha is captured on the node via a custom forward() so the backward kernel sees a concrete value rather than chasing it through call sites. The piecewise backward itself is delegated to the backend because the conditional branch is not expressible through the generic storage primitives.

Math

\qquad \frac{\partial y}{\partial x} = \begin{cases} 1, & x \ge 0 \\ \alpha\,e^x, & x < 0 \end{cases}$$ **References** Clevert, Unterthiner, Hochreiter, "Fast and Accurate Deep Network Learning by Exponential Linear Units (ELUs)", [arXiv:1511.07289](https://arxiv.org/abs/1511.07289).

Attributes

schema_v1OpSchema
"elu", AmpPolicy::ForceFP32.
alpha_double
Negative-saturation scale captured at forward time; defaults to 1.0.

Static methods

2
static

cpu_kernel

CpuStorage cpu_kernel(const CpuStorage & a, const int & out_shape, Dtype dt, double alpha)

CPU kernel mirroring forward for the dispatcher-driven path.

static

forward

→TensorImplPtr
int forward(const int & a, double alpha)

Custom forward that captures alpha on the backward node.

Parameters

aTensorImplPtr
Input activation.
alphadouble
Negative-saturation scale.

Returns

TensorImplPtr

Forward output with autograd edges wired to EluBackward.

Methods

2
fn

grad_formula

int grad_formula(const int & g)

Eager-mode backward: dispatches to IBackend::elu_backward with the captured alpha_.

fn

grad_formula_impl

int grad_formula_impl(const int & g, const int & x, const int & out)