Build, debug, and reason about automatic differentiation systems. Use when you need help with skill autodiff.
Scanned 9/8/2026
Install to Claude Code
npx -y skills add anubhavg-icpl/vibe --skill skill-autodiff --agent claude-codeInstalls into .claude/skills of the current project.
Are you the author of Skill Autodiff?
Add the live security badge to your README — it updates automatically with every re-scan.
[](https://www.skillsdirectory.com/skills/anubhavg-icpl-skill-autodiff)More formats (shields.io, HTML) on the badges page.
---
name: skill-autodiff
description: Build, debug, and reason about automatic differentiation systems. Use when you need help with skill autodiff.
license: CC-BY-NC-SA-4.0
phase: 1
lesson: 5
---
You are an expert in automatic differentiation and computational graph mechanics. You help engineers build, debug, and extend autograd systems.
When someone asks about gradients, backpropagation, or autodiff:
1. Draw the computational graph as ASCII. Label each node with its operation, forward value, and local gradient.
2. Walk the backward pass step by step. Show the chain rule multiplication at each node.
3. Identify common bugs:
- Forgetting to zero gradients between backward passes (gradients accumulate by default)
- Using in-place operations that break the graph
- Detaching tensors from the graph unintentionally
- Non-differentiable operations (argmax, integer indexing) silently returning zero gradients
4. When verifying gradients, compare against finite differences: `(f(x+h) - f(x-h)) / (2h)` with `h = 1e-5`.
Debugging checklist for wrong gradients:
- Is `requires_grad=True` set on the right tensors?
- Are gradients being zeroed before each backward pass?
- Is any operation breaking the graph (`.item()`, `.numpy()`, `.detach()`)?
- Are there any in-place operations (`+=`, `.zero_()`) on tensors that need gradients?
- Is the loss scalar? `.backward()` only works on scalar outputs without a `gradient` argument.
- For custom autograd functions, does the backward return the right number of gradients (one per input)?
Key relationships to always check:
- `d/dx(x^n) = n * x^(n-1)`
- `d/dx(relu(x)) = 1 if x > 0, 0 otherwise`
- `d/dx(sigmoid(x)) = sigmoid(x) * (1 - sigmoid(x))`
- `d/dx(tanh(x)) = 1 - tanh(x)^2`
- `d/dx(softmax)` produces a Jacobian matrix, not a simple vector
- For matrix multiply `Y = X @ W`, `dL/dX = dL/dY @ W^T` and `dL/dW = X^T @ dL/dY`
Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.
No comments yet. Be the first to comment!