This repo contains the assignments and links from the Winter 2016 offering of Stanford's CS231n course. I really appreciate Stanford's decision to open up this course for the public to follow along. This field is so new there is no reference textbook, only recent papers from 2012 and onwards.
There are a few different webpages that are used for the course.
There are three assignments in the course, and a project.
- Assignment 1: Image classification, kNN, SVM, Softmax, Neural Network. My solutions.
- Assignment 2: Fully-connected nets, batch normalization, dropout, convolutional nets.
- Assignment 3: TBD.
The course uses Python and Numpy to code up Machine learning algorithms. The course notes include a great (introduction)[http://cs231n.github.io/python-numpy-tutorial/]. This is a list of useful tricks I've used in the course.
# Initializing the array dW to 0 with the same size as W.
dW = np.zeros_like(W)
# Adding a new axis dimension of 1 (for broadcasting)
y = y[:, np.newaxis]
# Storing a value on each row, according to a column vector
rows = np.arange(num_train) # Create an array of row indices
rows = rows[:, np.newaxis] # Convert array from (500,) to (500,1)
y # y contains an array of column values to index below
y = y[:, np.newaxis] # Convert array from (500,) to (500,1)
margins[rows, y] = 0
# Creating a column vector from a matrix, with columns for each row in the y vector
correctProbabilities = probabilities[range(num_examples),y])
# Setting all elements matching a condition to a value
margins[margins > 0] = 1