Training Your First Model Flashcards

1
Q

Main steps in training a basic image classifier?

A

Import libraries, load data, define labelling function, create DataLoaders, define model, training

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Code to create a model in a computer vision task?

A

learn = vision_learner(dls, resnet34, metrics=error_rate)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is dls (DataLoaders) object?

A

Contains both training and validation data and specifies which data is used in training

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is ImageNet?

A

> 14M photos, >21k classes. dataset used for pre-training image-based NN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Can you solve non-image tasks using image classifiers?

A

Yes, if the data can be transformed to an image reasonably well

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

from fastai.vision.all import *

A

Imports everything (*) from the fastai.vision library

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

First line of code for all fastai notebooks

A

pip install fastbook

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

path = untar_data(URLs.PETS)/’images’

A
  • Downloads (compressed) dataset from the URL stored in URLs.PETS
    – Unpacks the dataset and returns the local path to the dataset
    – In particular, the ‘images’ subfolder contains the images of the dataset
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

fdef is_cat(x): return x[0].isupper()

A

Defines labelling function, Here: If the file name starts with a capital letter (e.g., “Abyssinian_1.jpg”), it contains a cat

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

learn = vision_learner(dls, resnet34, metrics=error_rate)

A

– Creates a vision learner, i.e., we use images as inputs
– Specifies the data (dls), architecture (resnet34) and metric (error_rate)
– ResNets achieve state-of-the art results
– resnet: “Residual Neural Network”, specific model architecture
– 34 in resnet34 refers to the number of layers of the network (alternatives: 18, 50, 101 and 152)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

learn.fine_tune(1)

A

– This fits the model (more precisely: fine-tunes it)
– Per default (shown here):
– One epoch only on randomly initialized model head
– Number of epochs requested (here: 1) to fit the entire model, but updating weights of later layers faster than earlier layers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

One complete pass through the dataset

A

Epoch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Advantages of Transfer Learning

A

Faster Convergence, Reduced Data Requirements, Better Performance, Reduced Computational Cost

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Which ML tasks can be transformed to image classification?

A

Time Series Classification, Text Classification, Genomic Sequence Analysis, Sensor Data Analysis, Graph Data Analysis, Tabular Data Classification

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Name five areas where deep learning is now the best tool in the world

A

Computer Vision, Natural Language Processing (NLP), - Speech Recognition, Autonomous Vehicles, Healthcare and Drug Discovery

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What was the name of the first device that was based on the principle of the artificial neuron?

A

Perceptron. It was developed by Frank Rosenblatt in 1958.

17
Q

How we avoid overfitting in deep learning?

A

Model is trained on 80% of available labeled data. Metrics are only computed on the validation data (20%). Resampling. Checking for hyperparameters

18
Q

What is test split?

A

Part of the data, only evaluated after choosing the hyperparameters

19
Q

What is transfer learning?

A

ML technique where model developed for one task is used as the starting point for a model on a different task

20
Q

What structure deep learning model have?

A

Layered. Later layers can find more complex features by combining simpler ones from earlier levels

21
Q

Types of layers

A

Input, hidden, output

22
Q

What is DataBlock?

A

The DataBlock class is the building block to preprocess the data. It is somewhat similar to task im mlr3.