Lesson 3 - Official Topic

You usually have three channels (one for red, one for green, one for blue) with values between 0 and 1.

2 Likes

Tutorials on Basics of Pytorch:

1 Like

Just go for it! If you have an idea for a blog post, don’t overthink and write it.
Do it for yourself, mainly, and you’d be surprised by how many people will find that useful afterward.
There are no beginner-level posts.
There are just posts you write and posts you don’t write. Make sure to go for the first option.

My take on blogging:

  • Whenever you work on something, no matter how big it is, clean it up and write a post on it.
  • This in incredibly helpful as, just by typing it down, you will immediately notice if things make sense or not, if you have made a mistake, how to state your thoughts in a clearer way, etc.
  • I found myself going back to posts I wrote a year ago checking what I did and how. Super handy!
  • I found myself showing my posts to recruiters or even during an interview. E.g. it happened to me to be asked: “Do you have experience in video classification?” and I reply “Sure, let me share my screen and show this post of mine”, which is A LOT better than starting chit-chatting about some random approach you heard by someone else. YOU actually implemented that yourself and it adds a ton of value when job-hunting!
  • even in a working environment, sooner or later you will be obliged to summarize your work in a presentation/email/wiki. If you are a blogger already this will come very natural to you!

Long story short, just start your own blog! Do it now!
This is mine and it truly changed my life for the better.

13 Likes

No, only because the utilities that draw images understand normalized floating point representations for images.

No, cause the library used for plotting (matplotlib) expects either ints going from 0 to 255 or floats going from 0 to 1.

2 Likes

why even if my image is in black and white, it still extrapolate the 3 channels RGB?
Is there a way to convert to black and white immediately?

You need to use the type PILImageBW for black and white images.

2 Likes

awesome. thank so much

There are some cases where it’s a good idea to extrapolate to 3 channels, for example if your pretrained model was pretrained on RGB images

1 Like

How do you compare the mean absolute difference and RMSE. Is one better than the other or is it application dependant?

To add to that, if you’re curious/skeptical on how blogging might be helpful for your career: My blog was really helpful when I was freelancing as well as even while I was interviewing for Google AI residency and in my current role too!

Even though honestly, I had started and sometimes still expect no one to read it.

4 Likes

So those are what L1 norm and L2 norm means, been using both of them for so long now, and written them by hand, but always thought it was talking about something completely different. …is there a glossary in the book? (for vocab and such?)

RMSE is usually smoother. It also penalizes more heavily big differences than smaller differences than MAE.

3 Likes

I don’t think one is better than the other. RMSE is more common because it’s easier to do maths with…

There is a slight different between both, that is RMSE gives more “weight” to big changes than small changes.

Opps, @sgugger was faster :sweat_smile:

4 Likes

This is pretty low level, but are there any good resources on why numpy arrays can’t be used on GPUs? Just generally curious about GPU vs CPU computation.

To do computation on NVIDIA GPUs, you need CUDA support. PyTorch has CUDA support and NumPy doesn’t

Behind the scenes numpy uses C

For GPU you need stuff that uses Cuda (or other GPU languages)

1 Like

Can all future lectures be using the Notebooks without slides please? :slight_smile:

1 Like

Seconded! I really like being able to run, modify, and try things while Jeremy’s going through the notebook.

1 Like

Another way to solve the 3 vs 7 digit classification problem

Suppose we have a test image that is known to be either a 3 or a 7.

First “flatten” each of the three images (the test image, the “mean 3” image and the “mean 7” image) to a vector of length 28*28 = 784.

Then compute:

  • The dot product of the flattened test image vector with the flattened averaged 3 image vector
  • The dot product of the flattened test image vector with the flattened averaged 7 image vector.

Classify the test image as a 3 if the first dot product is larger than the second; otherwise classify it as a 7.

8 Likes