Skip to content

Commit 4225ade

Browse files
author
Fang Yu Lin
committed
add assignment_a3
1 parent e6a9e14 commit 4225ade

File tree

1 file changed

+122
-0
lines changed

1 file changed

+122
-0
lines changed

assignments/2020/assignment3.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
---
2+
layout: page
3+
title: Assignment 3
4+
mathjax: true
5+
permalink: /assignments2020/assignment3/
6+
---
7+
8+
This assignment is due on **Wednesday, May 27 2020** at 11:59pm PDT.
9+
10+
<details>
11+
<summary>Handy Download Links</summary>
12+
13+
<ul>
14+
<li><a href="{{ site.hw_3_colab }}">Option A: Colab starter code</a></li>
15+
<li><a href="{{ site.hw_3_jupyter }}">Option B: Jupyter starter code</a></li>
16+
</ul>
17+
</details>
18+
19+
- [Goals](#goals)
20+
- [Setup](#setup)
21+
- [Option A: Google Colaboratory (Recommended)](#option-a-google-colaboratory-recommended)
22+
- [Option B: Local Development](#option-b-local-development)
23+
- [Q1: Image Captioning with Vanilla RNNs (25 points)](#q1-image-captioning-with-vanilla-rnns-25-points)
24+
- [Q2: Image Captioning with LSTMs (30 points)](#q2-image-captioning-with-lstms-30-points)
25+
- [Q3: Network Visualization: Saliency maps, Class Visualization, and Fooling Images (15 points)](#q3-network-visualization-saliency-maps-class-visualization-and-fooling-images-15-points)
26+
- [Q4: Style Transfer (15 points)](#q4-style-transfer-15-points)
27+
- [Q5: Generative Adversarial Networks (15 points)](#q5-generative-adversarial-networks-15-points)
28+
- [Submitting your work](#submitting-your-work)
29+
30+
### Goals
31+
32+
In this assignment you will implement recurrent networks, and apply them to image captioning on Microsoft COCO. You will also explore methods for visualizing the features of a pretrained model on ImageNet, and also this model to implement Style Transfer. Finally, you will train a Generative Adversarial Network to generate images that look like a training dataset!
33+
34+
The goals of this assignment are as follows:
35+
36+
- Understand the architecture of recurrent neural networks (RNNs) and how they operate on sequences by sharing weights over time
37+
- Understand and implement both Vanilla RNNs and Long-Short Term Memory (LSTM) networks.
38+
- Understand how to combine convolutional neural nets and recurrent nets to implement an image captioning system
39+
- Explore various applications of image gradients, including saliency maps, fooling images, class visualizations.
40+
- Understand and implement techniques for image style transfer.
41+
- Understand how to train and implement a Generative Adversarial Network (GAN) to produce images that resemble samples from a dataset.
42+
43+
44+
### Setup
45+
46+
You should be able to use your setup from assignment 2.
47+
48+
You can work on the assignment in one of two ways: **remotely** on Google Colaboratory or **locally** on your own machine.
49+
50+
**Regardless of the method chosen, ensure you have followed the [setup instructions](/setup-instructions) before proceeding.**
51+
52+
#### Option A: Google Colaboratory (Recommended)
53+
54+
**Download.** Starter code containing Colab notebooks can be downloaded [here]({{site.hw_3_colab}}).
55+
56+
If you choose to work with Google Colab, please familiarize yourself with the [recommended workflow]({{site.baseurl}}/setup-instructions/#working-remotely-on-google-colaboratory).
57+
58+
<iframe style="display: block; margin: auto;" width="560" height="315" src="https://www.youtube.com/embed/IZUz4pRYlus" frameborder="0" allowfullscreen></iframe>
59+
60+
**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.
61+
62+
Once you have completed all Colab notebooks **except `collect_submission.ipynb`**, proceed to the [submission instructions](#submitting-your-work).
63+
64+
#### Option B: Local Development
65+
66+
**Download.** Starter code containing jupyter notebooks can be downloaded [here]({{site.hw_3_jupyter}}).
67+
68+
**Install Packages**. Once you have the starter code, activate your environment (the one you installed in the [Software Setup]({{site.baseurl}}/setup-instructions/) page) and run `pip install -r requirements.txt`.
69+
70+
**Download CIFAR-10**. Next, you will need to download the CIFAR-10 dataset. Run the following from the `assignment3` directory:
71+
72+
```bash
73+
cd cs231n/datasets
74+
./get_assignment3_data.sh
75+
```
76+
**Start Jupyter Server**. After you have the CIFAR-10 data, you should start the Jupyter server from the
77+
`assignment3` directory by executing `jupyter notebook` in your terminal.
78+
79+
Complete each notebook, then once you are done, go to the [submission instructions](#submitting-your-work).
80+
81+
**You can do Questions 3, 4, and 5 in TensorFlow or PyTorch. There are two versions of each of these notebooks, one for TensorFlow and one for PyTorch. No extra credit will be awarded if you do a question in both TensorFlow and PyTorch**
82+
83+
### Q1: Image Captioning with Vanilla RNNs (25 points)
84+
85+
The Jupyter notebook `RNN_Captioning.ipynb` will walk you through the implementation of an image captioning system on MS-COCO using vanilla recurrent networks.
86+
87+
### Q2: Image Captioning with LSTMs (30 points)
88+
89+
The Jupyter notebook `LSTM_Captioning.ipynb` will walk you through the implementation of Long-Short Term Memory (LSTM) RNNs, and apply them to image captioning on MS-COCO.
90+
91+
### Q3: Network Visualization: Saliency maps, Class Visualization, and Fooling Images (15 points)
92+
93+
The Jupyter notebooks `NetworkVisualization-TensorFlow.ipynb` /`NetworkVisualization-PyTorch.ipynb` will introduce the pretrained SqueezeNet model, compute gradients with respect to images, and use them to produce saliency maps and fooling images. Please complete only one of the notebooks (TensorFlow or PyTorch). No extra credit will be awardeded if you complete both notebooks.
94+
95+
### Q4: Style Transfer (15 points)
96+
In the Jupyter notebooks `StyleTransfer-TensorFlow.ipynb`/`StyleTransfer-PyTorch.ipynb` you will learn how to create images with the content of one image but the style of another. Please complete only one of the notebooks (TensorFlow or PyTorch). No extra credit will be awardeded if you complete both notebooks.
97+
98+
### Q5: Generative Adversarial Networks (15 points)
99+
In the Jupyter notebooks `GANS-TensorFlow.ipynb`/`GANS-PyTorch.ipynb` you will learn how to generate images that match a training dataset, and use these models to improve classifier performance when training on a large amount of unlabeled data and a small amount of labeled data. Please complete only one of the notebooks (TensorFlow or PyTorch). No extra credit will be awarded if you complete both notebooks.
100+
101+
### Submitting your work
102+
103+
**Important**. Please make sure that the submitted notebooks have been run and the cell outputs are visible.
104+
105+
Once you have completed all notebooks and filled out the necessary code, there are **_two_** steps you must follow to submit your assignment:
106+
107+
**1.** If you selected Option A and worked on the assignment in Colab, open `collect_submission.ipynb` in Colab and execute the notebook cells. If you selected Option B and worked on the assignment locally, run the bash script in `assignment2` by executing `bash collectSubmission.sh`.
108+
109+
This notebook/script will:
110+
111+
* Generate a zip file of your code (`.py` and `.ipynb`) called `a2.zip`.
112+
* Convert all notebooks into a single PDF file.
113+
114+
**Note for Option B users**. You must have (a) `nbconvert` installed with Pandoc and Tex support and (b) `PyPDF2` installed to successfully convert your notebooks to a PDF file. Please follow these [installation instructions](https://nbconvert.readthedocs.io/en/latest/install.html#installing-nbconvert) to install (a) and run `pip install PyPDF2` to install (b). If you are, for some inexplicable reason, unable to successfully install the above dependencies, you can manually convert each jupyter notebook to HTML (`File -> Download as -> HTML (.html)`), save the HTML page as a PDF, then concatenate all the PDFs into a single PDF submission using your favorite PDF viewer.
115+
116+
If your submission for this step was successful, you should see the following display message:
117+
118+
`### Done! Please submit a3.zip and the pdfs to Gradescope. ###`
119+
120+
**2.** Submit the PDF and the zip file to [Gradescope](https://www.gradescope.com/courses/103764).
121+
122+
**Note for Option A users**. Remember to download `a3.zip` and `assignment.pdf` locally before submitting to Gradescope.

0 commit comments

Comments
 (0)