Lesson 3 official topic

I’ll try that out next week. I think I already did 150 images per category but I’ll have to try more. Do you have a magic number in mind? Otherwise I’m thinking 500 next and then iterating if I see a decent improvement

There may still be imperceptible features that experts may have a hard time finding that a deep learning model could find, so I wouldn’t give up on an image-only method just yet…
But in case you want to supplement with additional data, I would look into multimodal models where you can combine image with other types of data, such as tabular or text data. It’s a bit of a more advanced topic though. Maybe the discussion here will help:
https://forums.fast.ai/t/combining-tabular-images-in-fastai2-and-should-work-with-almost-any-other-type/

2 Likes

This description provides more information behind the timm benchamrks: pytorch-image-models/README.md at master · rwightman/pytorch-image-models · GitHub

1 Like

Yes - 500 is a good target, if you can get it. From there, it may help to focus more on improving the quality of the images - validating you don’t have anything in there you don’t really want. And making sure your data augmentation is reasonable.

2 Likes

I’ll take a look! I’ve taken this course in the past so everything is just a refresher for me so far.

1 Like

Yes, I took advantage of booleans in the search to make sure there were fewer miscategorized items. Could you clarify what you mean by “making sure your data augmentation is reasonable”?

yeah so you can create a test_dl:

Then you can pass that into get_preds and you will get predictions for the entire test_dl

You can see an example of how that’s done at the end of this notebook of mine.

4 Likes

As jeremy has mentioned, using gradcam is probably a good way to begin reasoning about which features your model is actually picking up and how you might be able to improve. Take a look in Lesson 6!

3 Likes

Question based on today’s lecture:
Is there perhaps a way to try out all the different models, and automatically find the best-performing one? Sort off, like how in scikit-learn, we use GridSearchCV to automatically find the best hyperparameter values?

12 Likes

Examine the data in your batches that are the outputs from your data augmentation. It might be that the augmentation should be made more extreme, or less extreme. It might be that the default settings are inappropriate for your data.

1 Like

I wonder if that could be automated within the lib, like creating a data loader under the hood using all the transformations that were used for validation :thinking: But I guess it is a topic for a different discussion.

Yes you take your dls you used for training and call dls.test_dl(data) and fastai will create the test dataloader to use the same transformations that was used by dls.

My example notebook just passes in a CSV to test_dl and the same transformations used for dls was used to construct the dataloader…

2 Likes

It is possible, though, could be quite time-consuming for large datasets, especially for NLP, vision or audio processing tasks. Google searched for optimal architectures with generic algorithms AFAIK, and that’s how Efficient Nets emerged. And there are some other papers as well about searching the best architecture using some sort of randomized search. But the bottleneck is computation resources and time, I believe. Like, one can do the search very quickly for Linear Regression or maybe tree-based models, especially, for the tabular data. However, for deep learning it requires much more computation.

Yeah, just like how GridSearchCV is also computationally expensive, too, so can imagine how much more the task of finding the best deep learning model amongst so many options would be.

Ah, ok! I didn’t get it at first. Makes sense! That’s what I was looking for.

1 Like

Where does the term tensor come from? Why are they called that way?

3 Likes

" The concept of tensor arose in 19th century physics when it was observed that a force (a 3-dimensional vector) applied to a medium (a deformable crystal, a polarizable dielectric, etc.) may give rise to a response, a 3-dimensional vector, that is not parallel to the applied force"
source: Tensor - Knowino.

3 Likes

Great question! I have another question related to this: are there any “low-hanging fruits” for hyperparameter tuning? What are the simple things that can give the highest gains?

And is it possible to do cross-validation on just a small subset of the data? I can imagine that training on k-folds would exhaust Kaggle quota in a flash. I guess I would like to know if there are “7 habits” but for highly effective deep learners :slight_smile:

2 Likes

Well 1D is a vector, 2D is a matrix, and then we want to stop inventing new words for all the other scales of dimensions, so we use ‘n dimension tensor’. The actual history of the word comes from wanting to represent stress on an object as a field that varies at different locations - so it was a tensor (tension) field.

5 Likes

Lesson 3, makes me think it’s time to learn Pytorch. Any good resources to learn pytorch concepts covered in chapter 4 of the book?

2 Likes