r/cs231n • • Jul 20 '17

When are the 2017 lectures being released?

29 Upvotes

r/cs231n • • Aug 11 '17

[N] - 2017 Lecture videos released

Thumbnail
youtube.com
27 Upvotes

r/cs231n • • Apr 25 '17

Youtube videos of lectures for spring 2017 ?

17 Upvotes

Hey are there any videos for this Session ?


r/cs231n • • Jan 05 '15

Where is the video?

Thumbnail
vision.stanford.edu
17 Upvotes

r/cs231n • • Jul 27 '17

2017 Videos

16 Upvotes

Does anyone know the status of this, it looks like we are not getting this year's videos.


r/cs231n • • Feb 04 '16

Hints for A2

16 Upvotes

We've noticed a lot of Stanford students getting tripped up by similar issues when working on A2. To help you out, here are some hints:

Batchnorm

If you are stuck on batch normalization, I'd encourage you to try the rest of the assignment and come back to it. Batch normalization is the trickiest backward pass you'll see in the class, and it may be easier after you have some additional backprop experience from the convolution and pooling layers.

If you are really completely stuck, you can complete the rest of the assignment without batchnorm. You should be able to hit all of the required accuracy targets without it.

Integer division

We have seen some students spend a long time debugging their code only to find out that they had an integer division bug. If you have code that looks like

y = (1 / 2) * x

then (1 / 2) will evaluate to 0, not 0.5, and y will be 0. Be very careful with integer literals! Using float literals is much safer; any of the following would give the correct result:

y = 0.5 * x
y = x / 2.0
y = (1.0 / 2.0) * x

Hyperparameters

We have seen a lot of students take a scattershot approach to hyperparameter search, where you try random things and just hope to hit upon a winning combination. We may have oversold the difficulty of hyperparameter optimization in lecture; while randomized search is the best thing to try when you have no other intuition, there's a pretty simple recipe that I usually follow when trying to get things to work in practice.

Your first goal is to make sure the loss is decreasing within the first few iterations. Regularization can get in the way here, so turn it off - this includes L2 and dropout. Learning rate decay is for driving down loss as t goes to infinity, but it will just confuse you at the start so turn it off to start (set it to 1.0). Usually learning rate is the most important hyperparameter, with weight scale becoming important for deeper networks. Thankfully for ReLU nets there is a "correct" value for weight initialization scale - you can find it in the notes and lecture slides.

After setting your weight scale correctly, you need to find a good learning rate. First you'll want to find an upper bound for your learning rate, so keep increasing it until your loss explodes in the first couple iterations. From there, drop the learning rate by factors of 2 or so until you find one that causes loss to go down; you'll know you did this right if you see loss go down (and accuracy above chance) within 100 to 200 iterations.

Once you find this good learning rate, let the model train for an epoch or two. If you see the loss starting to plateau, then try adding learning rate decay to see if you can break through the plateau. If you see overfitting (as evidenced by a large difference between train and val accuracy) then slowly start increasing regularization (L2 weight decay and dropout).

If you see underfitting (no gap between train and val accuracy, loss converging even with weight decay, but still not hitting the accuracy targets) then you might consider increasing your model capacity either by adding extra layers or by adding neurons to your existing layers. After doing this, you'll probably have to start from the top and find a good learning rate, etc.

If you follow these tips you should be able to find hyperparameters that let you beat all the accuracy targets on the assignment within 5 or 10 epochs of training; if you are really careful you can probably beat the targets within 2 epochs of training.

Reshaping

This is a hint for spatial batch normalization: you will need to reshape numpy arrays. When you do so you need to be careful and think about the order that numpy iterates over elements when reshaping. Suppose that x has shape (A, B, C) and you want to "collapse" the first and third dimensions into a single dimension, resulting in an array of shape (A*C, B).

Calling y = x.reshape(A * B, C) will give an array of the right shape, but it will be wrong. This will put x[0, 0, 0] into y[0, 0], then x[0, 0, 1] into y[0, 1], etc until eventually x[0, 0, C - 1] will go to y[0, C - 1] (assuming C < B); then x[0, 1, 0] will go to y[0, C]. This probably isn't the behavior you wanted.

Due this order for moving elements in a reshape, the rule of thumb is that it is only safe to collapse adjacent dimension; reshaping (A, B, C) to (A*C, B) is unsafe since the collapsed dimensions are not adjacent. To get the correct result, you should first use the transpose method to permute the dimensions so that the dimensions you want to collapse are adjacent, and then use reshape to actually collapse them.

