In this assignment, you will implement various image classification models, based on the SVM / Softmax / 2-layer Neural Network. The goals of this assignment are as follows:

  • Implement and apply a Multiclass Support Vector Machine (SVM) classifier
  • Implement and apply a Softmax classifier
  • Implement and apply a Two layer neural network classifier
  • Understand the differences and tradeoffs between these classifiers
  • Practice implementing vectorized gradient code by checking against naive implementations, and using numeric gradient checking

This assignment is due on Monday, September 30 at 11:59pm EDT.

Q1: Linear Classifiers (60 points)

Open in Colab

The notebook linear_classifier.ipynb will walk you through implmenting SVM and Softmax classifier.

Q2: Two-layer Neural Network (40 points)

Open in Colab

The notebook two_layer_net.ipynb will walk you through implementing a two-layer neural network-based classifier.

Steps

1. Click “Open in Colab”

This will launch the corresponding notebook in Google Colab. No installation or setup required!

For more information on using Colab, see our Colab tutorial.

2. Save a copy in Drive

Once the notebook launches, click File -> “Save a copy in Drive…”. This will save a copy of the notebook in your own Google Drive account.

By default, when you save a copy the name will be prepended with “Copy of” – for example saving a copy of the notebook “linear_classifier.ipynb” will create a file named “Copy of linear_classifier.ipynb”. You should rename your copy to have the same name as the original file.

3. Work on the assignment

Work through the notebook, executing cells and writing code as indicated. You can save your work in Google Drive (click “File” -> “Save”) and resume later if you don’t want to complete it all at once.

While working on the assignment, keep the following in mind:

  • The notebook has clearly marked blocks where you are expected to write code. Do not write or modify any code outside of these blocks.
  • Do not add or delete cells from the notebook. You may add new cells to perform scratch computations, but you should delete them before submitting your work.
  • Run all cells before submitting. You will only get credit for code that has been run.

4. Download .ipynb file

Once you have completed a notebook, download the completed notebook by clicking “File” -> “Download .ipynb”.

Make sure your downloaded file has the same name as the original notebook; either linear_classifier.ipynb or two_layer_net.ipynb for this assignment.

5. Submit your work to Canvas

Create a .zip file containing your completed notebook; name it uniquename_umid.zip (e.g. justincj_12345678.zip).

Make sure you do not change the filenames or include any other files. Your submitted .zip file should contain two files named linear_classifier.ipynb and two_layer_net.ipynb.

We have written a validation script for you to check the structure of your submitted .zip file. This script does not check whether your homework is correct; it only makes sure that your submitted file has the right structure, that you didn’t modify any parts of the .ipynb files that you shouldn’t have, and that you didn’t miss any sections where you were supposed to write code. In order to be graded, your assignment must pass this validation script. It is your responsibility to make sure your assignment is properly formatted before you submit it.

When you are done, upload your work to Canvas (UMich students only).