PyTorch Tutorials for Scientific Machine Learning
Runnable PyTorch tutorials by Allamaprabhu Ani covering training loops, neural networks, CNNs, autograd, and PINNs with notebooks and Colab links.
-
Machine Learning Training from Scratch: Loss, Gradients, and Overfitting
Hand-derive the gradient, write the training loop in NumPy, then again in PyTorch. Watch a deliberately oversized model overfit, then fix it three ways.
Reproduce the classic train-loss-down, validation-loss-up overfitting curve and learn what fixes it.
-
Neural Networks from One Neuron to a PyTorch MLP Classifier
One neuron to matrix layer to PyTorch abstraction to an MLP that fits a sine wave, then a real binary classifier on Wisconsin breast cancer data.
See exactly when one neuron fails, why a hidden layer works, and how the same pattern becomes a classifier.
-
Convolutional Neural Networks from Pixels to Feature Maps
Why MLPs fail on images, what a convolution actually does, and how to read what a trained CNN has learned.
Train a small CNN, compare it with an MLP, then open the model and inspect the filters.
-
PINN Tutorial in PyTorch: Damped Oscillator, Autograd, and Inverse Problems
Data, physics, or both? A damped oscillator compares all three on the same architecture, then bridges to inverse problems and neural operators.
Use torch.autograd.grad to make a neural network obey an ODE, then turn the same idea into an inverse problem.