Lesson 2 discussion - beginner

I did shut it down and restart it today. Double checked the ip. But right now i stopped and restarted it again. Tried ssh’ing with the new ip that i get again. can’t get in. Im sorry for asking this if this is like a pre beginner thing.

@Sree In your home dir, try to put the .pem file under a hidden .ssh dir rather than directly under your home dir, and make sure that under .ssh dir your .pem file’s access mode is 400.

1 Like

Good point! Also, the .ssh dir should have same (400) permissions. If you follow the steps in the lesson video this is all done automatically, BTW, so if you’re stuck, remove your instance and start again following the steps in the video.

1 Like

I stopped the instance in mumbai region and went over and created a new key pair, added this key pair for the instance and did the other steps after this and it worked. Don’t know what the issue was. Thank you @jeremy n @wluo

1 Like

Another point to add here is to make sure you accept the competition rules before trying kg download

5 Likes

My kaggle login is through google. In this case how do i set my “password” for kaggle-cli? I did “kg download -u -p -c dog-breed-identification” and i get “list index out of range”. What does this mean?
I was looking into Kaggle-cli issues and saw a python script but did not know how to go about with it.

You’ll need to change your Kaggle login to use a regular password.

1 Like

BTW we only very briefly mentioned downloading from Kaggle this week, so we’ll be looking at it in more detail in the next class.

Just changed to a regular password on kaggle. I understand kaggle part was mentioned briefly this week, but i wanted to try doing it out, so had the issue with doing the setup initially.

Yup I’m glad you asked - just wanted to make sure no-one was feeling behind!

In my experience with this API you first have to accept the terms of the competition in Kaggle to be able to use it.

1 Like

what do u mean by regular password

@sree i am getting the same error “List index out of range” …What do u mean by regular password?

As in not use any other login credentials such as through Facebook/GitHub/LinkedIn etc. and use a regular user id/password combo. :slight_smile:

1 Like

@jeremy I want to verify my understanding about the working of the learning rate finder:

image

From the above plot my understanding is :

  • Number of iterations = Number of rows/batch size (default = 64) ~ 360 iterations. So in every iteration I’m applying SGD on mini batch of 64 images with a fixed learning rate and then in the next mini batch I increase the learning rate by some amount till I cover all the batches
  • So for each mini batch using a constant learning rate SGD is implemented to get the minimum loss for that batch+LR combination and it’s plotted in the below plot
  • Now if the above point is correct then why a small learning rate will give a high loss as shown in the graph as small learning rate will converge to minima (although it’ll take some time but it’ll, if we allow it to converge). Also the loss can be dependent on the kind of images in each batch.
    image

Please tell me if my understanding is right. Thanks!!

Yes that’s right, althought’s it’s kind of confusing to say “fixed learning rate” above, since for a particular learning rate we’re only doing a single mini-batch.

So the small learning rates are being used at the start of training, at a point when the loss is still high. Over time, the loss improves, and during that time the learning rate is also increasing. Hence the shape you see in the 2nd plot. Does that make sense?

I think the source of confusion it that you’re assuming we’re doing multiple SGD steps for each learning rate level, but we’re actually only doing one.

1 Like

Try this from @Jeremy:

pip install git+https://github.com/floydwch/kaggle-cli.git

My assumption is that let say we take a mini batch of 64 images and start with a learning rate of 1e-5. On this batch of 64 images I’ll do SGD once using LR = 1e-5 and store the minimum loss that I get. Now I pass another mini batch of 64 images but this time I increase the LR to some value let say 1e-4 and repeat the process. Is it how it is working ?

I’m not sure this is required any more - it looks like they’ve updated their software in pip. So just pip install kaggle-cli should suffice (or on Crestle, pip3 install kaggle-cli).

No that’s not what we’re doing - sorry that I didn’t explain this clearly enough. We just do a single step with that learning rate. So there’s no concept of a ‘minimum loss’ at the learning rate - there’s only one single mini batch, one single step, one loss.

So we:

  1. Pick some initial LR
  2. Grab one mini batch of images
  3. Do a single step of SGD
  4. Record the loss for that one mini batch after that one step
  5. Increase the LR a little
  6. Return to 2.

Does that make more sense?..

4 Likes