Skip to content
Back to skills

Skill Autodiff

ASecurity

Build, debug, and reason about automatic differentiation systems. Use when you need help with skill autodiff.

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 8, 2026
developmentnodedebugging

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add anubhavg-icpl/vibe --skill skill-autodiff --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Skill Autodiff?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Skill Autodiff
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anubhavg-icpl-skill-autodiff/badge)](https://www.skillsdirectory.com/skills/anubhavg-icpl-skill-autodiff)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.