Skip to content

Commit 79b3e1a

Browse files
author
Winnie Lin
committed
2019 hw1 release
1 parent 798bd0f commit 79b3e1a

File tree

4 files changed

+103
-2
lines changed

4 files changed

+103
-2
lines changed

assignments/2019/assignment1.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
layout: page
3+
mathjax: true
4+
permalink: /assignments2019/assignment1/
5+
---
6+
7+
In this assignment you will practice putting together a simple image classification pipeline, based on the k-Nearest Neighbor or the SVM/Softmax classifier. The goals of this assignment are as follows:
8+
9+
- understand the basic **Image Classification pipeline** and the data-driven approach (train/predict stages)
10+
- understand the train/val/test **splits** and the use of validation data for **hyperparameter tuning**.
11+
- develop proficiency in writing efficient **vectorized** code with numpy
12+
- implement and apply a k-Nearest Neighbor (**kNN**) classifier
13+
- implement and apply a Multiclass Support Vector Machine (**SVM**) classifier
14+
- implement and apply a **Softmax** classifier
15+
- implement and apply a **Two layer neural network** classifier
16+
- understand the differences and tradeoffs between these classifiers
17+
- get a basic understanding of performance improvements from using **higher-level representations** than raw pixels (e.g. color histograms, Histogram of Gradient (HOG) features)
18+
19+
## Setup
20+
21+
Get the code as a zip file [here](http://cs231n.github.io/assignments/2018/spring1819_assignment1.zip).
22+
23+
You can follow the setup instructions [here](http://cs231n.github.io/setup-instructions/).
24+
25+
### Download data:
26+
Once you have the starter code (regardless of which method you choose above), you will need to download the CIFAR-10 dataset.
27+
Run the following from the `assignment1` directory:
28+
29+
```bash
30+
cd cs231n/datasets
31+
./get_datasets.sh
32+
```
33+
34+
### Start IPython:
35+
After you have the CIFAR-10 data, you should start the IPython notebook server from the
36+
`assignment1` directory, with the `jupyter notebook` command. (See the [Google Cloud Tutorial](http://cs231n.github.io/gce-tutorial/) for any additional steps you may need to do for setting this up, if you are working remotely)
37+
38+
If you are unfamiliar with IPython, you can also refer to our
39+
[IPython tutorial](/ipython-tutorial).
40+
41+
### Some Notes
42+
**NOTE 1:** There are `# *****START OF YOUR CODE`/`# *****END OF YOUR CODE` tags denoting the start and end of code sections you should fill out. Take care to not delete or modify these tags, or your assignment may not be properly graded.
43+
44+
**NOTE 2:** The submission process this year has **2 steps**, requiring you to 1. run a submission script and 2. download/upload an auto-generated pdf (details below.) We suggest **_making a test submission early on_** to make sure you are able to successfully submit your assignment on time (a maximum of 10 submissions can be made.)
45+
46+
**NOTE 3:** This year, the `assignment1` code has been tested to be compatible with python version `3.7` (it may work with other versions of `3.x`, but we won't be officially supporting them). You will need to make sure that during your virtual environment setup that the correct version of `python` is used. You can confirm your python version by (1) activating your virtualenv and (2) running `which python`.
47+
48+
**NOTE 4:** If you are working in a virtual environment on OSX, you may *potentially* encounter
49+
errors with matplotlib due to the [issues described here](http://matplotlib.org/faq/virtualenv_faq.html). In our testing, it seems that this issue is no longer present with the most recent version of matplotlib, but if you do end up running into this issue you may have to use the `start_ipython_osx.sh` script from the `assignment1` directory (instead of `jupyter notebook` above) to launch your IPython notebook server. Note that you may have to modify some variables within the script to match your version of python/installation directory. The script assumes that your virtual environment is named `.env`.
50+
51+
### Q1: k-Nearest Neighbor classifier (20 points)
52+
53+
The IPython Notebook **knn.ipynb** will walk you through implementing the kNN classifier.
54+
55+
### Q2: Training a Support Vector Machine (25 points)
56+
57+
The IPython Notebook **svm.ipynb** will walk you through implementing the SVM classifier.
58+
59+
### Q3: Implement a Softmax classifier (20 points)
60+
61+
The IPython Notebook **softmax.ipynb** will walk you through implementing the Softmax classifier.
62+
63+
### Q4: Two-Layer Neural Network (25 points)
64+
The IPython Notebook **two\_layer\_net.ipynb** will walk you through the implementation of a two-layer neural network classifier.
65+
66+
### Q5: Higher Level Representations: Image Features (10 points)
67+
68+
The IPython Notebook **features.ipynb** will walk you through this exercise, in which you will examine the improvements gained by using higher-level representations as opposed to using raw pixel values.
69+
70+
### Submitting your work
71+
72+
**Important:** _Please make sure that the submitted notebooks have been run and the cell outputs are visible._
73+
74+
There are **_two_** steps to submitting your assignment:
75+
76+
**1.** Run the provided `collectSubmission.sh` script in the `assignment1` directory.
77+
78+
You will be prompted for your SunetID (e.g. `jdoe`) and will need to provide your Stanford password. This script will generate a zip file of your code, submit your source code to Stanford AFS, and generate a pdf `a1.pdf` in a `cs231n-2019-assignment1/` folder in your AFS home directory.
79+
80+
If your submission for this step was successful, you should see a display message
81+
82+
`### Code submitted at [TIME], [N] submission attempts remaining. ###`
83+
84+
**2.** Download the generated `a1.pdf` from AFS, then submit the pdf to [Gradescope](https://gradescope.com/courses/17367). If you are enrolled in the course, you should have already been automatically added to the course on Gradescope.
44.6 KB
Binary file not shown.

index.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,22 @@
1313

1414
<div class="home">
1515
<div class="materials-wrap">
16+
<div class="module-header">Spring 2019 Assignments</div>
17+
18+
<div class="materials-item">
19+
<a href="assignments2019/assignment1/">
20+
Assignment #1: Image Classification, kNN, SVM, Softmax, Neural Network
21+
</a>
22+
</div>
23+
24+
<div class="materials-item">
25+
Assignment #2: TBA
26+
</div>
27+
28+
<div class="materials-item">
29+
Assignment #3: TBA
30+
</div>
31+
<!--
1632
<div class="module-header">Spring 2018 Assignments</div>
1733
1834
<div class="materials-item">
@@ -27,13 +43,14 @@
2743
Convolutional Nets
2844
</a>
2945
</div>
30-
<!---->
46+
3147
<div class="materials-item">
3248
<a href="assignments2018/assignment3/">
3349
Assignment #3: Image Captioning with Vanilla RNNs, Image Captioning
3450
with LSTMs, Network Visualization, Style Transfer, Generative Adversarial Networks
3551
</a>
3652
</div>
53+
-->
3754

3855
<!--
3956
<div class="module-header">Winter 2016 Assignments</div>

setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ You can work on the assignment in one of two ways: locally on your own machine,
1111

1212
**Note:** after following these instructions, make sure you go to **Download data** below (you can skip the **Working locally** section).
1313

14-
As part of this course, you can use Google Cloud for your assignments. We recommend this route for anyone who is having trouble with installation set-up, or if you would like to use better CPU/GPU resources than you may have locally. Please see the set-up tutorial [here](http://cs231n.github.io/gce-tutorial/) for more details. :)
14+
As part of this course, you can use Google Cloud for your assignments. We recommend this route for anyone who is having trouble with installation set-up, or if you would like to use better CPU/GPU resources than you may have locally. Please see the set-up tutorial [here](https://github.com/cs231n/gcloud/) for more details. :)
1515

1616
### Working locally
1717

0 commit comments

Comments
 (0)