March 2025 Flashcards

1
Q

Main benefit of using logarithms (mathematically speaking)

A

Multiplication, which can create really really large and small numbers can be replaced by addition.
log(a*b) = log(a) + log (b)

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

Why use the negative log function as a loss function

A

Because the negative log gives us very high loss values when the prediction (accuracy)is close to zero.

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

Cross Entropy Loss

A

SoftMax followed by the negative log likelihood loss.

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

Cross Entropy (etymological description)

A

Cross Entropy is the comparison of two different probability distributions. In classification, this is usually a comparison between the known probability distribution (the labels), and the current predicted probability. You can see how that would yield itself to a loss function.

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

Consequence of using a learning rate that is too low?

A

It will take too many epochs to converge. Too many epochs means overfit (the model will memorize the dataset)

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

What is the most common last activation layer in a Classification CNN?

A

SoftMax

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

What is the most common last activation layer in a Binary Classification CNN?

A

Sigmoid

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

What is the concept called that is used to protect the general image classification tasks of a pre-trained model?

A

Freezing pre-trained layers.

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

Does a learning rate have to be a single number?

A

No, they can differ by layer. And because layers are a gradient of abstraction it is often inappropriate for a single, one-size-fits-all learning rate.
Discriminative Learning Rates

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

What should you focus on when training to know if your model is overconfident or beginning to overfit? And what should you NOT focus on?

A

You should focus on your metrics. You should not focus on the loss.
The loss function is just something you give to the model that it can differentiate and therefore perform SGD.

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

Downsides of deeper architectures?

A

More prone to overfit (due to more parameters with which to overfit)
Out of memory errors driving smaller batch sizes
Much longer training times

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

One way of speeding up the training of deep networks?

A

Mixed-Precision Training
Using half-precision floating point fp16 where possible during training
CUDA has a mode where you can enable this.

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

/sys

A

It is a virtual file system for modern Linux distributions to store and allows modification of the devices connected to the system.

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

F.relu

A

ReLU Rectified Linear Unit (replace every negative number with a zero)

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

activation function

A

a nonlinear layer

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

Precision

A

How many positive indications were actually positive.
Precision = TP / (TP +FP)
TP = True Positives
FP = False Positives
Precision is about CUTTING down on false positives.

17
Q

Recall

A

How many of the actual positive instances were correctly identified.
Recall = TP / (TP + FN)
TP = True Positives
FN = False Negatives
Recall all the known positives at the risk of more false positives

18
Q

Harmonic Mean & reason it is used in F1 score

A

N / (Sum of 1/xi)
lower values have a stronger influence
(It’s a “bad apples” algo)

19
Q

F1 score

A

0 to 1
Harmonic mean of Precision and Recall
F1 = 2 (Precision * Recall) / (Precision + Recall)

20
Q

Way of digging into what your classification model got wrong

A

Confusion Matrix

21
Q

PyTorch method that changes the shape of a tensor without changing its contents.

A

view(-1,2828)
-1 is a special parameter to view that means “make this axis as big as necessary to fit all the data
Here we are multiplying 28
28 *the lengths of the two image dimensions to get the new length of the new (smushed) dimension.
Taking an image and vectorizing it.

22
Q

Define a PyTorch Dataset

A

a collection that contains tuples of independent and dependent variables.
independent = inputs, dependent = targets

23
Q

What is the deal with “L” from FastAI?

A

Meaning of L

L is a specialized list-like container provided by fastcore ( dependency of fastai).

It extends Python lists with additional functionality such as element-wise operations, filtering, and mapping.

24
Q

What is the significance of a method in PyTorch that end in an underscore?

A

This method will modify its contents in place. (Like a mutator from OO world).

25
Why was there only one bias value in the MNIST example I did?
Because there is only one output of the model (essentially is it a 3?) For a classifier there will be N biases, where N is the number of classes.
26
Universal Approximation Theorem
You can model any "wiggly" function if you use enough piecewise lines
27
What is special about an activation layer, and what role does it play
special: An activation layer is non-linear role: A stack of linear layers can be simplified down to a single linear layer. By sticking non-linear layers in-between each linear layer, it will allow each layer to "do it's own thing". This is a major tenet in Neural Networks. Without Nonlinearity, a NN cannot learn complex patterns.
28
What does view do in PyTorch?
Changes the shape of a tensor without changing its contents
29
What is a Python Partial?
When you have a function, you can create a partial of that function where you can "pre-set" some arguments. The new version of the function (almost like an alias) will have a new signature of arguments, without the ones that you "pre-set"
30
Mapping between loss function and type of NN
nn.CrossEntropyLoss for single-label classification nn.BCEWithLogitsLoss for multi-label classification nn.MSELoss for regression
31
Describe Image Regression (in the context of ML/AI)
from images to continuous numerical values example: points in an image, or points & depth, etc.
32
When is normalization most important?
When Transfer training. When using a pre-trained model, your "new" data needs to match the old data (statistically speaking). This is why when models are published, they are also published with their statistics. So that anyone using them can match them.
33
What is Test Time Augmenation?
The practice of using augmentation during testing (or inference or validation). Augmentation is usually used during preprocessing of data. That is why this is called "Test Time" Augmentation.
34
What is Mixup?
A data augmentation technique that blends two inputs and their targets. This is introduced as a new data point.
35
What is Label Smoothing?
A data augmentation technique to remove the "absolute" nature of target vectors. Instead of using a one-hot target like [0,1,0,0], instead we use [0.01, 0.97, 0.01, 0.01].
36