ml test 5 flashcards

========================================================

TEST 5 — APPLIED ML & DEEP LEARNING FLASHCARDS

========================================================

--- DISTANCE METRICS ---

Question 1: What is the formula for Manhattan (L1) Distance between two points A and B?

Answer 1: |x1 − x2| + |y1 − y2|. Sum the absolute differences across every dimension. Example: A=(1,2), B=(4,6) → |1−4| + |2−6| = 3 + 4 = 7.

Question 2: What is the formula for Euclidean (L2) Distance between two points A and B?

Answer 2: √((x1−x2)² + (y1−y2)²). Take the squared difference in each dimension, sum them, then square root. Example: A=(1,2), B=(4,6) → √(9+16) = √25 = 5.

Question 3: What does Cosine Similarity measure, and what is its formula?

Answer 3: It measures the angle between two vectors — not their magnitude. Formula: cos(θ) = (A · B) / (||A|| × ||B||). Result is between −1 and 1. 1 = identical direction, 0 = perpendicular, −1 = opposite.

Question 4: Why use Cosine Similarity instead of Euclidean distance in NLP?

Answer 4: Two documents can be very different in length (word count) but discuss the same topic. Euclidean distance would say they are "far apart" due to magnitude. Cosine similarity ignores length and only checks directional alignment of vocabulary.

Question 5: Why must features be normalized before applying distance-based algorithms like KNN or K-Means?

Answer 5: Features on a larger scale (e.g., salary: $0–$200k) will dominate distance calculations over features on a smaller scale (e.g., age: 0–100), regardless of actual importance. Normalization puts all features on equal footing.

--- EVALUATION METRICS ---

Question 6: What is the formula for Accuracy?

Answer 6: (True Positives + True Negatives) / Total Predictions. Fraction of all predictions that were correct.

Question 7: What is the formula for Precision?

Answer 7: True Positives / (True Positives + False Positives). Of everything the model predicted as positive, how many actually were?

Question 8: What is the formula for Recall (Sensitivity)?

Answer 8: True Positives / (True Positives + False Negatives). Of all actual positives, how many did the model catch?

Question 9: What is the formula for F1-Score?

Answer 9: 2 × (Precision × Recall) / (Precision + Recall). The harmonic mean of Precision and Recall.

Question 10: When should you prioritize Precision over Recall?

Answer 10: When false positives are costly. Examples: flagging an innocent person as fraud, or sending a legitimate email to spam.

Question 11: When should you prioritize Recall over Precision?

Answer 11: When false negatives are costly. Examples: missing a cancer diagnosis or failing to detect a server crash.

Question 12: What is the Precision-Recall tradeoff?

Answer 12: They pull against each other. Making the model more aggressive (predicting positive more often) raises Recall but lowers Precision. A threshold controls this balance.

Question 13: Why is Accuracy a misleading metric for imbalanced datasets?

Answer 13: A model that always predicts the majority class will have very high accuracy but zero ability to detect the minority class. Example: 99.9% accuracy by always predicting "Normal" on a dataset with 0.1% crashes, yet Recall on crashes = 0%.

Question 14: What is MCC (Matthews Correlation Coefficient) and when should you use it?

Answer 14: A metric that accounts for all four cells of the confusion matrix (TP, TN, FP, FN). Scores range from −1 to +1 (1 = perfect, 0 = random). Use it for imbalanced datasets — it only gives a high score if the model performs well on BOTH classes.

Question 15: What is the difference between an ROC Curve and a Precision-Recall (PR) Curve?

Answer 15: ROC plots True Positive Rate vs. False Positive Rate; use on balanced datasets. PR Curve plots Precision vs. Recall; use on imbalanced datasets because it is more sensitive to minority-class performance.

Question 16: What does AUC (Area Under the Curve) represent for a ROC curve?

Answer 16: The probability that the model will rank a random positive sample higher than a random negative one. AUC = 1.0 is perfect; AUC = 0.5 is random guessing.

--- DATASETS ---

Question 17: Describe the MNIST dataset.

Answer 17: 70,000 grayscale images of handwritten digits 0–9. Split into 60,000 training / 10,000 testing. Each image is 28×28 pixels, 1 channel.

Question 18: Describe the CIFAR-10 and CIFAR-100 datasets.

Answer 18: 60,000 small 32×32 RGB images. CIFAR-10 has 10 classes (6,000 images each). CIFAR-100 has 100 classes (600 images each).

Question 19: What was the "80 Million Tiny Images" dataset and why was it withdrawn?

