Case Study 10

Neural Network from Scratch

Custom autograd layers with hand-derived backpropagation

2025
PythonPyTorchNumPyMatplotlib
Key impact
Implemented neural-network layers as custom torch.autograd.Function classes — a fully-connected layer and a parameterized generalized-logistic activation — with hand-derived forward and backward passes.
AUTOGRAD MLP∂/∂w ✓ checkedhand-derived backward pass · grad-checked
Representative mockup

What I did

3
  1. 01

    Implemented neural-network layers as custom torch.autograd.Function classes — a fully-connected layer and a parameterized generalized-logistic activation — with hand-derived forward and backward passes.

  2. 02

    Derived and coded the gradients with respect to inputs, weights, biases, and the activation's lower/upper/growth parameters, then validated every layer with gradient-checking unit tests.

  3. 03

    Composed the layers into a trainable feed-forward network and evaluated it on the Iris classification task.

Tech stack

PythonPyTorchNumPyMatplotlib