This Repository contains the lab Programs for On-Going Deep Learning Lab Practicals (CSL DC 302 J26) Summer 2026
| Practical Name | Jupyter Notebook |
|---|---|
| 1. Single-layer perceptron on synthetic data
Write a Python program using PyTorch to:
(a) Generate a 2D linearly separable dataset using (b) Implement a single‑layer perceptron with |
Practical 01 |
| 2. Perceptron for MNIST 0 vs 1
Write a program using PyTorch and (a) Load only digits 0 and 1, flatten each image to a vector. (b) Train a single‑layer perceptron with sigmoid activation to classify 0 vs 1 and print training and test accuracy. |
Practical 02 |
| 3. Multilayer perceptron for full MNIST
Write a PyTorch program to:
(a) Load the full MNIST dataset with (b) Build an MLP with at least two hidden layers and ReLU, train it with cross‑entropy loss, and report accuracy and confusion matrix on the test set. |
Practical 03 |
| 4. Manual backprop vs autograd
Write a program that: (a)Creates a tiny 2‑2‑1 network for binary classification on a small synthetic dataset. (b) Computes gradients manually in NumPy/PyTorch, then compares them with gradients obtained from |
Practical 04 |
| 5. Effect of learning rate and initialization
Using the MLP from Practical 3, write a program that: (a) Trains the same model with at least three different learning rates and two different initializations. (b) Logs and plots loss curves, and prints a short text summary comparing convergence behavior. |
Practical 05 |
| 6. Optimizer comparison: SGD, momentum, RMSProp, Adam
Extend the MNIST MLP program to: (a) Train the same model separately with SGD, SGD+momentum, RMSProp, and Adam. (b) For each optimizer, plot training and validation loss vs epochs and tabulate final test accuracy. |
Practical 06 |
| 7. Regularization: L2, dropout, and early stopping
Write a program that: (a) Adds L2 weight decay and dropout layers to the MLP. (b) Implements early stopping based on validation loss and compares three runs: no regularization, L2 only, L2+dropout+early stopping. |
Practical 07 |
| 8. Bias-variance via model capacity
Write a PyTorch program to: (a) Train three MLPs of different sizes (small, medium, very deep/wide) on a fixed train/validation split. (b) Print training and validation accuracy for each model and comment in code or markdown which model is high‑bias, which is high‑variance. |
Practical 08 |
| Practical Name | Jupyter Notebook |
| 9. First CNN vs MLP on MNIST
Write a program to: (a) Implement a simple CNN (Conv–ReLU–MaxPool–FC) and train it on MNIST. (b) Compare parameter count, training time per epoch, and accuracy with the MLP from Practical 3. |
Practical 09 Practical 09 v2 |
| 10. LeNet-style CNN with feature-map visualization
Write a PyTorch program that: (a) Implements a LeNet‑like architecture for MNIST and trains it. (b) For a few test images, hooks into intermediate convolutional layers and saves the corresponding feature maps as images. |
Practical 10 |
| 11. Deeper VGG-style CNN on CIFAR-10
Write a program to: (a) Load CIFAR‑10 and implement a VGG‑style CNN (several conv–ReLU–pool blocks). (b) Train for a few epochs, then modify the network to include batch normalization and show how training loss and accuracy improve. |
Practical 11 |
| 12. Transfer learning with pretrained ResNet
Write a program using (a) Load a pretrained ResNet‑18, freeze all convolutional layers, and replace the final FC layer for a 5‑ or 10‑class image dataset. (b) Fine‑tune the last layers and compare training from scratch vs transfer learning in terms of accuracy and epochs needed. |
Practical 12 |
| 13. Grad-CAM or saliency maps for CNN
Using the best CNN or transfer‑learning model, write a program to: (a) Implement Grad‑CAM or simple input‑gradient saliency maps for a few images. (b) Save and display heatmaps overlaid on input images to analyze what the network is focusing on. |
Practical 13 |
| Practical Name | Jupyter Notebook |
| 14. Basic autoencoder on MNIST
Write a PyTorch program that: (a) Implements a fully connected autoencoder with a low‑dimensional bottleneck. (b) Trains it on MNIST, plots reconstruction loss vs epochs, and saves side‑by‑side original vs reconstructed images for a batch. |
Practical 14 |
| 15. Denoising autoencoder with noise injection
Extend the autoencoder program to: (a) Corrupt input images with Gaussian or salt‑and‑pepper noise before feeding them to the encoder. (b) Train the model to reconstruct clean images and visually compare noisy inputs and denoised outputs. |
Practical 15 |
| 16. Variational autoencoder (VAE) for digit generation
Write a program that: (a) Implements a simple VAE on MNIST with a 2‑D latent space. (b) After training, samples points from the latent space to generate new images and visualizes a 2‑D latent space grid of generated digits. |
Practical 16 |
| Practical Name | Jupyter Notebook |
| 17. Character-level RNN language model
Write a PyTorch program to: (a) Read a small text file (public‑domain book excerpt), build a character vocabulary, and prepare input–target sequences. (b) Implement a simple RNN or GRU using |
Practical 17 |
| 18. LSTM for sentiment classification (IMDB)
Write a program that: (a) Loads the IMDB sentiment dataset or a similar movie‑review dataset, tokenizes text, and pads sequences. (b) Builds an embedding layer + LSTM + linear classifier, trains for sentiment prediction, and prints accuracy and confusion matrix. |
Practical 18 |
| 19. Bidirectional LSTM/GRU for sequence tagging
Write a PyTorch program to: (a) Prepare a small POS‑tagging or NER dataset (toy or standard) as sequences of word indices with corresponding tag indices (b) Implement a bidirectional LSTM/GRU for sequence labeling and compare token‑level accuracy with a unidirectional LSTM model. |
Practical 19 |
| Practical Name | Jupyter Notebook |
| 20. Restricted Boltzmann Machine and Deep Belief Network
Write a program (can reuse or adapt an open‑source implementation) to: (a) Implement an RBM using PyTorch, train it on MNIST with contrastive divergence to learn hidden features. (b) Stack multiple trained RBMs into a Deep Belief Network, freeze RBM weights, train a final classifier layer, and compare its test accuracy with a standard MLP. |
Practical 20 |
This repository uses the uv package manager.
-
Install
uv:curl -LsSf https://astral.sh/uv/install.sh | sh -
Create and sync the project environment from
pyproject.tomlanduv.lock:uv sync
-
Run Jupyter Lab inside the managed environment:
uv run jupyter lab
The practicals were developed and tested on Windows WSL2, macOS, and Linux using uv.
-
Open PowerShell as Administrator and install WSL with Ubuntu:
wsl --install -
Restart Windows if prompted, open Ubuntu, and complete first-time Linux username/password setup.
-
Verify your distro is using WSL2:
wsl -l -v
-
Open the project inside the WSL2 filesystem.
-
Install
uvin WSL2:curl -LsSf https://astral.sh/uv/install.sh | sh -
Sync dependencies and run Jupyter Lab:
uv sync uv run jupyter lab
Recommendation: Use this setup for best compatibility with these practicals.
For detailed setup, see Microsoft Learn: Install WSL.
-
Install
uv:curl -LsSf https://astral.sh/uv/install.sh | sh -
From the repository root:
uv sync uv run jupyter lab
-
Install
uv:curl -LsSf https://astral.sh/uv/install.sh | sh -
From the repository root:
uv sync uv run jupyter lab
If you face any issues with any practical, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See LICENSE.