Answer 19: 80 million 32×32 images scraped from the internet. MIT withdrew it because it contained offensive and derogatory images — a key case study in data ethics, bias in training data, and accountability.

Question 20: What is ImageNet and what ethical concern surrounds how it was labeled?

Answer 20: 1.2 million high-resolution images across 1,000 classes. Labels were created via Amazon Mechanical Turk (crowdsourced gig workers paid fractions of a cent per task), raising concerns about labor exploitation and labeling bias/quality.

--- AI ETHICS ---

Question 21: What is AI Alignment?

Answer 21: The challenge of ensuring an AI system does what you actually intend — matching its goals and behaviors to human values and intentions, not just the literal specification.

Question 22: What is Reward Hacking (the "Monkey's Paw" effect)?

Answer 22: When an AI finds an unintended shortcut to maximize its reward signal without achieving the intended goal. Example: told to "score as many points as possible," the AI exploits a game glitch instead of playing normally.

Question 23: Which of the four AI ethics pillars — Justice, Fairness, Accountability, Alignment — does Reward Hacking most closely relate to, and why?

Answer 23: Alignment. The AI is technically following its instructions (maximize reward) but not the spirit of the goal. The issue is a mismatch between the specified objective and the intended behavior.

Question 24: What are the four pillars of AI Ethics covered in this course?

Answer 24: Alignment (does it do what we intend?), Fairness (does it treat groups equitably?), Accountability (who is responsible for harm?), Justice (are outcomes morally right and equitable across society?).

--- TRADITIONAL ML: KNN ---

Question 25: How does KNN make a prediction?

Answer 25: It calculates the distance from a new data point to every training point, finds the K closest neighbors, then takes a majority vote (classification) or average (regression).

Question 26: What happens when K is too small vs. too large in KNN?

Answer 26: Too small → overfits (very sensitive to individual points, captures noise). Too large → underfits (averages over too many points, misses patterns).

Question 27: What are the main pros and cons of KNN?

Answer 27: Pros: simple, no training time, handles multi-class naturally, non-linear boundaries. Cons: slow at prediction (computes all distances), memory-intensive (stores entire dataset), struggles in high dimensions.

Question 28: Is KNN a parametric or non-parametric model?

Answer 28: Non-parametric. Model complexity grows with data — more training points = more complex model. No fixed distributional assumption.

--- TRADITIONAL ML: K-MEANS ---

Question 29: How does K-Means clustering work step by step?

Answer 29: (1) Choose K. (2) Randomly initialize K centroids. (3) Assign each point to nearest centroid (L2 distance). (4) Recompute each centroid as the mean of its assigned points. (5) Repeat 3–4 until convergence.

Question 30: What are the main cons of K-Means?

Answer 30: Must choose K in advance. Sensitive to random initialization. Assumes spherical, equal-sized clusters. Sensitive to outliers (they skew the centroid mean).

Question 31: What is the key difference between KNN and K-Means?

Answer 31: K-Means is unsupervised (no labels, discovers structure). KNN is supervised (requires labeled training data to make predictions).

--- TRADITIONAL ML: GMMs ---

Question 32: How do Gaussian Mixture Models (GMMs) differ from K-Means?

Answer 32: GMMs make soft assignments — each point is given a probability of belonging to each cluster (e.g., "75% cluster 1, 25% cluster 2"). K-Means makes hard assignments (each point belongs to exactly one cluster).

Question 33: When should you use GMMs over K-Means?

Answer 33: When clusters are elliptical or different shapes/densities, when you need uncertainty estimates (soft probabilities), or when data likely comes from overlapping distributions.

--- TRADITIONAL ML: PCA ---

Question 34: What is Principal Component Analysis (PCA)?

Answer 34: An unsupervised dimensionality reduction technique. It finds the directions in the data with maximum variance (principal components) and projects the data onto those directions, compressing features while retaining as much information as possible.

Question 35: What are the steps of PCA?

Answer 35: (1) Standardize data. (2) Compute covariance matrix. (3) Compute eigenvectors (directions) and eigenvalues (variance captured). (4) Sort by eigenvalue descending. (5) Select top K components. (6) Project data onto those K components.

Question 36: Why must you fit PCA on training data only, then apply to both train and test?

Answer 36: To prevent data leakage. If you run PCA on the full dataset first, the principal components are influenced by test set patterns, meaning training features are "aware" of the test set structure — this is cheating.

Question 37: What are four reasons to use PCA?

