In week 7, we covered the second half of lesson 5 and started with lesson 6 on Other Computer Vision problems like Multi-Label classification. We have covered so far almost 25% of the FastBook aka. Deep Learning for Coders.
Last week, I wrote about what is covered in rest of lesson 5. Some of the new things which Aman introduced was:
- The valley function in fastai, which is available in latest version to get the exact learning rate to be passed.
More scheduling algorithms were mentioned like Torch optimizers.
The chapter 6 consists of discussion other Computer Vision problems like Multi-label classification, Regression. During the session we covered more about loading dataset for multi-label classification.
We used PASCAL 2007 dataset for this task, which is consisting of images and tabular data with the labels, filename and whether it’s part of validation datset.
Aman during the lesson explained the difference between lambda functions and normal funcitons with a simple example. To check out more about lambda functions checkout this article from RealPython.
- Next we can create a Datablock, based on the input dataset. With training file path as independendent variable, and labelled list as dependent variable.
When looking into Pytorch and fast.ai, there are two classes for representing datasets:
Datasets - a collection that returns a tuple of independent and dependent variables for a single item. In fastai it returns an iterator for bringing your training and validation dataset.
DataLoaders - a iterator which provides stream of mini-batches where each mini-batches is a couple of batch of independent variables and dependent variables.
This week I tried more about learning Pytorch Datasets and Dataloaders based on this tutorial. The details can be found in week 6 training notebook.
We used a Mulicategory block this time and used one hot encoding technique to identify where is the correct category for each labelled image. Using a splitter for training and validation splitting, the dataset was finally loaded as follows:
The full notebook of week 6 can be found here
The full session recording can be viewed in the below link and thanks for reading 🙏.