Deep Learning: Backpropagation and Initialization

38 flashcardsby ElliottC
Study these flashcardsFree · spaced repetition · iPhone, Android, Mac & web

All cards

1
What does backpropogation solve?
1) Allows us to calculate gradients (derivatives) efficiently
2) Helps us initialize parameters to avoid huge losses, and avoid extremely large or small gradients
2
What are the two steps of backpropogation?
Forward pass and Backwards pass
3
What does the Forward pass do?
The network processes the input data and computes the activations of all hidden units layer by layer until the output is obtained. (Like betas and omegas)
The activations at each layer are saved to be used during the second phase of backpropagation to compute the gradients efficiently.
4
What does the Backwards Pass do?
The network uses the stored activations from the backwards pass to compute the gradients of the loss with respect to each parameter efficiently.
This is done by propogating the error from the output layer back through the network to the input layer.
5
What are the problems with parameter initialization?
- Vanishing gradient: gradients and weights will get smaller and smaller (if the variance is very small)
- Exploding Gradient: If the variance is very large, then each weight or element (like beta or omega) will get very large, much larger magnitude than the inputs.
In either scenario we run into the problem of floating point numbers not being able to repersent the artithmetic.
Goal: $h_k \approx h_{k-1}$
6
What is He initalization?
• Variance scaling: He initialization compensates for ReLU's halving effect by doubling the variance of the random weights.
• Formula: The weights are initialized from a zero-mean distribution (Gaussian or uniform) scaled by the number of input connections ($(n_{in}\)$.
7
What is Algorithmic differentiation?
When deep learning frameworks like Pytorch calculate the derivatives automatically. Each functional component in the framework knows how to compute its own derivative. These frameworks use parallelization with modern GPUs do do these things quickly.
8
What is the overarching goal of the performance of a model?
Generalization, we wnat our trained model to perform well not just on the training data but also in unseen test data.
9
What are the three types of test errors?
1) Inherent uncertainty
2) Amount of training data
3) Choice of model
10
What is the point of the Training set of data?
It allows the model to learn the task, used to fit the model parameters. Helps learn model parameters with things like stochastic gradient descent.
11
What is the point of the validation set of data?
It helps choose which model is the best, helps tune hyperparameters and make decisions surrounding the model architecture. Like comparing the number of layers of nuerons.
12
What is the point of the test set of data?
Used to evaluate the final model's generalization performance.
13
What is Overfitting?
The model performs well on the training data but fails to generalize to unseen data.
What can happen is the training loss decreases steadily toward zero, then the test loss decreases a first but then subsequently increases as the model becomes increasingly confident about its (wrong) predictions.
14
What are the three sources of error?
Noise, Bias, and Variance.
15
What is Noise?
There are multiple possible valid outputs y for each input x
May arise when:
- There is a genuine stochastic element to the data generation process
- Because some of the data is mislabled
- Because there are further explanatory variables that were not observed
16
What is Bias?
The model is not flexible enough to fit the true function perfectly, the error introduced by approximating a real-world problem, which may be complex, by a simplified model. Can cause underfitting, where the model is too simple to capture the underlying patterns in the data.
- Can be fixed by adding more layers or nuerons
17
What is Variance?
When we have limited training examples, and there is no way to distinguish systematic changes in underlying function from noise in the underlying data.
- Can be fixed by adding more training data
18
What is the Bias-Variance trade off?
For fixed-size training data, the variance typically increases as the model capacity increases. So by trying to solve the bias of the data by increasing the number of hidden layers, we increase the variance.
19
How do we choose hyperparameters?
Usually chosen empirically, we train the models with different parameters and keep the one that performs the best. Use validation set to test trained model on then modify hyperparameters.
20
What is accuracy?
Accuracy is the proportion of correct predictions. It is the number of correct predictions divided by the total number of predictions.
$Accuracy = \frac{\text{Number of correct predictions}}{\text{Total number of predictions}}$
- it is a good metric when classes are balanced, a bad metric when not.
- ex: a model gets 95% accuracy when predicting the same class for a dataset that is 95% that class
21
For a Binary Classifier, what are the four possible outcomes of accuracy?
True Positive (TP): Correctly predicted the positive class
False Positive (FP): Incorrectly predicted the negative class as positive
True Negative (TN): Correctly predicted the negative class
False Negative (FN): Incorrectly predicted the positive class as negative
$Accuracy = \frac{TP + TN}{TP + TN + FP + FN}$
22
What is Precision?
The proportion of positive predictions that are correct.
$Precision = \frac{TP}{TP + FP}$
23
What is Recall?
The proportion of positive instances that are correctly predicted
$Recall = \frac{TP}{TP + FN}$
24
What is bad about a model with perfect precision but poor recall?
Predicts positives only when it's absolutley certain, so it never makes a false positive, but misses most true positives.
25
What is bad about a model with poor precision but good recall?
Predicts many more positives than truly exist, catching almost all real positives but generating many false alarms.
26
What is F1 Score?
A harmonic mean of the precision and recall?
$F1-Score = 2 \times \frac{Precision \times Recall}{Precision + Recall}$
27
What is Mean Aboslute Error (MAE)?
The average of the absolute differences between the predicted and the actual values
$\frac{1}{n} \sum_{i=1}^{n} |y_i - \hat{y}_i|$
28
What is Mean Squard Error (MSE)?
The average of the squared differences between the predicted and actual values
$\frac{1}{n} \sum_{i=1}^{n} (y_i - \hat{y}_i)^2$
29
What is Cross-Validation?
A technique used to asses how the results of a statistical analysis will generalize to an independent dataset. Common example method: k-fold cross-validation.
30
What is Regularization?
A family of methods that reduce the generalization gap between training and test performance.
Strictly speaking, regularization involves adding explicit terms to the loss function that favor certain parameter choices, however this term is commonly used to refer to any strategy that improves generalization.
31
What is L2 Regularization?
L2 punishes the sum of the squares of the parameter values, favoring smaller parameter values. Is usually applied to the weights but not the biases and is hence referred to as a weight decay term.
$g[\phi] = argmin \sum_{i=1}^{n} l_i[x_i,y_i] + \lambda \sum_{j}\phi^2_j$
32
What is Early Stopping?
Refers to stopping the training prodcedure of a model before it has fully convereged.
This can reduce overfitting if the model has already captured the coarse shape of the underlying function but has not yet had time to overfit to the noise.
33
What is Ensembling?
Another approach to reducing the generalization gap. To build several models and average their predictions, a group of such models is known as an ensemble. Reliably improves test performance at the cost of training and storing multiple models and performing ingerence multiple times.
You can train different models through random initialization or re-sampling the training data.
34
What is Dropout?
Another approach to reducing generalization gap. Dropout clams a random subset (typically 50%) of hidden units to zero at each iteration of SGD. This makes the network less dependent on any given hidden unit and encourages the weights to have smaller magnitudes so that the change in the function due to the presence or absence of any specific hidden unit is reduced.
35
What is transfer learning?
When training data is limited, other datasets can be expoited to improve performance. In transfer learning, the network is pretrained to perform a related secondary task for which data are more plentiful. The resulting model is then adapted to the original task.
36
What is multi-task learning?
A network is trained to solve several problems concurrently. Some things are learned better when done simulataneously.
37
What is self-supervised learning?
Two Types: Generative and Constrastive
Generative: Part of each data example is masked, and the secondary task is to predict the missing part
Constrastive: Pairs of examples with commonalities are compared to unrelated pairs.
38
What is Augmentation?
When we want to expand the dataset, but we are limited.
We can often transform each input data example in such a way that the label stays the same, like rotating or flipping and image horizontally.
Study all 38 cards for free

More Computer science flashcards

ManuelYu Defense Playbook18 cardsComputer science · EnglishDiandreiIB Compsci Topic 213 cardsComputer science · EnglishnoahmzSE320: Software Engineering and Testing159 cardsComputer science · EnglishsomeComputing: Software and Apps134 cardsComputer science · EnglishJackAP Computer Science Principles Terms94 cardsComputer science · EnglishJonathanHDL and Assembly Language Midterm Exam74 cardsComputer science · EnglishDiandreiMicrosoft Azure AI Fundamentals61 cardsComputer science · EnglishmeganRepublic Act No. 10175 (Cybercrime Prevention Act of 2012)50 cardsComputer science · EnglishSANGALLACybersecurity7 decks · 247 cardsComputer scienceAndrewAtmopy Unit 1 36 cardsComputer science · EnglishMiriCIS136 CH. 830 cardsComputer science · EnglishDanielBR rules son24 cardsComputer science · EnglishEdson

All Computer science decks

Study these decks in the app

Free on iPhone, Android, Mac and the web. Add any deck to your account in one tap.

Download on the App StoreGet it on Google Play
Study all 38 cards for free