Answer 37: (1) Curse of dimensionality — distances become meaningless in high dimensions. (2) Remove noise — last components capture mostly noise. (3) Visualization — reduce to 2D/3D to inspect structure. (4) Speed — fewer features = faster training.

--- COLLINEARITY ---

Question 38: What is collinearity and why is it a problem in ML?

Answer 38: When two or more features are highly correlated (one can be predicted from another). Problems: unstable/sensitive weights, inflated complexity, misleading feature importance, and numerical instability in matrix inversion.

Question 39: How can you address collinearity in a dataset?

Answer 39: (1) Remove one of the correlated features. (2) Apply PCA to combine them. (3) L2 Regularization (Ridge). (4) L1 Regularization (Lasso).

--- PARAMETRIC VS. NON-PARAMETRIC ---

Question 40: What is a parametric model? Give examples.

Answer 40: A model with a fixed number of parameters determined before training. After training, only the parameters are needed — training data is discarded. Examples: Linear Regression, Logistic Regression, Neural Networks.

Question 41: What is a non-parametric model? Give examples.

Answer 41: A model whose complexity grows with the data — more data = more complex model. No fixed distributional assumptions. Examples: KNN, Decision Trees, Random Forests, K-Means.

Question 42: What are the key tradeoffs between parametric and non-parametric models?

Answer 42: Parametric: fast inference, data-efficient, interpretable, but limited by its assumptions. Non-parametric: flexible, no assumptions, but slower inference, memory-intensive, needs more data, prone to overfitting.

--- NATURAL LANGUAGE REPRESENTATION ---

Question 43: What is Bag of Words (BoW) and what is its main limitation?

Answer 43: BoW counts word frequencies in a document, ignoring grammar and order. Main limitation: treats all words as equally important, ignores context and word order. "The flight was great" and "The flight was not great" look nearly identical.

Question 44: What is TF-IDF and how does it improve on BoW?

Answer 44: TF-IDF balances how often a word appears in a document (TF) against how rare it is across all documents (IDF). It penalizes common stop words and boosts rare, informative terms automatically.

--- IMAGE REPRESENTATION ---

Question 45: How is a grayscale image represented as data?

Answer 45: A 2D matrix (Height × Width). Each pixel has a single value from 0 (black) to 255 (white). Example: MNIST is 28×28×1.

Question 46: How is an RGB image represented as data?

Answer 46: A 3D tensor (Height × Width × 3). Three stacked channels — Red, Green, Blue — each a 2D matrix of intensity values 0–255.

Question 47: What does the "Channel" dimension represent in image data?

Answer 47: The number of color or information layers. Grayscale: C=1. RGB: C=3. Multispectral (satellite): C can be 10+.

--- DATA PIPELINES & LEAKAGE ---

Question 48: What is the correct order of operations to avoid data leakage: Split, Normalize, PCA?

Answer 48: (1) Split into train/test first. (2) Fit transformers (mean, std, PCA components) on training data ONLY. (3) Apply those fitted parameters to both train and test sets.

Question 49: What is the purpose of the Validation set vs. the Test set?

Answer 49: Validation set: used iteratively during training to tune hyperparameters (learning rate, architecture). The model "sees" it indirectly. Test set: used ONCE at the very end to give an unbiased estimate of real-world performance. Never tune based on test set results.

Question 50: How is the final performance metric calculated in K-Fold Cross-Validation?

Answer 50: Split data into K equal folds. Train K times, each time holding out a different fold as validation. Final metric = arithmetic mean of scores across all K folds. Example: [80, 82, 78, 81, 79] → mean = 80%.

--- IMBALANCED DATASETS ---

Question 51: What is Undersampling and what is its risk?

Answer 51: Removing examples from the majority class to balance the dataset. Risk: you throw away potentially useful information.

Question 52: What is Oversampling (SMOTE) and what is its risk?

Answer 52: Adding synthetic or duplicate examples to the minority class. SMOTE generates new synthetic examples similar to existing ones. Risk: can lead to overfitting on the minority class.

--- NEURAL NETWORK FUNDAMENTALS ---

Question 53: What is the XOR problem and why can't a single-layer perceptron solve it?

Answer 53: XOR is not linearly separable — no single straight line can separate (0,0),(1,1) from (0,1),(1,0). A single neuron is a linear classifier and can only draw one hyperplane. A hidden layer with non-linear activations is required.

Question 54: Why can't we just stack multiple linear layers without activation functions?

