Selu - version 6#

This page documents version 6 of operator Selu. See Selu for the latest version (since version 22).

  • Domain: ai.onnx

  • Since version: 6

Selu takes one input data (Tensor ) and produces one output data (Tensor ) where the scaled exponential linear unit function, y = gamma * (alpha * e^x - alpha) for x   0, is applied to the tensor elementwise.

Inputs

  • X (T): Input tensor

Outputs

  • Y (T): Output tensor

Attributes

  • alpha (float): Coefficient of SELU default to 1.67326319217681884765625 (i.e., float32 approximation of 1.6732632423543772848170429916717).

  • gamma (float): Coefficient of SELU default to 1.05070102214813232421875 (i.e., float32 approximation of 1.0507009873554804934193349852946).

Type Constraints

  • T: Constrain input and output types to float tensors. Allowed types: tensor(double), tensor(float), tensor(float16).

Examples#

test_cc_selu

Node:
  Selu(X) -> (Y)
  Attributes:
    alpha = 2.0
    gamma = 3.0
Inputs:
  X: shape=(2, 3), dtype=float32
    [[-2. , -1. , -0.5],
     [ 0.5,  1. ,  2. ]]

Outputs:
  Y: shape=(2, 3), dtype=float32
    [[-5.1879883, -3.7927232, -2.360816 ],
     [ 1.5      ,  3.       ,  6.       ]]

test_cc_selu_default

Node:
  Selu(X) -> (Y)
Inputs:
  X: shape=(2, 3), dtype=float32
    [[-2. , -1. , -0.5],
     [ 0.5,  1. ,  2. ]]

Outputs:
  Y: shape=(2, 3), dtype=float32
    [[-1.5201665, -1.1113306, -0.6917582],
     [ 0.5253505,  1.050701 ,  2.101402 ]]

test_cc_selu_example

Node:
  Selu(X) -> (Y)
  Attributes:
    alpha = 2.0
    gamma = 3.0
Inputs:
  X: shape=(3,), dtype=float32
    [-1.,  0.,  1.]

Outputs:
  Y: shape=(3,), dtype=float32
    [-3.7927232,  0.       ,  3.       ]

Differences with previous version (1)#

SchemaDiff: Selu (domain 'ai.onnx')

  • old version: 1

  • new version: 6

  • breaking: yes

Breaking reasons:

  • attribute ‘alpha’ (changed): default value changed 1.6732 -> 1.67326

Attributes:

  • [BREAKING] changed ‘alpha’: default value changed 1.6732 -> 1.67326