We can't find the internet
Attempting to reconnect
Something went wrong!
Attempting to reconnect
Activations
PyTorchFrom the classic non-linearities to modern gated activations. End with implementing a custom gradient.
9 exercises
Explore freely. Sign in to keep your progress.
Your learning sequence
- 1 Not solved yet. Implement ReLU Practice · Easy
- 2 Not solved yet. Implement Sigmoid Practice · Easy
- 3 Not solved yet. Implement Tanh Practice · Easy
- 4 Not solved yet. Implement Leaky ReLU Practice · Easy
- 5 Not solved yet. GELU Activation Practice · Easy
- 6 Not solved yet. SwiGLU Activation Practice · Medium
- 7 Not solved yet. GLU Activation Practice · Easy
- 8 Not solved yet. Implement Softmax Practice · Easy
- 9 Not solved yet. Custom Activation with Gradient Practice · Hard
Check yourself
4 questions · not saved while you're signed outUse these questions to check your understanding and compare explanations. Your score does not affect track completion.
What gradient problem can repeated sigmoid activations cause in a deep network?
Choose one answer to reveal the explanations. Answers are kept only while this page is open.
import torch
x = torch.tensor([-10., 0., 10.], dtype=torch.float64,
requires_grad=True)
y = torch.sigmoid(x)
y.sum().backward()
print("sigmoid:", [f"{v:.6f}" for v in y.tolist()])
print("gradient:", [f"{v:.7f}" for v in x.grad.tolist()])