Deep Neural Networks
1 min read.

Intro
In this homework we will prepare our Caltech-101 dataset using a custom dataloader, train and test on AlexNet implementing transfer learning and hyperparameters tuning.
Data preparation
After an initial analysis of code and dataset, we can start by doing the data preparation.
Task A/B
n order to load the folder dataset of Caltech-101, it has been created a custom class loader named Caltech.
In particular, we load all the dataset (into the RAM, since it is relatively small, to speed up the analysis) in the init() constructor. Based on the split
parameter it loads every image identified by the paths in the
train.txt/test.txt file discarding the so called “BACKGROUND” spurious class. Once the 101 class names have
been retrieved, it is created a dictionary to convert the name into an integer. Moreover the tuples (PILImage, class index) are saved into the sample
public attribute.
On the other hand, for what concerns the getitem() method, the indexing is already implemented in python and the PIL Image is already loaded, we only apply (if it exists) the transformation and we return the two elements as a tuple. Finally, our len() returns the lenght of the samples
.
…
Download the report to continue reading.
Fork on Github