Training your first Model Flashcards

1
Q

What’s an epoch?

A

Epoch: One complete pass through the dataset

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

What’s the rule of thumb when it comes to deep learning and recognizing categories?

A

If the human eye can recognize categories from the images, then a deep learning model should be able to do so too

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

What’s overfitting and why should we avoid it?

A

It occurs when ML model learns not only the underlying patterns in the training data but also the noise and random fluctuations. As a result, the model performs exceptionally well on the training data but poorly on new, unseen data.

It is crucial to avoid overfitting to ensure that models generalize well and provide reliable predictions in real-world applications.

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

How can Overfitting be avoided?

A
  • More Training Data
  • Simplifying the Model
  • Regularization:
    • L1 and L2 Regularization: Penalty for large coefficients in the model’s objective function.
      - Dropout:
  • Cross-Validation
  • Early Stopping
  • Pruning
  • Data Augmentation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantages of transfer learning

A
  • Make use of pretrained models
  • enables deep learning with small amounts of data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What’s the key to avoid overfitting?

A

Resampling and test split

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

How to avoid unintentional overfitting?

A

Split your data carefully into: train / validation / test sets

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

Which tasks does the following code snippet accomplish?

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

A

Define the metrics to track (here: error rate)

Define a vision learner with a resnet architecture

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

Which statements are true about a DataLoaders object?

  • It downloads the data from an URL
  • It contains the training as well as validation data
  • It contains the parameters of the final learned model for future access
  • It specifies which data to use in training a deep learning model
A
  • It contains the training as well as validation data
  • It specifies which data to use in training a deep learning model
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which statements are true about ImageNet?

  • It is a classification task with >21k classes
  • It is a neural network architecture with >14M parameters
  • It contains >14M artificially generated images
  • It can be used for pre-training image-based neural networks
A
  • It is a classification task with >21k classes
  • It can be used for pre-training image-based neural networks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Can you solve non-image tasks using image classifiers? How well can you expect it to work?

A

Yes. If the data can be transformed to an image reasonably well, you can then apply standard image classification techniques. It delivers state-of-the-art results in some cases

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

How can you counter overfitting in deep learning?

A

Validations sets can reduce the chance to overfit, though they need to be carefully designed for each use case. Otherwise you still may be overfitting unintentionally.

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

Which library is mentioned as the most popular for low-level deep learning functionality?

A) TensorFlow
B) Keras
C) PyTorch
D) Scikit-learn

A

Answer: C) PyTorch

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

What is the primary advantage of using transfer learning with pre-trained models?

A) It reduces the amount of labeled data needed for training.
B) It increases the complexity of the model architecture.
C) It requires extensive training time from scratch.
D) It eliminates the need for a GPU.

A

Answer: A) It reduces the amount of labeled data needed for training

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

Given a dataset with 10,000 images, if you use a validation split of 20%, how many images will be used for training and how many for validation?

A

Training images: = 10,000×0.8=8,000
Validation images: 10,000×0.2=2,000

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

If a model is trained for 5 epochs with a batch size of 32 and the dataset contains 1,024 samples, how many gradient updates (iterations) will be performed?

A

Total iterations per epoch:
1,024/32 =32
Total iterations for 5 epochs:
32×5 = 160

17
Q

Write the fastai code to create a learner with a ResNet34 architecture and train it for 1 epoch.

A

learn = vision_learner(dls, resnet34, metrics=error_rate)
learn.fine_tune(1)

18
Q

Explain the concept of transfer learning and its benefits in deep learning.

A

Transfer learning involves using a pre-trained model on a new, often smaller, dataset. The pre-trained model has already learned features from a large dataset (e.g., ImageNet), and these features can be useful for the new task. The benefits include reduced training time, lower need for large datasets, and often improved performance since the model starts with a good baseline of learned features .

19
Q

Describe the role and importance of GPUs in deep learning model training.

A

GPUs (Graphical Processing Units) are crucial in deep learning because they are optimized for the kind of matrix and tensor operations that are common in deep learning algorithms. They can process multiple parallel operations much faster than CPUs, significantly speeding up the training of large models .

20
Q

If a trained model shows a high error rate on the validation set but a low error rate on the training set, what issue is likely occurring and how can it be addressed?

A

Answer:
The model is likely overfitting, meaning it performs well on the training data but poorly on unseen validation data. To address overfitting, techniques such as regularization, dropout, data augmentation, or using a simpler model can be employed .

21
Q

Interpret the significance of the learning rate in the 1cycle training policy.

A

Answer:
The learning rate in the 1cycle training policy starts low, increases to a maximum, and then decreases again. This approach helps to navigate the loss landscape more effectively, avoiding sharp minima and promoting faster convergence. The high learning rate helps escape local minima, while the final low learning rate ensures the model settles into a smooth and well-generalized region of the loss landscape .