|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: Assignment 2 |
| 4 | +mathjax: true |
| 5 | +permalink: /assignments2024/assignment2/ |
| 6 | +--- |
| 7 | + |
| 8 | +<span style="color:red">This assignment is due on **Monday, May 06 2024** at 11:59pm PST.</span> |
| 9 | + |
| 10 | +Starter code containing Colab notebooks can be [downloaded here]({{site.hw_2_colab}}). |
| 11 | + |
| 12 | +- [Setup](#setup) |
| 13 | +- [Goals](#goals) |
| 14 | +- [Q1: Multi-Layer Fully Connected Neural Networks](#q1-multi-layer-fully-connected-neural-networks) |
| 15 | +- [Q2: Batch Normalization](#q2-batch-normalization) |
| 16 | +- [Q3: Dropout](#q3-dropout) |
| 17 | +- [Q4: Convolutional Neural Networks](#q4-convolutional-neural-networks) |
| 18 | +- [Q5: PyTorch on CIFAR-10](#q5-pytorch-on-cifar-10) |
| 19 | +- [Submitting your work](#submitting-your-work) |
| 20 | + |
| 21 | +### Setup |
| 22 | + |
| 23 | +Please familiarize yourself with the [recommended workflow]({{site.baseurl}}/setup-instructions/#working-remotely-on-google-colaboratory) before starting the assignment. You should also watch the Colab walkthrough tutorial below. |
| 24 | + |
| 25 | +<iframe style="display: block; margin: auto;" width="560" height="315" src="https://www.youtube.com/embed/DsGd2e9JNH4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> |
| 26 | + |
| 27 | +**Note**. Ensure you are periodically saving your notebook (`File -> Save`) so that you don't lose your progress if you step away from the assignment and the Colab VM disconnects. |
| 28 | + |
| 29 | +While we don't officially support local development, we've added a <b>requirements.txt</b> file that you can use to setup a virtual env. |
| 30 | + |
| 31 | +Once you have completed all Colab notebooks **except `collect_submission.ipynb`**, proceed to the [submission instructions](#submitting-your-work). |
| 32 | + |
| 33 | +### Goals |
| 34 | + |
| 35 | +In this assignment you will practice writing backpropagation code, and training Neural Networks and Convolutional Neural Networks. The goals of this assignment are as follows: |
| 36 | + |
| 37 | +- Understand **Neural Networks** and how they are arranged in layered architectures. |
| 38 | +- Understand and be able to implement (vectorized) **backpropagation**. |
| 39 | +- Implement various **update rules** used to optimize Neural Networks. |
| 40 | +- Implement **Batch Normalization** and **Layer Normalization** for training deep networks. |
| 41 | +- Implement **Dropout** to regularize networks. |
| 42 | +- Understand the architecture of **Convolutional Neural Networks** and get practice with training them. |
| 43 | +- Gain experience with a major deep learning framework, **PyTorch**. |
| 44 | + |
| 45 | +### Q1: Multi-Layer Fully Connected Neural Networks |
| 46 | + |
| 47 | +The notebook `FullyConnectedNets.ipynb` will have you implement fully connected |
| 48 | +networks of arbitrary depth. To optimize these models you will implement several |
| 49 | +popular update rules. |
| 50 | + |
| 51 | +### Q2: Batch Normalization |
| 52 | + |
| 53 | +In notebook `BatchNormalization.ipynb` you will implement batch normalization, and use it to train deep fully connected networks. |
| 54 | + |
| 55 | +### Q3: Dropout |
| 56 | + |
| 57 | +The notebook `Dropout.ipynb` will help you implement dropout and explore its effects on model generalization. |
| 58 | + |
| 59 | +### Q4: Convolutional Neural Networks |
| 60 | + |
| 61 | +In the notebook `ConvolutionalNetworks.ipynb` you will implement several new layers that are commonly used in convolutional networks. |
| 62 | + |
| 63 | +### Q5: PyTorch on CIFAR-10 |
| 64 | + |
| 65 | +For this part, you will be working with PyTorch, a popular and powerful deep learning framework. |
| 66 | + |
| 67 | +Open up `PyTorch.ipynb`. There, you will learn how the framework works, culminating in training a convolutional network of your own design on CIFAR-10 to get the best performance you can. |
| 68 | + |
| 69 | +### Submitting your work |
| 70 | + |
| 71 | +**Important**. Please make sure that the submitted notebooks have been run and the cell outputs are visible. |
| 72 | + |
| 73 | +Once you have completed all notebooks and filled out the necessary code, you need to follow the below instructions to submit your work: |
| 74 | + |
| 75 | +**1.** Open `collect_submission.ipynb` in Colab and execute the notebook cells. |
| 76 | + |
| 77 | +This notebook/script will: |
| 78 | + |
| 79 | +* Generate a zip file of your code (`.py` and `.ipynb`) called `a2_code_submission.zip`. |
| 80 | +* Convert all notebooks into a single PDF file. |
| 81 | + |
| 82 | +If your submission for this step was successful, you should see the following display message: |
| 83 | + |
| 84 | +`### Done! Please submit a2_code_submission.zip and a2_inline_submission.pdf to Gradescope. ###` |
| 85 | + |
| 86 | +**_Note: When you have completed all notebookes, please ensure your most recent kernel execution order is chronological as this can otherwise cause issues for the Gradescope autograder. If this isn't the case, you should restart your kernel for that notebook and rerun all cells in the notebook using the Runtime Menu option "Restart and Run All"._** |
| 87 | + |
| 88 | +**2.** Submit the PDF and the zip file to [Gradescope](https://www.gradescope.com/courses/527613). |
| 89 | + |
| 90 | +Remember to download `a2_code_submission.zip` and `a2_inline_submission.pdf` locally before submitting to Gradescope. |
0 commit comments