Answer 54: The composition of linear functions is still a linear function. W2(W1x + b1) + b2 simplifies to a single WnewX + bnew. No matter how many linear layers you add, the network is no more powerful than one layer. Non-linear activations are essential.

Question 55: What are Logits?

Answer 55: The raw, unnormalized scores output by the final linear layer of a neural network. They range from −∞ to +∞ and must be passed through an activation (like Softmax or Sigmoid) to become probabilities.

Question 56: What does Softmax do and how does it work?

Answer 56: Converts arbitrary logits into a probability distribution where all values are between 0 and 1 and sum to exactly 1. Formula: exp(zi) / Σ exp(zj). Example: logits [1.0,1.0,1.0] → each e¹/3e¹ = 0.33.

Question 57: What output activation and loss function should you use for each problem type?

Answer 57: Regression → Linear activation + MSE. Binary Classification → Sigmoid + Binary Cross-Entropy. Multi-Class Classification → Softmax + Categorical Cross-Entropy.

Question 58: What is 1-Hot Encoding and how does it relate to Categorical Cross-Entropy?

Answer 58: Represents a categorical label as a vector of 0s with a single 1 at the correct class index (e.g., "Cat" = [0,1,0]). Categorical Cross-Entropy measures the difference between the predicted probability distribution and this 1-hot ground truth, heavily penalizing low confidence on the correct class.

Question 59: What does the Universal Approximation Theorem state and what are its limitations?

Answer 59: A feed-forward network with at least one hidden layer and non-linear activations can approximate any continuous function to any desired accuracy. Limitations: doesn't say how many neurons are needed, doesn't guarantee trainability via gradient descent, only applies to continuous functions.

Question 60: What is a Linear (Dense) layer and what are its learnable parameters?

Answer 60: A layer where every input neuron connects to every output neuron. Parameters: Weights (W) — scale input signals — and Biases (b) — shift the activations. Formula: y = xWᵀ + b. Example: 784 inputs → 100 neurons requires 784 × 100 = 78,400 weights.

--- CNNs ---

Question 61: What does a convolutional filter do?

Answer 61: A kernel slides across the image performing element-wise multiplication and summing results, producing a feature map that highlights a specific pattern (e.g., horizontal edges, corners) wherever that pattern appears in the image.

Question 62: What does a convolutional filter of all equal values (e.g., all 1/9 in a 3×3) do to an image?

Answer 62: It blurs/smooths the image. Each output pixel becomes the average of its 3×3 neighborhood. This removes sharp edges and high-frequency noise.

Question 63: What does an asymmetric filter (positive on one side, negative on the other) do?

Answer 63: It detects edges in a specific direction. Positive values on the left and negative on the right detect vertical edges (and vice versa for horizontal edges).

Question 64: What is the standard design pattern for spatial dimensions and channel counts as a CNN gets deeper?

Answer 64: Spatial dimensions (H×W) decrease (via pooling or strided convolutions). Channel counts increase. Early layers detect simple edges (few channels); deep layers detect complex objects (many channels).

Question 65: What is the role of ReLU in a convolutional block?

Answer 65: Introduces non-linearity. It applies max(0, x) — keeps positive activations, zeros out negatives. Without it, stacking conv layers would still be a linear operation.

Question 66: What is the role of Max Pooling in a convolutional block?

Answer 66: Downsamples the spatial dimensions (takes the max value in each window), reduces computation, and introduces translation invariance — the model can recognize a feature even if it shifts slightly in position.

Question 67: What are the three purposes of Max Pooling?