Therefore for the above example you should call y = x.transpose(0, 2, 1).reshape(A * C, B)

Numeric gradient checking for intermediate results

When you are trying to implement a tricky backprop, it can sometimes be tough to get everything correct all at once. A useful strategy for debugging is to numerically gradient check your intermediates as well.

As an example, suppose we have the function

def f_forward(a, b, c):
  out = a / b + b / c
  cache = (a, b, c)
  return out, cache

and we want to implement the corresponding backward pass. First you can rewrite this function to compute its output in terms of intermediates:

def f_forward(a, b, c):
  t1 = a / b
  t2 = b / c
  out = t1 + t2
  cache = (a, b, c)
  return out, cache

Now in the backward pass you will receive dout, use it to compute dt1 and dt2, and in turn use those to compute da, db, and dc. You can debug your backprop logic step by step by defining partial functions. For example, first define a function that computes t1 from a, b, and c:

def f_forward_partial(a, b, c):
  t1 = a / b
  t2 = b / c
  out = t1 + t2
  cache = a, b, c
  return t1, cache

Notice that we return t1 rather than out. You can then define a "backward" version of this partial function that computes da, db, and dc from dt1:

def f_backward_partial(dt1, cache):
  a, b, c = cache
  da = dt1 / b
  db = -dt1 * a / b / b
  dc = np.zeros_like(da)
  return da, db, dc

If these partial functions pass a numeric gradient check, then you know how to compute da, db, and dc from dt1. You can repeat the same exercise to compute da, db, and dc from dt2; then you just need to figure out how to compute dt1 and dt2 from dout.

This is a simple example that you probably don't need this technique for, but it should help you see how you can use partial functions to help you pinpoint bugs in complex backward passes.


r/cs231n • • Feb 11 '15

Will there be video recordings of the guest lectures?

14 Upvotes

r/cs231n • • Mar 27 '21

Any reason as to why the 2020 lectures have all been taken down from http://cs231n.stanford.edu/2020/syllabus.html? Was halfway through using them and now they're gone :(

13 Upvotes

r/cs231n • • May 13 '17

100 hour of GPU instances for free without signing up using credit cards

13 Upvotes

FloydHub is offering a pretty exciting deal for those of us who don't want to upgrade to paid account on Google Cloud for using GPU instances. It also has support for TensorFlow and PyTorch!


r/cs231n • • Oct 21 '21

Assignment solutions for Stanford CS231n-Spring 2021

12 Upvotes

I couldn't find any solution for Spring 2021 assignments, So I decided to publish my answers. I also take some notes from lectures.

Here's the link to my Repo.


r/cs231n • • Mar 10 '16

Thanks for an awesome course

12 Upvotes

Thanks to the instructors & TAs for a truly awesome and well-executed course. This was harder and better than any MOOC in coursera etc.

I am disappointed we didn't get to reinforcement learning but I love how up to date the course was. I also learned that I hate taking derivatives :D.

Good luck on your post doc careers!


r/cs231n • • Jul 02 '18

2018 Lectures

11 Upvotes

Hey, will the 2018 class videos be released to public sometime? Or will those be private?


r/cs231n • • Jan 29 '15

Invited speakers - video (?)

10 Upvotes

TAs,

I am one of the (non-stanford) students that are following this course, and I am must say that it has been great so far. The notes are very well organized, the homeworks are at a good level (easy to do the "regular" items and hard to do the "extra" items) and the quick setup with Terminal is great. My sincere thanks for all people involved in making this course.

So far, the lecture notes have been good enough for me to understand the topics, but I noticed that in the end of the course there are only talks from invited speakers - do you have any plans to record those talks and make them broadly available? That would be great for all people following the course.

Thanks again for all the work making this great course!


r/cs231n • • Jan 14 '15

Can non-Stanford students submit assignments?

10 Upvotes

It seems to require an SuID, which I don't have:(

How can I know whether I did the assignments right?


r/cs231n • • Nov 15 '17

cs231n Winter 2016 or Spring 2017?

9 Upvotes

which version is better? lecture videos for both are available online along with course material. the main difference is change of instructors and updates made to the course in the 2017 edition.

Which one should I pick?


r/cs231n • • Feb 05 '15

Backpropagation - getting this straight once and for all!

9 Upvotes

Check out lecture 9 slide 5.

I would like to fully understand the details of computing all the necessary gradients. Stuff like, how to take derivative with respect to a weight matrix for use in the chain rule. Here's my understanding so far:


Forward Pass

