FilesLast commitLast update
18 days ago
2 months ago
3 months ago
1 month ago
2 months ago
2 months ago
2 months ago
18 days ago
5 months ago
18 days ago
18 days ago
README

Selu

English | 简体中文

Applicable Products

Product Support
Ascend 950PR&950DT products √
Atlas A3 products √
Atlas A2 products √
Atlas 200I/500 A2 inference products √
Atlas inference products √
Atlas training products √

Function

  • Operator function: computes the SELU (Scaled Exponential Linear Unit) activation function element-wise on the input tensor.

  • Formula:

    SELU(x)=scale×(max⁡(0,x)+min⁡(0,α×(ex−1)))\text{SELU}(x) = \text{scale} \times \left( \max(0, x) + \min\left(0, \alpha \times \left(e^x - 1\right)\right) \right)

    Here:

    • α=1.6732632423543772848170429916717\alpha = 1.6732632423543772848170429916717
    • scale=1.0507009873554804934193349852946\text{scale} = 1.0507009873554804934193349852946

    Piecewise behavior:

    • When x>0x > 0: SELU(x)=scale×x\text{SELU}(x) = \text{scale} \times x (linear region)
    • When x≤0x \le 0: SELU(x)=scale×α×(ex−1)\text{SELU}(x) = \text{scale} \times \alpha \times (e^x - 1) (exponential saturation region)

Parameters

Parameter name Input/Output Description Data type Data format Dimensions (shape)
x Input The input x in the formula. FLOAT, FLOAT16, BFLOAT16, INT32, INT8 ND Any dimension
y Output The output y in the formula. The shape is the same as that of the input x. FLOAT, FLOAT16, BFLOAT16, INT32, INT8 ND Any dimension

Constraints

None

Invocation Description

Invocation method Invocation sample Description
aclnn invocation test_aclnn_selu Invokes the Selu operator through the aclnnSelu&aclnnInplaceSelu API.
aclnn invocation test_aclnn_inplace_selu Invokes the Selu operator through the aclnnSelu&aclnnInplaceSelu API.
GE graph mode test_geir_selu Invokes the Selu operator through graph construction using the operator IR.