---
layout: page
mathjax: true
permalink: /assignments2018/assignment2/
---
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:
- understand **Neural Networks** and how they are arranged in layered
architectures
- understand and be able to implement (vectorized) **backpropagation**
- implement various **update rules** used to optimize Neural Networks
- implement **Batch Normalization** and **Layer Normalization** for training deep networks
- implement **Dropout** to regularize networks
- understand the architecture of **Convolutional Neural Networks** and
get practice with training these models on data
- gain experience with a major deep learning framework, such as **TensorFlow** or **PyTorch**.
## Setup
Get the code as a zip file [here](http://cs231n.github.io/assignments/2018/spring1718_assignment2.zip).
You can follow the setup instructions [here](http://cs231n.github.io/setup-instructions/).
**NOTE: At this time, the PyTorch and TensorFlow notebooks for Question 5 are not finalized. We will update this page with a zip file containing the two notebooks and installation instructions as soon as they are completed.**
### Download data:
Once you have the starter code, you will need to download the CIFAR-10 dataset.
Run the following from the `assignment2` directory:
```bash
cd cs231n/datasets
./get_datasets.sh
```
### Start IPython:
After you have the CIFAR-10 data, you should start the IPython notebook server from the
`assignment2` 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).
If you are unfamiliar with IPython, you can also refer to our
[IPython tutorial](/ipython-tutorial).
### Some Notes
**NOTE 1:** This year, the `assignment2` code has been tested to be compatible with python version `3.6` (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`.
**NOTE 2:** If you are working in a virtual environment on OSX, you may *potentially* encounter
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 `assignment2` 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`.
### Q1: Fully-connected Neural Network (20 points)
The IPython notebook `FullyConnectedNets.ipynb` will introduce you to our
modular layer design, and then use those layers to implement fully-connected
networks of arbitrary depth. To optimize these models you will implement several
popular update rules.
### Q2: Batch Normalization (30 points)
In the IPython notebook `BatchNormalization.ipynb` you will implement batch
normalization, and use it to train deep fully-connected networks.
### Q3: Dropout (10 points)
The IPython notebook `Dropout.ipynb` will help you implement Dropout and explore
its effects on model generalization.
### Q4: Convolutional Networks (30 points)
In the IPython Notebook ConvolutionalNetworks.ipynb you will implement several new layers that are commonly used in convolutional networks.
### Q5: PyTorch / TensorFlow on CIFAR-10 (10 points)
For this last part, you will be working in either TensorFlow or PyTorch, two popular and powerful deep learning frameworks. **You only need to complete ONE of these two notebooks.** You do NOT need to do both, and we will _not_ be awarding extra credit to those who do.
Open up either `PyTorch.ipynb` or `TensorFlow.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.
**NOTE: Once again, at this time, the PyTorch and TensorFlow notebooks are not finalized. We will update this page with a zip file containing the two notebooks as soon as they are completed!**
### Submitting your work
There are **_two_** steps to submitting your assignment:
**1.** Submit a pdf of the completed iPython notebooks to [Gradescope](https://gradescope.com/courses/17367). If you are enrolled in the course, then you should have already been automatically added to the course on Gradescope.
To produce a pdf of your work, you can first convert each of the .ipynb files to HTML. To do this, simply run from your assignment directory
```bash
jupyter nbconvert --to html FILE.ipynb
```
for each of the notebooks, where `FILE.ipynb` is the notebook you want to convert. Then you can convert the HTML files to PDFs with your favorite web browser, and then concatenate them all together in your favorite PDF viewer/editor. Submit this final PDF on Gradescope, and be sure to tag the questions correctly!
**Important:** _Please make sure that the submitted notebooks have been run and the cell outputs are visible._
**2.** Submit a zip file of your assignment on AFS. To do this, run the provided `collectSubmission.sh` script, which will produce a file called `assignment2.zip`. You will then need to SCP this file over to Stanford AFS using the following command (entering your Stanford password if requested):
```bash
# Run from the assignment directory where the zip file is located
scp assignment2.zip YOUR_SUNET@myth.stanford.edu:~/DEST_PATH
```
`YOUR_SUNET` should be replaced with your SUNetID (e.g. `jdoe`), and `DEST_PATH` should be a path to an existing directory on AFS where you want the zip file to be copied to (you may want to create a CS231N directory for convenience). Once this is done, run the following:
```bash
# SSH into the Stanford Myth machines
ssh YOUR_SUNET@myth.stanford.edu
# Descend into the directory where the zip file is now located
cd DEST_PATH
# Run the script to actually submit the assignment
/afs/ir/class/cs231n/submit
```
Once you run the submit script, simply follow the on-screen prompts to finish submitting the assignment on AFS. If successful, you should see a "SUBMIT SUCCESS" message output by the script.
没有合适的资源?快使用搜索试试~ 我知道了~
最新 cs231n 最全资源
共142个文件
py:41个
pdf:27个
ipynb:24个
1星 需积分: 35 82 下载量 143 浏览量
2018-10-31
12:55:23
上传
评论 6
收藏 70.46MB ZIP 举报
温馨提示
最新 cs231n 最全资源,包含视频网址,所有 lectures, 作业及答案,以及所有讲义供你阅读学习
资源推荐
资源详情
资源评论
收起资源包目录
最新 cs231n 最全资源 (142个子文件)
Thumbs.db 26KB
frameworkpython 487B
frameworkpython 487B
frameworkpython 487B
.gitignore 88B
.gitignore 88B
.gitignore 71B
.gitignore 41B
.gitignore 41B
.gitignore 22B
.gitignore 19B
TensorFlow.ipynb 74KB
PyTorch.ipynb 54KB
GANs-TensorFlow.ipynb 42KB
GANs-PyTorch.ipynb 40KB
FullyConnectedNets.ipynb 38KB
ConvolutionalNetworks.ipynb 38KB
BatchNormalization.ipynb 34KB
RNN_Captioning.ipynb 31KB
StyleTransfer-PyTorch.ipynb 30KB
StyleTransfer-TensorFlow.ipynb 30KB
NetworkVisualization-TensorFlow.ipynb 28KB
NetworkVisualization-PyTorch.ipynb 27KB
knn-checkpoint.ipynb 23KB
svm-checkpoint.ipynb 21KB
svm.ipynb 20KB
LSTM_Captioning.ipynb 20KB
knn.ipynb 18KB
two_layer_net.ipynb 17KB
two_layer_net-checkpoint.ipynb 17KB
softmax-checkpoint.ipynb 13KB
features.ipynb 12KB
features-checkpoint.ipynb 12KB
softmax.ipynb 12KB
Dropout.ipynb 10KB
muse.jpg 687KB
starry_night.jpg 599KB
tubingen.jpg 397KB
the_scream.jpg 212KB
composition_vii.jpg 198KB
sky.jpg 145KB
puppy.jpg 37KB
kitten.jpg 21KB
kitten.jpg 21KB
README.md 7KB
README.md 130B
style-transfer-checks.npz 65KB
style-transfer-checks-tf.npz 65KB
gan-checks-tf.npz 2KB
winter1516_lecture1.pdf 9.45MB
winter1516_lecture9.pdf 8.19MB
winter1516_lecture12.pdf 5.94MB
winter1516_lecture6.pdf 5.67MB
winter1516_lecture8.pdf 5.02MB
winter1516_lecture13.pdf 4.62MB
winter1516_lecture10.pdf 4.43MB
winter1516_lecture5.pdf 4.3MB
winter1516_lecture11.pdf 4.06MB
winter1516_lecture14.pdf 3.99MB
winter1516_lecture7.pdf 2.43MB
winter1516_lecture15.pdf 2.42MB
winter1516_lecture3.pdf 2.31MB
winter1516_lecture2.pdf 2.26MB
winter1516_lecture4.pdf 2.17MB
2. Image Classification Data-driven Approach_k-Nearest Neighbor_trainvaltest splits.pdf 1.47MB
11. Understanding and Visualizing Convolutional Neural Networks.pdf 1.01MB
8. Neural Networks Part 3 Learning and Evaluation.pdf 878KB
10. Convolutional Neural Networks Architectures Convolution Pooling Layers.pdf 846KB
7. Neural Networks Part 2 Setting up the Data and the Loss.pdf 689KB
3. Linear classification Support Vector Machine_Softmax.pdf 676KB
6. Neural Networks Part 1 Setting up the Architecture.pdf 662KB
1.Python Numpy Tutorial.pdf 554KB
9. Putting it together Minimal Neural Network Case Study.pdf 361KB
4. Optimization Stochastic Gradient Descent.pdf 349KB
5. Backpropagation.pdf 253KB
12. Transfer Learning and Fine-tuning Convolutional Neural Networks.pdf 89KB
example_styletransfer.png 1.4MB
normalization.png 81KB
gan_outputs_pytorch.png 63KB
gan_outputs_tf.png 54KB
layers.py 31KB
rnn_layers.py 18KB
fc_net.py 13KB
solver.py 12KB
rnn.py 11KB
fast_layers.py 10KB
fast_layers.py 10KB
layers.py 9KB
neural_net.py 9KB
data_utils.py 9KB
data_utils.py 9KB
captioning_solver.py 8KB
data_utils.py 8KB
k_nearest_neighbor.py 7KB
cnn.py 6KB
optim.py 6KB
layer_utils.py 5KB
linear_classifier.py 5KB
features.py 5KB
squeezenet.py 5KB
共 142 条
- 1
- 2
资源评论
- yzqspider02018-12-22千万不要下载 根本不包含视频下载网址kevinoop2018-12-29上面只说提供视频观看网址,需要下载的话可以利用手机登录网易云课堂app进行下载。
kevinoop
- 粉丝: 1685
- 资源: 22
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功