Things Jeremy says to do


(Robert Bracco) #1

Before starting fast.ai, I tried to learn from people who had already passed through the class. Many of them have blogs and wrote about what they would do differently.

Most consistent piece of advice: “Really listen to Jeremy and spend your time how he suggests”
Most consistent regret: “I should have listened when Jeremy said don’t spend hours lost in theory trying to understand everything right away”.

For each lesson I’m going to make a list of everything Jeremy says to do, and then I’m going to do it. I hope others will join me.

Lesson 1:

  1. Don’t try to stop and understand everything.
  2. Don’t waste your time, learn Jupyter keyboard shortcuts. Learn 4 to 5 each day.
  3. Please run the code, really run the code. Don’t go deep on theory. Play with the code, see what goes in and what comes out.
  4. Pick one project. Do it really well. Make it fantastic.
  5. Run this notebook (lesson1-pets.ipynb), but then get your own dataset and run it! (extra emphasis: do this!)
  6. If you have a lot of categories, don’t run confusion matrix, run…
interp.most_confused(min_val=n)

Lesson 2:

  1. If forum posts are overwhelming, click “summarize this topic” at the bottom of the first post.

  2. Please follow the official server install/setup instructions, they work and are easy.

  3. It’s okay to feel intimidated, there’s a lot, but just pick one piece and dig into it. Try to push a piece of code, or learn a concept like regular expressions, or create a classifier, or whatever. Context: Lesson 2: It’s okay to feel intimidated

  4. If you’re stuck, keep going. See image below! Context: Lesson 2: If you’re stuck, keep going

  5. If you’re not sure which learning rate is best from plot, try both and see.

  6. When you put a model into production, you probably want to use CPU for inference, except at massive scale. Context: Lesson 2: Putting Model into Production

  7. Most organizations spend too much time gathering data. Get a small amount first, see how it goes.

  8. If you think you’re not a math person, check out Rachel’s talk: There’s no such thing as “not a math person”. My own input: only 6 minutes, everyone should watch it!

Lesson 3:

  1. If you use a dataset, it would be very nice of you to cite the creator and thank them for their dataset.
  2. This week, see if you can come up with a problem that you would like to solve that is either multi-label classification or image regression or image segmentation or something like that and see if you can solve that problem. Context: Fast.ai Lesson 3 Homework
  3. Always use the same stats that the model was trained with. Context: Lesson 3: Normalized data and ImageNet
  4. In response to “Is there a reason you shouldn’t deliberately make lots of smaller datasets to step up from in tuning, let’s say 64x64 to 128x128 to 256x256?”: Yes you should totally do that, it works great, try it! Context: Lesson 3: 64x64 vs 128x128 vs 256x256

Lesson 4

  1. If you’re doing NLP stuff, make sure you use all of the text you have (including unlabeled validation set) to train your model, because there’s no reason not to. Lesson 4: A little NLP trick

  2. In response to “What are the 10% of cases where you would not use neural nets”. You may as well try both. Try a random forest and try a neural net. Lesson 4: How to know when to use neural nets

  3. Use these terms (parameters, layers, activations…etc) and use them accurately. Lesson 4: Important vocabulary for talking about ML

Lesson 5

  1. The answer to the question “Should I try blah?” is to try blah and see, that’s how you become a good practitioner. Lesson 5: Should I try blah?

#2

I’m in :slight_smile:

There’s a typo in your last bullet point. I think you meant classes or categories instead of classifiers.


(Aditya Anantharaman) #3

thanks a lot for this post @MadeUpMasters . I just started the course yesterday and am not sure whether the method i’m following is the right one. How about we keep updating this branch after every lesson and talk about what approach we followed and what we would like to do differently and how it would help.
Currently i finished the Lesson-1 video and spent an hour or so running the ipnb. Next: have to collect a few images to train a classifier and also get familiar with the syntax of fast.ai library by going through the docs.


(Aditya Anantharaman) #4

what dataset are you guys planing to train your model on for the Lesson-1 assignment?


(yuvaraj sekhar) #5

I just went through the lesson-1. There was no mention of assignment. Can you please point me to where the assignments are listed?


(Aditya Anantharaman) #6

Not exactly assignments @yuvaraj. I meant training out own models using self curated datasets which jeremy had adviced to do.


(Robert Bracco) #7

@raimanu-ds Changed classifiers to categories. Thanks for pointing this out!

@ady_anr Sounds great, I’m in. I took the following steps after Lesson 1:

  1. Ran the lesson 1 notebook step by step
  2. Thought about interesting but simple datasets I could run notebook 1 on (decided on fruits)
  3. Searched for how to get my own dataset and came across this post Tips for building large image datasets. Awesome post but it didn’t work for me on Paperspace gradient so I wasted a lot of time trying to install stuff to make it work.
  4. Discovered lesson2-download.ipynb in the notebooks, this was a gamechanger and what I’d recommend everyone do to implement their first dataset.
  5. Choose a simple problem. I chose alligator vs crocodile and I couldn’t get great results (22% error rate), so I took a step back and chose objects that are easier to distinguish. Apple vs Papaya. If that works, I’ll go a level harder (either back to alligator/crocodile, or fruits but with more classes), if not I’ll go a level easier(e.g. apple vs bear haha but let’s hope it doesn’t come to that) or post on the forum for help.

