Activation functions
Penguin learning project
The project uses 342 complete Palmer penguin records: 240 training-pool and 102 held-out rows. The selected training rows determine feature scaling and model parameters. Source CSV
This project trains weights with softmax, unlike the homepage lab, which uses nearest species averages. Same penguin measurements; different classification methods. Predictions can differ.
Prediction rules and layers · Describe or apply prediction rules, layers and parameters.
The project uses a linear rule with two features. The fitted weights produce scores or normalized mass.
Consider this concept alongside the project; its source assumptions may differ. These observations do not prove a theorem.
Input: 12 × 2; Held-out evaluation: 102 · #58 · 40.6 mm, 193 mm. Known answer: Adélie; Prediction: Adélie · [≈0.7383, ≈0.2444, ≈0.01737].
Used in these source sections: 1.2 Learning from examples · 3.3 Other ways to measure possibility · 4.2 Approximating with random pieces
An activation changes a number using a fixed rule. The source table lists several choices.
The step function is 1 only when x > 0. ReLU is zero for negative x. Sigmoid approaches 0 and 1. The other results show the source table’s formulas.
Different activations give networks different mathematical properties.
Source formula example
exact · The result is exact for these finite toy inputs, apart from ordinary computer rounding.
Symbols
- A real input.
- A positive parameter in the inverse-square-root examples; PReLU additionally excludes a = 1.
- A positive integer exponent.
Source formula example
This source example uses its own inputs and assumptions. Editing it does not change the project.
Edit a value or the code, then run the example. This is a finite demonstration, not a proof of the paper’s theorem.
This example’s data flow
Code changed. Reset to restore this example’s data flow.
You choose
input.x= 0input.a= 0.5input.k= 2
Calculated here
Result expression: {
linear: x,
step: x > 0 ? 1 : 0,
sigmoid: 1 / (1 + Math.exp(-x)),
relu,
powerRelu: relu ** k,
parametricRelu: Math.max(a * x, x),
elu: x >= 0 ? x : Math.exp(x) - 1,
softsign: x / (1 + Math.abs(x)),
inverseSqrtLinear: x...
x=input.xUses:input.xa=input.aUses:input.ak=input.kUses:input.krelu=Math.max(0, x)Uses:x
Returns
linear- 0
step- 0
sigmoid- 0.5
relu- 0
powerRelu- 0
parametricRelu- 0
elu- 0
softsign- 0
Read numbers from input and return the result. JavaScript basics.
Result
Technical statement
The table includes linear, Heaviside, sigmoid, ReLU, power ReLU, parametric ReLU, ELU, softsign, inverse-square-root linear unit, inverse-square-root unit, tanh, arctan, softplus and Gaussian. The displayed code computes each value. The source allows a = 0 for parametric ReLU, but the shared parameter here must also satisfy the positive constraint of the inverse-square-root examples.
Source: Table 1.1