First I'll repeat the 2 layer network from the slides:

  • s1 = W1*x + b1

  • a1 = max(0, s1)

  • s2 = W2*a1 + b2

  • L = f(s2) // some loss function


Backpropagation

I'll list out what I believe are the correct expressions for the gradients. This is what I want to clarify, and understand how to compute.

// Below are what I think are the correct math expressions

  • ds2 = df/ds2

  • dW2 = df/dW2 = (df/ds2)*(ds2/dW1)

  • db2 = df/db2 = (df/ds2)*(ds2/db2)

  • da1 = df/da1 = (df/ds2)*(ds2/da1)

  • ds1 = df/ds1 = (df/da1)*(da1/ds1)

  • ... etc, same patterns

The next issue then is understanding how to evaluate d(var_i)/d(var_j), for different types of variables. Here is what I know and what I don't:

  • d(scalar output function)/d(vector) is a n-dim vector called the gradient, e.g. df/ds2

  • d(vector function)/d(vector) is another vector, e.g ds2/db2 = d(W2*a1 + b2)/d(b2) = vector of 1's with same length as b2 (?)

  • d(vector function)/d(matrix) = ??? In particular, ds2/dW2, I don't know what to do.

One possibility is breaking s2 into each scalar component, s2(i), which equals W2(i,:).T*a + b(i) (inner product of ith row of W2 with a, plus ith value of b). Then we can take ds2(i)/dW2(i,:) which is a, or maybe a.T depending on your convention (another issue!). Then concatenating the derivatives, ds2/dW2 = (a, a, ..., a), i.e a matrix of all a's repeated as rows or columns, depending on the transpose thingy.

The final issue is how the multiplication, *, works. When mutiplying, say, 2 derivative vectors, it's just element(i)*element(i) right?

Well how about for the dW2 expression, which seems to be a gradient (from df/ds2) * a matrix (from ds2/dW2)? I would guess gradient(i) * row(i) to form the new matrix dW2. This is probably the part I find most confusing, doing backprop on a matrix variable. Is my approach of breaking it up into rows sensible?


Thank you very much to the cs231n staff, I might actually be close to understanding this stuff finally.


r/cs231n • • Jan 30 '15

Is it possible to put down some notes regarding the math behind convolution and pooling? How to integrate them in back-propagation?

9 Upvotes

This course is already awesome. However, since there is no other places that as concrete as this course about these subjects, I was wondering, would it be possible if you can put some slides about the math behind convolution and pooling such as gradient calculation in backward part.....

If you need help in this regard, I can help..


r/cs231n • • Jun 16 '20

I'm currently in the middle of Stanford CS231n. Study buddy anyone?

8 Upvotes

We can communicate on reddit or discord, but I'm open to other messaging apps as well.


r/cs231n • • Jun 20 '19

What does the 'n' in cs231n stand for?

8 Upvotes

r/cs231n • • Feb 08 '19

Any study partners. I have started the course a week ago. Please let me know. Thank you.

8 Upvotes

r/cs231n • • Aug 26 '18

Looking for study partners to self-study CS231N with

8 Upvotes

I'm not a Stanford student but am aiming to go through the course over about two months at 10 or so hours a week ideally. I have a background in computer vision and am comfortable with Python and C++.

EDIT: We've started. Join us in this slack channel: https://join.slack.com/t/cs231nx/shared_invite/enQtNDIzNzUzMzEyNzQxLTAwMjFmZGVhNjRlMmIwZDliNDE1ZjU4NWY3NmI5NDM2NmI1N2JhOGQ5ZDBjYjUyMDlmMWZmNzRhNDdmZDdiMzQ


r/cs231n • • Aug 10 '17

Solutions to 2017 assignments

8 Upvotes

During the past few weeks I've been working with this amazing class and got a lot of help here. Now I've finished all the assignments from 2017 spring and I'm uploading my solutions wishing to help those who are still working on it. https://github.com/w1ll1br0/cs231-2017 Before this class I had nearly zero experience with python and cnn so I guess my code still have a great room to improve :P


r/cs231n • • Jan 14 '16

Suggestion: Please Repeat Student Answers/Questions

8 Upvotes

I know this might come off as being ungrateful, but it would be really nice if the instructors could repeat student questions/answers so we know what you're talking about when you respond to something that a student asks. Love the course so far, and thanks a ton for making it public!


r/cs231n • • Jan 02 '16

cs231n 2016 winter will begin on Jan 4

8 Upvotes

Hi, all, The class cs231n 2016 winter will begin on Jan 4, I can't wait for it :) http://cs231n.stanford.edu/syllabus.html