Answer 67: (1) Dimensionality reduction (shrinks H×W, fewer parameters). (2) Translation invariance (small shifts in feature position don't change output). (3) Non-linearity (it is itself a non-linear operation).

Question 68: What is the formula for output size O of a conv or pooling layer?

Answer 68: O = (I − K + 2P) / S + 1, where I = input size, K = kernel size, P = padding, S = stride.

Question 69: What is Valid padding vs. Same padding?

Answer 69: Valid: no padding added; spatial dimensions shrink each layer. Same: zeros added around the border so output H×W equals input H×W (with stride=1).

Question 70: What is the Receptive Field and how does it grow in a CNN?

Answer 70: The region of the input image a given neuron "sees." In layer 1, a neuron sees a 3×3 patch. After multiple conv/pool layers, a deep neuron's receptive field can cover the entire input image.

Question 71: What does the Flatten operation do in a CNN?

Answer 71: Collapses the 3D tensor (C×H×W) into a single 1D vector of length C×H×W. This vector is then fed into the fully connected classification layers.

Question 72: Why are Convolutional layers more parameter-efficient than Linear layers for images?

Answer 72: Convolutions use parameter sharing (same filter applied across the whole image) and local connectivity (each neuron only looks at a small patch). A 3×3 conv with 64 filters needs ~1,700 parameters; a linear layer on a 224×224 RGB image with 1,000 units needs ~150 million.

Question 73: What is the classification head of a CNN?

Answer 73: The layers at the end that perform classification: Flatten → Fully Connected (Dense) layers → optional Dropout → Output layer with Softmax (multi-class) or Sigmoid (binary).

Question 74: What is Data Augmentation and what are common techniques?

Answer 74: Artificially expanding training data diversity to improve generalization. Techniques: geometric (flips, rotations, random crops), photometric (brightness/contrast adjustments, Gaussian noise), elastic transforms (warping/stretching).

Question 75: What is a Residual (Skip) Connection and what problem does it solve?

Answer 75: A shortcut that adds the input x directly to the output of a block: H(x) = F(x) + x. It solves the vanishing gradient problem in very deep networks by giving gradients a direct "highway" to flow through during backpropagation.

Question 76: What is the Degradation Problem that ResNet's skip connections address?

Answer 76: Paradoxically, adding more layers to a deep network sometimes decreases training accuracy — not overfitting, but difficulty learning the identity function. Skip connections let layers "do nothing" if unhelpful, preventing this degradation.

Question 77: What is the VGG architecture's design philosophy and main drawback?

Answer 77: Philosophy: simplicity through uniformity — stacks of 3×3 conv layers + 2×2 max pooling, with channels doubling at each block. Drawback: massive parameter count (~138 million in VGG-16), mostly in the large fully connected layers at the end.

Question 78: Why does VGG use stacked 3×3 filters instead of a single 7×7 filter?

Answer 78: Two stacked 3×3 layers cover the same 7×7 receptive field as one 7×7 layer, but with fewer parameters and more non-linear activations (more ReLUs), enabling more complex feature learning.

--- PYTORCH TRAINING ---

Question 79: What are the five essential steps inside a PyTorch training loop iteration?

Answer 79: (1) optimizer.zero_grad() — clear old gradients. (2) outputs = model(inputs) — forward pass. (3) loss = criterion(outputs, labels) — compute loss. (4) loss.backward() — compute gradients. (5) optimizer.step() — update weights.

Question 80: What is the Golden Rule of device management in PyTorch?

Answer 80: The model and data must be on the SAME device. If the model is on CUDA and input is on CPU, PyTorch throws a RuntimeError. Use: device = torch.device("cuda" if available else "cpu"), then model.to(device) and inputs.to(device).

Question 81: How do you move a tensor from GPU back to CPU for use with NumPy?

Answer 81: tensor.detach().cpu().numpy(). NumPy cannot read directly from GPU memory.

Question 82: What is the difference between Parameters and Hyperparameters?

Answer 82: Parameters are learned by the optimizer during training (weights W, biases b — you don't set these). Hyperparameters are set by the researcher before training (learning rate, batch size, number of layers, dropout rate).

Question 83: What does Batch Normalization do and why is it useful?

Answer 83: Normalizes activations within a layer by subtracting batch mean and dividing by batch std deviation. Addresses Internal Covariate Shift. Allows higher learning rates, reduces sensitivity to weight initialization, provides slight regularization.

Question 84: How does Dropout behave differently during training vs. inference?

Answer 84: Training: randomly zeros out a fraction p of neurons, forcing redundant learning paths. Inference: all neurons are active but outputs are scaled by (1−p) to maintain expected magnitude. Toggled via model.train() vs. model.eval() in PyTorch.

Question 85: What is Learning Rate Warmup and why is it used?

Answer 85: Starting with a very low learning rate and gradually increasing it over the first few epochs. Prevents the model from diverging due to large gradients early in training when weights are random and the loss surface is steep.

Question 86: What is Cosine Annealing and why is it used?

Answer 86: A learning rate schedule that reduces LR following a cosine curve, smoothly approaching zero. High LR early helps escape poor local minima; low LR late helps settle precisely into the global minimum.

Question 87: What is Early Stopping and what is the role of Patience?

Answer 87: Halts training when validation loss stops improving to prevent overfitting. Patience = number of epochs to wait before stopping. Best practice: save the weights from the epoch with the best validation loss, not the final epoch.

Question 88: What does it mean if training loss keeps decreasing while validation loss increases?

Answer 88: The model is overfitting — it has stopped learning general patterns and started memorizing training-specific noise. Apply Dropout, Weight Decay, or Early Stopping.

Question 89: When should you use MAE vs. MSE vs. NLL as a loss function?

Answer 89: MSE: regression, penalizes large errors heavily (outlier-sensitive). MAE: regression, more robust to outliers (doesn't square errors). NLL (Negative Log Likelihood): classification, used with LogSoftmax to measure how well predicted probabilities match true labels.

--- FOUNDATION MODELS & EMBEDDINGS ---

Question 90: What is a dense embedding vector?

Answer 90: A fixed-size vector of floating-point numbers (e.g., 512 or 768 dimensions) that encodes semantic meaning. Unlike sparse BoW vectors, every dimension is non-zero, and semantically similar items are geometrically close in the embedding space.

Question 91: What does a short Euclidean distance between two embedding vectors imply?

Answer 91: The two original inputs (images, text, etc.) are semantically similar — they represent similar concepts, objects, or meaning.

Question 92: What is Self-Supervised Learning (SSL)?

Answer 92: A learning paradigm where the data itself provides supervision without human labels. The model is given a "pretext task" — e.g., predict a masked word, predict the rotation angle of an image, fill in a masked image patch — forcing it to learn deep structure.

Question 93: What are pseudo-labels in the context of SSL?

Answer 93: Automatically generated training targets derived from the data itself. Example: hiding part of an image and using the hidden part as the "label" the model must predict. No human annotation required.

Question 94: What is Linear Probing on a frozen foundation model?

Answer 94: Freezing all weights of a pre-trained foundation model, attaching a single trainable Linear layer to the end, and only training that last layer on your specific task. It tests how much useful information the foundation model already encodes.

Question 95: Why are large pre-trained models called "Foundation" models?

Answer 95: They are trained on massive, diverse data (via SSL) and develop broad world understanding that can be adapted to hundreds of downstream tasks (classification, generation, translation) with minimal additional training.

--- MIXED / APPLIED QUESTIONS ---

Question 96: A model achieves 99.9% accuracy on a dataset where 99.9% of samples are class "Normal." What is the Recall for the "Crash" class if the model always predicts "Normal"?

Answer 96: Recall = 0%. The model never predicts "Crash," so it catches zero actual crashes. TP = 0, FN = all actual crashes. Recall = 0/(0 + all crashes) = 0%.

Question 97: A developer normalizes their data before splitting into train and test sets. What is the error called and how should it be fixed?

Answer 97: Data Leakage. The fix: split first, then fit the scaler only on the training set, then apply the fitted scaler to both train and test.

Question 98: Input image: 10×10, 1 channel. Apply Conv2d with 10 output channels (same padding, spatial size preserved). Then apply MaxPool2d with a 2×2 window. What are the tensor dimensions after MaxPool?

Answer 98: 10 channels × 5 × 5. Same padding keeps 10×10 after conv. MaxPool 2×2 halves each spatial dimension: 10/2 = 5. Result: 10×5×5.

Question 99: From the above, what integer must be passed as in_features to the following nn.Linear layer?

Answer 99: 250. Flatten collapses 10 × 5 × 5 = 250 values into a single 1D vector.

Question 100: You have 10 input features and a hidden layer with 5 neurons. Ignoring biases, how many weights are learned in this layer?

Answer 100: 50. Every input neuron connects to every output neuron: 10 × 5 = 50 weights.

Question 101: Softmax is applied to logits [1.0, 1.0, 1.0]. What is the resulting probability distribution?

Answer 101: [0.33, 0.33, 0.33]. All logits are equal, so e¹ = 2.718 for each. Sum = 3 × 2.718 = 8.154. Each probability = 2.718 / 8.154 ≈ 0.33.

Question 102: Describe the training/validation loss curve shape that indicates severe overfitting.

Answer 102: Training loss continues to decrease (approaching zero), while validation loss initially decreases but then turns upward and increases — the two curves diverge. The gap between them grows as training continues.

Question 103: Using Early Stopping with no patience, given val losses [0.80, 0.65, 0.50, 0.45, 0.48, 0.49, 0.55, 0.60] — at what epoch does training halt and which epoch's weights do you keep?

Answer 103: Training halts at Epoch 5 (first epoch where validation loss is worse than the previous best). You keep Epoch 4 weights (val loss = 0.45, the best observed).

========================================================

END OF FLASHCARDS — 103 TOTAL

========================================================