TensorTonicTensorTonic
Problems
Study PlansProjectsNewInterviewPricingFeedback
Problems
Loading...
1 / 1

SELU Activation

Activation Functions
Easy

The Scaled Exponential Linear Unit (SELU) is a self-normalizing activation function. When used with proper weight initialization (LeCun normal), SELU automatically maintains zero mean and unit variance activations across layers, eliminating the need for batch normalization.

Given a list of values, apply the SELU activation to each element using the fixed constants lambda and alpha.

Formula

SELU(x)=λ⋅xif x>0SELU(x) = \lambda \cdot x \quad \text{if } x > 0SELU(x)=λ⋅xif x>0 SELU(x)=λ⋅α⋅(ex−1)if x≤0SELU(x) = \lambda \cdot \alpha \cdot (e^x - 1) \quad \text{if } x \le 0SELU(x)=λ⋅α⋅(ex−1)if x≤0

The constants are derived analytically to preserve self-normalizing properties:

λ≈1.0507\lambda \approx 1.0507λ≈1.0507

α≈1.6733\alpha \approx 1.6733α≈1.6733

Loading visualization...

Examples

Input: x = [1, -1, 0]

Output: [1.0507, -1.1113, 0.0]

Explanation: Positive values use lambda scaling, while nonpositive values use the scaled exponential branch.

Input: x = [0.5, 1.5, 2.5]

Output: [0.5254, 1.5761, 2.6268]

Hint 1

Store the fixed lambda and alpha constants inside the function.

Hint 2

Round each transformed value to four decimal places before appending it.

Requirements

  • Apply the SELU formula element-wise
  • Use the exact constants: lambda = 1.0507009873554804934193349852946, alpha = 1.6732632423543772848170429916717
  • Return a list of floats with the same length as input

Constraints

  • Input list has at least one element
  • Use the provided constant values for lambda and alpha
  • Return a list of floats with the same length as input
  • Time limit: 300 ms
Try Similar Problems
Elu ActivationLeaky ReluRelu ActivationSigmoid NumpySwish Activation

Sign in to take notes on this problem

Case 1
Case 2

Accepts: array

You must run your code first.
PrevNext

SELU Activation

Activation Functions
Easy

The Scaled Exponential Linear Unit (SELU) is a self-normalizing activation function. When used with proper weight initialization (LeCun normal), SELU automatically maintains zero mean and unit variance activations across layers, eliminating the need for batch normalization.

Given a list of values, apply the SELU activation to each element using the fixed constants lambda and alpha.

Formula

SELU(x)=λ⋅xif x>0SELU(x) = \lambda \cdot x \quad \text{if } x > 0SELU(x)=λ⋅xif x>0 SELU(x)=λ⋅α⋅(ex−1)if x≤0SELU(x) = \lambda \cdot \alpha \cdot (e^x - 1) \quad \text{if } x \le 0SELU(x)=λ⋅α⋅(ex−1)if x≤0

The constants are derived analytically to preserve self-normalizing properties:

λ≈1.0507\lambda \approx 1.0507λ≈1.0507

α≈1.6733\alpha \approx 1.6733α≈1.6733

Loading visualization...

Examples

Input: x = [1, -1, 0]

Output: [1.0507, -1.1113, 0.0]

Explanation: Positive values use lambda scaling, while nonpositive values use the scaled exponential branch.

Input: x = [0.5, 1.5, 2.5]

Output: [0.5254, 1.5761, 2.6268]

Hint 1

Store the fixed lambda and alpha constants inside the function.

Hint 2

Round each transformed value to four decimal places before appending it.

Requirements

  • Apply the SELU formula element-wise
  • Use the exact constants: lambda = 1.0507009873554804934193349852946, alpha = 1.6732632423543772848170429916717
  • Return a list of floats with the same length as input

Constraints

  • Input list has at least one element
  • Use the provided constant values for lambda and alpha
  • Return a list of floats with the same length as input
  • Time limit: 300 ms
Try Similar Problems
Elu ActivationLeaky ReluRelu ActivationSigmoid NumpySwish Activation

Sign in to take notes on this problem

Case 1
Case 2

Accepts: array

You must run your code first.