@yuvaraj I’d suggest you setup a GPU using the instructions at course.fast.ai -> server-setup, then do steps 1, 2 and 4 above.


(Jeremy Howard (Admin)) #8

@MadeUpMasters sounds to me like you’ve done plenty for lesson 1 - I’d suggest moving to lesson 2 at this point. You should generally plan to go through the lessons 2-3 times, going a bit deeper each time, since stuff you learn later will help clarify things earlier in the course.


(Aditya Anantharaman) #9

Thats great. I’m planing on doing a pulses classifier. I wanted some task that is generally hard for a human.But dont know how well that’ll work out because learning to recognize pulses does not require the higher level trained-features of the res-net . Will let you know my progress by tomorrow.


(Aditya Anantharaman) #10

Hey guys. I went through the lesson ipnb. After which i created a dataset consisting of elephant pictures organised into 2 folders. Indian elephant and African elephant.

I chose this topic as even for a person who is used to seeing elephants, differentiating an african one from an indian one is a pretty tough task.

When i trained on a total of 20 images, and the accuracy i got is 100% within 6 epochs.
I think the model is overfitting. How do i check this and if yes how do i solve the problem.

I had set valid_pct to 0.2 hence my validation folder contains 4 images. Working on a bigger dataset currently.

Please do give your suggestions and feedback.:grinning:


#11

Just out of curiosity, the difference between those 2 types of elephants :elephant: is the size of their ears, right ?

Sorry I can’t answer your question about overfitting as I am not there yet :expressionless:


(Aditya Anantharaman) #12

Yes @raimanu-ds the ears and also the trunk looks a bit different.


#13

That’s great @MadeUpMasters :+1:t3:

As for me, I was surprised how relatively easy it was to create our own image datasets using the tips in the post your linked to. However, I struggled with uploading the data into the DataBunch factory methods.

Eventually, I figured it out and moved on to create a classifier that could recognize 40 characters from the TV show ‘The Simpsons’. I explained the various steps I took to implement it in Google Colab here.

It’s been really interesting so far and I am quite satisfied with the results (even without fine tuning the model). I started looking closer at the results and noticed some images were mis-labeled for instance. As more is explained about this topic in Lesson 2, I think I will move on to this lecture.

Let’s keep in touch guys! :grin:


(Aditya Anantharaman) #14

That’s a great blog you wrote @raimanu-ds. Thanks for the detailed explanation on how to download kaggle datasets onto colab.


#15

:blush: :blush:


(Sanyam Bhutani) #16

@ady_anr You may want to share your project in the Share your work thread-you might be able to find more feedback there.

Regards.


(Nick Koenig) #17

Anybody with thoughts on digging into the docs? I’ve noticed a lot of the classes and methods are new. Like ImageItemList vs. ImageDataBunch. I’m only through the first 2 lessons so far. Does it make sense continuing to understand the classes via docs? Or does he go into them a bit more later?


(Robert Bracco) #18

I’m not sure the best way to structure the thread, but for now I’ve removed “lesson 1” from the thread title and I’ll make a new post for each lesson so that if people click “summarize this thread”, the ones people find useful will float to the top. Let me know if there’s a better way to structure it. Now, here’s what Jeremy said to do in Lesson 2.

Lesson 2:

  1. If forum posts are overwhelming, click “summarize this topic” at the bottom of the first post.

  2. Please follow the official server install/setup instructions, they work and are easy.

  3. It’s okay to feel intimidated, there’s a lot, but just pick one piece and dig into it. Try to push a piece of code, or learn a concept like regular expressions, or create a classifier, or whatever. Context: Lesson 2: It’s okay to feel intimidated

  4. If you’re stuck, keep going. See image below! Context: Lesson 2: If you’re stuck, keep going

  5. If you’re not sure which learning rate is best from plot, try both and see.

  6. When you put a model into production, you probably want to use CPU for inference, except at massive scale. Context: Lesson 2: Putting Model into Production

  7. Most organizations spend too much time gathering data. Get a small amount first, see how it goes.

  8. If you think you’re not a math person, check out Rachel’s talk: There’s no such thing as “not a math person”. My own input: only 6 minutes, everyone should watch it!


(Robert Bracco) #19

Jeremy, thanks for the reply and advice!

@ady_anr About overfitting, Jeremy says in lesson 2 it’s quite hard to do using fast.ai libraries. He tried changing a bunch of variables to try to get it to overfit just so he could talk about it in class and he couldn’t get it to. If you overfit you’ll generally have worse results with your validation set because your model doesn’t generalize. Maybe you can download some more images and test to see if your current model can classify them correctly, if it has a high failure rate then I’d get more data and retrain the model.

@init_27 Thanks for your blog. This post How not to do fast.ai was one of the inspirations for this thread! Still waiting on the ‘how to do fast ai’ thread :grinning:


(Sanyam Bhutani) #20

Thanks for reading! :slight_smile:
I’m trying a few more ideas and plan on sharing them in my second pass (I intend to do three-currently about to complete my first pass) through the course.

Thanks for sharing your approach-it’s a great way to distilling Jeremy’s advice as well as leaving points for others to pursue.

Regards,
Sanyam.