Training needs the gradient of Swish. Its derivative combines the gate and the input's own contribution, so it stays nonzero for negative inputs, unlike ReLU's zero gradient there.
Implement swish_derivative(x, beta), returning s + beta * x * s * (1 - s) with s = sigmoid(beta * x).
swish.Write s = sigmoid(beta * x), then apply the product rule to x * s.
No results yet
Run your code to check it against the examples, or submit to run every test.