|
| 1 | +--- |
| 2 | +layout: page |
| 3 | +title: Assignment 2 |
| 4 | +mathjax: true |
| 5 | +permalink: /assignments2022/assignment2/ |
| 6 | +--- |
| 7 | + |
| 8 | +<span style="color:red">This assignment is due on **Monday, May 08 2023** 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 | +- [Q6: Network Visualization: Saliency Maps, Class Visualization, and Fooling Images](#q6-network-visualization-saliency-maps-class-visualization-and-fooling-images) |
| 20 | +- [Submitting your work](#submitting-your-work) |
| 21 | + |
| 22 | +### Setup |
| 23 | + |
| 24 | +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. |
| 25 | + |
| 26 | +<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> |
| 27 | + |
| 28 | +**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. |
| 29 | + |
| 30 | +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. |
| 31 | + |
| 32 | +Once you have completed all Colab notebooks **except `collect_submission.ipynb`**, proceed to the [submission instructions](#submitting-your-work). |
| 33 | + |
| 34 | +### Goals |
| 35 | + |
| 36 | +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: |
| 37 | + |
| 38 | +- Understand **Neural Networks** and how they are arranged in layered architectures. |
| 39 | +- Understand and be able to implement (vectorized) **backpropagation**. |
| 40 | +- Implement various **update rules** used to optimize Neural Networks. |
| 41 | +- Implement **Batch Normalization** and **Layer Normalization** for training deep networks. |
| 42 | +- Implement **Dropout** to regularize networks. |
| 43 | +- Understand the architecture of **Convolutional Neural Networks** and get practice with training them. |
| 44 | +- Gain experience with a major deep learning framework, such as **TensorFlow** or **PyTorch**. |
| 45 | +- Explore various applications of image gradients, including saliency maps, fooling images, class visualizations. |
| 46 | + |
| 47 | +### Q1: Multi-Layer Fully Connected Neural Networks |
| 48 | + |
| 49 | +The notebook `FullyConnectedNets.ipynb` will have you implement fully connected |
| 50 | +networks of arbitrary depth. To optimize these models you will implement several |
| 51 | +popular update rules. |
| 52 | + |
| 53 | +### Q2: Batch Normalization |
| 54 | + |
| 55 | +In notebook `BatchNormalization.ipynb` you will implement batch normalization, and use it to train deep fully connected networks. |
| 56 | + |
| 57 | +### Q3: Dropout |
| 58 | + |
| 59 | +The notebook `Dropout.ipynb` will help you implement dropout and explore its effects on model generalization. |
| 60 | + |
| 61 | +### Q4: Convolutional Neural Networks |
| 62 | + |
| 63 | +In the notebook `ConvolutionalNetworks.ipynb` you will implement several new layers that are commonly used in convolutional networks. |
| 64 | + |
| 65 | +### Q5: PyTorch on CIFAR-10 |
| 66 | + |
| 67 | +For this part, you will be working with PyTorch, a popular and powerful deep learning framework. |
| 68 | + |
| 69 | +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. |
| 70 | + |
| 71 | +### Q6: Network Visualization: Saliency Maps, Class Visualization, and Fooling Images |
| 72 | + |
| 73 | +The notebook `Network_Visualization.ipynb` will introduce the pretrained SqueezeNet model, compute gradients with respect to images, and use them to produce saliency maps and fooling images. |
| 74 | + |
| 75 | +### Submitting your work |
| 76 | + |
| 77 | +**Important**. Please make sure that the submitted notebooks have been run and the cell outputs are visible. |
| 78 | + |
| 79 | +Once you have completed all notebooks and filled out the necessary code, you need to follow the below instructions to submit your work: |
| 80 | + |
| 81 | +**1.** Open `collect_submission.ipynb` in Colab and execute the notebook cells. |
| 82 | + |
| 83 | +This notebook/script will: |
| 84 | + |
| 85 | +* Generate a zip file of your code (`.py` and `.ipynb`) called `a2_code_submission.zip`. |
| 86 | +* Convert all notebooks into a single PDF file. |
| 87 | + |
| 88 | +If your submission for this step was successful, you should see the following display message: |
| 89 | + |
| 90 | +`### Done! Please submit a2_code_submission.zip and a2_inline_submission.pdf to Gradescope. ###` |
| 91 | + |
| 92 | +**2.** Submit the PDF and the zip file to [Gradescope](https://www.gradescope.com/courses/527613). |
| 93 | + |
| 94 | +Remember to download `a2_code_submission.zip` and `a2_inline_submission.pdf` locally before submitting to Gradescope. |
0 commit comments