Optimization, Loss Functions, and Regularization Flashcards

1
Q

What is the purpose of a loss function?

A

It measures model error.

Loss functions are crucial for training models as they provide a metric to minimize.

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

What type of loss function is Log Loss?

A

Cross-Entropy Loss.

Log Loss is commonly used in binary classification problems.

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

What loss function is used when there are only two classes?

A

Binary Cross-Entropy.

This loss function calculates the error for binary classification tasks.

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

What is the formula for Cross-Entropy Loss?

A

L = - (y log(y_pred) + (1 - y) log(1 - y_pred))

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

What is backpropagation used for?

A

To adjust model weights to reduce error.

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

Define Gradient Descent.

A

Step-by-Step Learning.

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

What is Stochastic Gradient Descent (SGD)?

A

Updates weights after each training sample.

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

What is Mini-Batch Gradient Descent?

A

Updates weights using small batches.

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

What is the learning rate’s role in gradient descent?

A

Controls how big the update steps are.

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

What does momentum do in gradient descent?

A

Helps avoid local minima by adding past weight updates to the current one.

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

What is dropout in the context of model training?

A

Randomly removes neurons during training.

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

What does regularization do?

A

Penalizes overly complex models to encourage generalization.

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

What is early stopping?

A

Stops training when validation loss stops improving.

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

What are epochs in machine learning?

A

Number of times the entire dataset is passed through the model.

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

What is the batch size in gradient descent?

A

Number of samples used per gradient update.

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

Name a common optimizer used in machine learning.

A

Adam.

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

What is the main takeaway regarding activation functions?

A

They enable deep learning.

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

True or False: Dropout and regularization help prevent overfitting.

A

True.

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

What are the two main types of supervised machine learning?

A

Classification and Regression.

20
Q

What does regression in AI predict?

A

Continuous values based on input data.

21
Q

How does regression work in AI?

A

AI learns a function y = f(x) to predict Y.

22
Q

What is Mean Squared Error (MSE)?

A

A loss function that measures how far off AI’s predictions are.

23
Q

What does a lower MSE indicate?

A

A better AI model.

24
Q

What is a Simple Artificial Neural Network (ANN) for regression composed of?

A

Layers of neurons making decisions.

25
What is the first step in building a regression model?
Load & Prepare Data.
26
What is Min-Max Scaling?
Rescales data to [0,1].
27
What is Z-Score Normalization?
Makes data have mean = 0, std dev = 1.
28
What is the activation function used in the hidden layers of the regression model?
ReLU.
29
What optimizer is used when compiling the regression model?
Adam.
30
What is Text Classification?
AI sorts text into categories.
31
What is the example dataset used for text classification?
IMDB movie reviews.
32
How many reviews are in the IMDB dataset?
50,000 highly polarized reviews.
33
What is the first step in preprocessing text for AI?
Convert words into a dictionary of numbers.
34
What does One-Hot Encoding do in terms of words?
Turns words into 0s & 1s.
35
What is the input layer dimension for the FCN used in sentiment analysis?
10,000-dimensional input.
36
What activation function is used in the output layer for binary classification?
Sigmoid.
37
What is the loss function used for the IMDB dataset?
Binary Crossentropy.
38
What task is performed with the Reuters dataset?
Classify short news articles into 46 different categories.
39
How is the Reuters classification different from IMDB classification?
46 categories instead of 2.
40
What activation function is used in the final layer for multi-class classification?
Softmax.
41
What loss function is used for the Reuters dataset?
Categorical Crossentropy.
42
What is the main purpose of regression in the context of the Boston Housing Prices example?
Predict continuous values.
43
What are the key components of text classification for IMDB and Reuters?
* Predicts categories * One-Hot Encoding * Activation functions: ReLU (hidden), Sigmoid (IMDB), Softmax (Reuters) * Loss functions: Binary Crossentropy (IMDB), Categorical Crossentropy (Reuters)
44
Why do we evaluate Machine Learning (ML) and Deep Learning (DL) models?
To ensure they do what we want, avoid overfitting/underfitting, and pick the best model and settings.
45
What is the problem with model evaluation?
How do you know your model isn’t just memorizing the training data?