VelocerOuvrir l'application

Velocer › Flashcards › University of Wisconsin–Madison › CS 540: Intro to AI (Young Wu) · UW-Madison

CS 540: Intro to AI (Young Wu) · UW-Madison

CS 540, intro to AI. made these for myself, figured i'd share. · par gradient_gecko · 131 cartes

University of Wisconsin–Madison

Étudier ce paquet Intégrer

  1. What does the acronym LTU stand for in the context of perceptrons?LTU stands for Linear Threshold Unit, a basic perceptron model covered in the supervised learning portion.
  2. What does IESDS stand for in game theory?Iterated Elimination of Strictly Dominated Strategies — a method for simplifying games by removing dominated strategies.
  3. What does MDP stand for?Markov Decision Process — a framework for sequential decision-making under uncertainty.
  4. What is the prediction rule of a Linear Threshold Unit (perceptron)?It predicts ŷ = 1 if wᵀx + b ≥ 0, otherwise 0.
  5. What is the perceptron mistake-driven update rule in compact form?w ← w + α(yᵢ − ŷᵢ)xᵢ and b ← b + α(yᵢ − ŷᵢ).
  6. When does the perceptron algorithm converge?It converges if and only if the data is linearly separable.
  7. What is the derivative of the logistic sigmoid g(z) = 1/(1+e⁻ᶻ)?g′(z) = g(z)(1 − g(z)).
  8. What is the range and formula of the tanh activation?tanh(z) = (eᶻ − e⁻ᶻ)/(eᶻ + e⁻ᶻ), with range (−1, 1).
  9. What is the formula for binary cross-entropy loss?−yᵢ log aᵢ − (1 − yᵢ) log(1 − aᵢ).
  10. What is the hinge loss for labels yᵢ ∈ {0,1}?max{0, 1 − (2yᵢ − 1)zᵢ}, where zᵢ = wᵀxᵢ + b.
  11. Name two failure modes of gradient descent.(1) Non-convex objectives can trap it in local minima or saddle points; (2) too large a learning rate causes oscillation or divergence.
  12. Why can't a single neuron produce a nonlinear decision boundary?Even with a nonlinear activation, a single neuron's boundary is linear: wᵀx + b = g⁻¹(0.5).
  13. State the Universal Approximation Theorem for 2-layer and 3-layer networks.A 2-layer network (1 hidden layer) with enough units can approximate any continuous function on a compact domain; a 3-layer network can approximate any function.
  14. What is the backpropagation output-layer sensitivity δᵢ⁽ᴸ⁾?δᵢ⁽ᴸ⁾ = (∂Cᵢ/∂aᵢ⁽ᴸ⁾) · g′(zᵢ⁽ᴸ⁾).
  15. What is the backpropagation hidden-layer sensitivity formula?δᵢⱼ⁽ˡ⁾ = (Σₖ δᵢₖ⁽ˡ⁺¹⁾ wⱼₖ⁽ˡ⁺¹⁾) · g′(zᵢⱼ⁽ˡ⁾).
  16. What are the parameter gradients in backpropagation?∂Cᵢ/∂wⱼ′ⱼ⁽ˡ⁾ = δᵢⱼ⁽ˡ⁾ aᵢⱼ′⁽ˡ⁻¹⁾ and ∂Cᵢ/∂bⱼ⁽ˡ⁾ = δᵢⱼ⁽ˡ⁾.
  17. What does an SVM maximize, and what is the margin width formula?It maximizes the geometric margin between the support hyperplanes; margin = 2/‖w‖₂ = 2/√(wᵀw).
  18. What are support vectors in an SVM?The training points lying directly on the bounding hyperplanes wᵀxᵢ + b = ±1.
  19. State the hard-margin SVM primal optimization problem.min over w,b of ½wᵀw subject to (2yᵢ − 1)(wᵀxᵢ + b) ≥ 1 for all i.
  20. What is the soft-margin SVM objective with ℓ₂-regularized hinge loss?min over w,b of (λ/2)wᵀw + (1/n)Σᵢ max{0, 1 − (2yᵢ − 1)(wᵀxᵢ + b)}.
  21. Why is subgradient descent used for the soft-margin SVM?Because the hinge loss max{0, 1 − z} has a kink at z = 1, so it is non-differentiable there and requires subgradients.
  22. Describe the PEGASOS update when the margin is violated.If y′ᵢ(wᵀxᵢ + b) < 1, update w ← (1 − αλ)w + αy′ᵢxᵢ, where y′ᵢ = 2yᵢ − 1.
  23. What is the Shannon entropy formula for a node with class proportions p₁,…,p_K?H(Y) = −Σᵧ pᵧ log₂ pᵧ, with 0 log₂ 0 = 0.
  24. For binary labels, when is entropy zero and when is it maximal?Entropy is 0 when the node is pure (p₀ = 1 or p₁ = 1) and maximal at 1 bit when p₀ = p₁ = 0.5.
  25. What is the formula for Information Gain I(Y; X)?I(Y; X) = H(Y) - H(Y | X), where H(Y) is the entropy of Y and H(Y|X) is the conditional entropy of Y given X.
  26. How is conditional entropy H(Y | X) computed when X takes values k=1,...,K_X with empirical fractions q_k = P(X=k)?H(Y | X) = sum_{k=1}^{K_X} q_k H(Y | X=k).
  27. What does the ID3 algorithm greedily select at each node?The feature (and threshold for continuous features) that maximizes Information Gain I(Y; X_j).
  28. How does k-Nearest Neighbors classify a query point x'?By majority vote among its K closest training points under a chosen L_p metric.
  29. What are the formulas for Manhattan (L1), Euclidean (L2), and Chebyshev (L∞) distances between x_i and x'?L1: sum_j |x_{ij} - x'_j|; L2: sqrt(sum_j (x_{ij} - x'_j)^2); L∞: max_j |x_{ij} - x'_j|.
  30. Why does 1-NN always achieve 100% training accuracy?Because the nearest neighbor of any training point x_i is x_i itself (distance 0), so it always predicts its own label regardless of noise.
  31. What is K-fold cross-validation?Partition training data into F folds, train on F-1 folds, and evaluate on the held-out fold; repeat so each fold is held out once.
  32. What is Leave-One-Out Cross-Validation (LOOCV)?A special case of K-fold cross-validation where F = n, so each training point is held out exactly once.
  33. What is the purpose of cross-validation in k-NN?To tune the hyperparameter K by evaluating performance on held-out data.
  34. What is the difference between mathematical convolution and cross-correlation in image filtering?Convolution flips the filter by 180° before taking the inner product; cross-correlation does not flip it. Deep learning libraries implement cross-correlation by default since weights are learned.
  35. Why is flattening an image problematic for neural networks?Flattening destroys 2D spatial locality, even though neighboring pixels are spatially correlated. Convolution preserves this local structure.
  36. With a (2k+1)×(2k+1) filter and stride 1, how does zero-padding by k affect output size?Zero-padding by k preserves the spatial dimensions (m×m). Without padding, each dimension shrinks by 2k to (m−2k)×(m−2k).
  37. What is the formula for the output spatial size of a convolutional layer given input size m, padding p, filter size f, and stride s?Output size = ⌊(m + 2p − f)/s⌋ + 1.
  38. How many learnable weights does a pooling layer have?Zero. Pooling layers have no learnable weights; they just downsample each activation map independently.
  39. How does max-pooling route gradients during backpropagation?It routes gradient 1 only to the winning maximum index and 0 elsewhere. Average pooling instead distributes 1/k_p² equally to all k_p² cells.
  40. What key idea defines ResNet's skip/residual connections?ResNet adds the input to the layer output: h^(ℓ) = F(h^(ℓ−1)) + h^(ℓ−1). This helps combat vanishing gradients in deep networks.
  41. What is the purpose of 1×1 bottleneck convolutions in InceptionNet/GoogLeNet?They reduce channel depth to lower computation, and auxiliary classifiers are added to combat vanishing gradients.
  42. What distinguishes U-Net's architecture and its use case?U-Net is an encoder-decoder network with skip connections, used for pixel-level segmentation.
  43. What does a unigram language model assume about words?It assumes words are independent: P̂(w_t) = c_{w_t} / Σ_j c_j.
  44. What is the difference between Bernoulli and Multinomial Naive Bayes feature representations?Bernoulli NB uses binary features x_ij ∈ {0,1} for word presence/absence. Multinomial NB uses raw unnormalized Bag-of-Words counts x_ij = c_ij.
  45. Why does Multinomial Naive Bayes have a linear decision boundary?Because log P(y | x_i) is linear in the counts x_ij.
  46. What is the TF-IDF formula for a term's weight?TF_ij = c_ij / Σ_k c_ik, IDF_j = log(n / |{i : c_ij > 0}|), and x_ij^TF-IDF = TF_ij · IDF_j.
  47. Why does a phrase appearing in every document get zero TF-IDF weight?Its IDF = log(n/n) = 0, so the TF-IDF weight is 0 regardless of term frequency.
  48. What weights does an RNN share across time steps, and how is it trained?It shares W^(a), W^(x), and b^(a) across all time steps to process variable-length sequences. It is trained via Backpropagation Through Time (BPTT) by unfolding the computation graph.
  49. What is the weight-sharing duality among CNNs, RNNs, and GNNs?CNNs share weights across 2D spatial neighborhoods, RNNs across sequential time steps, and GNNs across graph neighborhoods defined by the adjacency matrix.
  50. What normalization is applied to the adjacency matrix in a GNN update rule?A_G = D^(−1/2) A D^(−1/2), where A includes self-loops and D is the degree matrix. The update is a^(ℓ+1) = g(A_G W^(ℓ) a^(ℓ) + b^(ℓ)).
  51. What does scaled dot-product self-attention replace, and in which landmark paper was it introduced?It replaces recurrence entirely with parallel attention, introduced in 'Attention Is All You Need' (Transformers).
  52. What is the vector projection of \(x_i\) onto a non-zero vector \(u_k\)?\((u_k^\top x_i / u_k^\top u_k)\,u_k\). For a unit vector, the scalar projected length is \(u_k^\top x_i\) and the projection is \((u_k^\top x_i)u_k\).
  53. How is the unbiased sample covariance matrix computed from centered data?\(\Sigma = \frac{1}{n-1}\sum_{i=1}^n (x_i-\mu)(x_i-\mu)^\top\), using centered data \(x_i-\mu\).
  54. What are the principal components in PCA?The \(K\) mutually orthogonal unit eigenvectors of the covariance matrix \(\Sigma\) corresponding to the \(K\) largest eigenvalues \(\lambda_1 \ge \dots \ge \lambda_K\).
  55. How does hierarchical agglomerative clustering (HAC) proceed?It starts with \(n\) singleton clusters and iteratively merges the closest pair of clusters, building a dendrogram tree.
  56. Define single linkage distance between clusters A and B.\(\min_{x\in A, y\in B} d(x,y)\) — the shortest pairwise distance between points in the two clusters.
  57. Define complete linkage distance between clusters A and B.\(\max_{x\in A, y\in B} d(x,y)\) — the longest pairwise distance between points in the two clusters.
  58. Define average linkage distance between clusters A and B.\(\frac{1}{|A||B|}\sum_{x\in A}\sum_{y\in B} d(x,y)\) — the average of all pairwise distances, not the distance between centroids.
  59. When updating a distance matrix for single linkage after merging clusters, what formula is used?\(d(C_i\cup C_j, C_k) = \min\{d(C_i,C_k), d(C_j,C_k)\}\).
  60. When updating a distance matrix for complete linkage after merging clusters, what formula is used?\(d(C_i\cup C_j, C_k) = \max\{d(C_i,C_k), d(C_j,C_k)\}\).
  61. In attention, how are Query, Key, and Value vectors computed from hidden states?\(q_s = W^{(q)}a_s^{(h)}\), \(k_t = W^{(k)}a_t^{(h)}\), and \(v_t = W^{(v)}a_t^{(h)}\) using learned weight matrices.
  62. What is causal masking in attention and why is it used?Scores for future tokens \(t > s\) are set to \(-\infty\) so that \(e^{-\infty}=0\), preventing a position from attending to later tokens.
  63. Write the scaled attention weight formula \(\alpha_{s,t}\).\(\alpha_{s,t} = \frac{\exp((q_s\cdot k_t)/\sqrt{m})}{\sum_{t'}\exp((q_s\cdot k_{t'})/\sqrt{m})}\), with scaling factor \(1/\sqrt{m}\).
  64. How is the context vector in attention computed from attention weights?\(\text{Context}_s = \sum_t \alpha_{s,t} v_t\) — a weighted sum of Value vectors.
  65. Give the sinusoidal positional encoding formulas.\(P(k,2i)=\sin(k/n^{2i/d})\) and \(P(k,2i+1)=\cos(k/n^{2i/d})\).
  66. What does completeness mean for a search algorithm?It is guaranteed to find a solution if one exists.
  67. What does optimality mean for a search algorithm?It is guaranteed to find the minimum-cost solution path.
  68. What data structure does Breadth-First Search (BFS) use, and how does it operate?A FIFO queue: remove from the front and add to the back.
  69. When is BFS optimal?When all step costs are equal to 1.
  70. What data structure does Depth-First Search (DFS) use, and how does it operate?A LIFO stack: remove from the front and add to the front (push larger index first so the smaller index is expanded first).
  71. Is DFS complete and optimal?DFS is incomplete if D = infinity and is not optimal.
  72. What is the priority order for Uniform Cost Search (UCS / Dijkstra)?The priority queue is ordered by g(s), the exact path cost from start to s. UCS is complete and optimal for positive edge costs.
  73. What is the priority order for Best-First Greedy Search, and is it complete or optimal?It orders by h(s) alone; it is incomplete and not optimal.
  74. What is the priority order for A search and A* search?Both order by f(s) = g(s) + h(s).
  75. What is the difference between general A search and A* search?General A search with arbitrary h is complete but not optimal; A* search uses an admissible h and is both complete and optimal.
  76. What does it mean for a heuristic h to be admissible?0 <= h(s) <= h*(s) for all s, i.e., it never overestimates the true optimal cost to the goal.
  77. When does heuristic h2 dominate h1?When h1(s) <= h2(s) <= h*(s) for all s. A dominating heuristic is more informed and expands fewer or equal nodes in A*.
  78. In Minimax, what does the MAX player try to do, and what does the MIN player try to do?MAX maximizes the terminal payoff, while MIN minimizes MAX's payoff. The algorithm uses backward induction via DFS.
  79. What are the time and space complexities of Minimax?Time complexity is O(b^d) and space complexity is O(bd), matching depth-first search.
  80. How does Expectiminimax handle Chance nodes?At Chance nodes it computes the expected value over successor outcomes: the sum of each outcome's probability times its value.
  81. What do alpha and beta represent in alpha-beta pruning?Alpha is the highest lower bound MAX can guarantee along the path; beta is the lowest upper bound MIN can guarantee.
  82. When does alpha-beta pruning cut off remaining children of a node?Prune whenever alpha(s) >= beta(s).
  83. What is the effect of alpha-beta pruning with optimal move ordering?It reduces effective time complexity from O(b^d) to O(b^(d/2)) without changing the Minimax value.
  84. What is a best response in a normal-form game?Action a_i is a best response to opponent profile a_-i if it yields at least as high a payoff as any alternative action against that profile.
  85. When is a strategy strictly dominated?A strategy is strictly dominated if another strategy yields a strictly higher payoff for every possible action of the opponents.
  86. What is IESDS (Iterated Elimination of Strictly Dominated Strategies)?It repeatedly deletes strictly dominated rows and columns to narrow down rationalizable strategies.
  87. What condition defines a Nash Equilibrium in a strategy profile?Both players are simultaneously playing best responses to each other, so no player can profitably deviate unilaterally.
  88. Why is (Defect, Defect) the unique Nash equilibrium in the Prisoner's Dilemma despite mutual cooperation being better?Defect is a strictly dominant strategy for both players, so each defects regardless of the other's choice, even though (C, C) gives both higher payoff.
  89. What does Nash's Theorem (1950) guarantee for finite games?Every finite game has at least one Nash equilibrium, possibly in mixed strategies.
  90. What is the indifference principle for mixed-strategy Nash equilibria?If a player mixes over several actions with positive probability, the opponent's strategy must make that player receive the exact same expected payoff from each supported action, and no higher payoff from unused actions.
  91. How does the epsilon-first strategy balance exploration and exploitation?It explores uniformly for epsilon*T rounds, then exploits the arm with the highest empirical mean for the remaining (1-epsilon)*T rounds.
  92. How does epsilon-greedy choose actions each round?With probability 1-epsilon it plays the arm with the highest empirical mean; with probability epsilon it plays a random arm.
  93. What does UCB1 select at each round?The arm maximizing the empirical mean plus a Hoeffding confidence bonus c*sqrt(2 ln t / n_k), embodying optimism in the face of uncertainty.
  94. Why does EXP3 use stochastic arm selection against an adversary?Against an adversarial reward setter any deterministic policy fails, so EXP3 maintains exponential weights and samples arms stochastically.
  95. What components define a Markov Decision Process?States S, actions A, Markov transition probabilities P(s'|s,a), rewards r, and a discount factor beta in [0,1).
  96. State the Bellman optimality equation for Q*(s,a).Q*(s,a) = E[r_t | s,a] + beta * sum over s' of P(s'|s,a) * max over a' of Q*(s',a').
  97. State the Bellman optimality equation relating V* and Q*.V*(s) = max over a of Q*(s,a).
  98. Write the tabular Q-learning update rule.Qhat(s_t,a_t) <- (1-alpha)Qhat(s_t,a_t) + alpha*(r_t + beta * max over a' of Qhat(s_{t+1},a')).
  99. Why does a DQN use a linear output layer of size |A| with no softmax?Because Q-values are arbitrary estimates that do not need to sum to 1, unlike probabilities.
  100. What are the two stabilizers required for DQN training?A target network (periodically synced frozen Q') for bootstrap targets, and an experience replay buffer for decorrelated mini-batches.
  101. Why does DQN need a target network?It computes bootstrap targets with a periodically synced frozen network so the training labels do not shift every step.
  102. Why does DQN use an experience replay buffer?It stores past transitions and samples decorrelated mini-batches to stabilize training.
  103. Why does a policy-gradient network use a softmax output layer?To parameterize a stochastic policy, which is essential when optimal policies are mixed or stochastic, as in multi-agent games.
  104. State the Policy Gradient Theorem.Gradient of V(w) equals the expectation of Q^pi(s,a) times the gradient of log pihat(a|s;w).
  105. What is a Markov (Stochastic) Game and how is it defined?A multi-agent model defined by \((I, S, A = \prod_{i \in I} A_i, R_i, P)\), where \(I\) is the set of agents, \(S\) states, \(A_i\) each agent's actions, \(R_i\) rewards, and \(P\) the transition function.
  106. Why are MARL environments non-stationary from a single agent's perspective?Because other agents are simultaneously learning and changing their policies, so the environment's transition and reward dynamics appear to shift over time for any one agent.
  107. What is the Markov Perfect Equilibrium (MPE) value iteration update?It replaces the \(\max_a\) operator in Bellman's equation with the stage-game equilibrium operator: \(Q_i(s,a) = R_i(s,a) + \beta \sum_{s'} P(s'|s,a) V_i(s')\), with \(V_i(s) = \text{NE}_i(Q(s,\cdot))\).
  108. In two-player zero-sum Markov games, what does Minimax-\(Q\) converge to and how can it be solved?The stage-game value \(\text{NE}(Q(s,\cdot))\) is unique, and Minimax-\(Q\) converges to a Markov Perfect Equilibrium; it can be solved via Linear Programming.
  109. What is the computational difficulty of Nash-\(Q\) in general-sum Markov games?Nash-\(Q\) is computationally intractable (PPAD-hard) and requires restrictive assumptions to converge.
  110. How can Correlated Equilibrium (CE) and Coarse Correlated Equilibrium (CCE) be computed in general-sum Markov games?They can be solved via Linear Programming.
  111. What is the Advantage function used in A2C/PPO?\(A(s_t, a_t) = r_t + \beta \hat{V}(s_{t+1}) - \hat{V}(s_t)\), which subtracts a learned value baseline \(\hat{V}(s_t)\) from the return estimate.
  112. What distinguishes MARL from single-agent MDPs regarding equilibria?MARL environments have multiple equilibria with different values, whereas single-agent MDPs have a single optimal value function.
  113. What operator replaces \(\max_a\) in the Bellman equation for Markov Perfect Equilibrium value iteration?The stage-game equilibrium operator \(\text{NE}_i(Q(s,\cdot))\).
  114. In Minimax-\(Q\), why is the stage-game value unique in two-player zero-sum games?Because zero-sum games have a unique minimax value at each state, so \(\text{NE}(Q(s,\cdot))\) is well-defined and unique.
  115. What is the key convergence difference between Minimax-\(Q\) and Nash-\(Q\)?Minimax-\(Q\) converges to an MPE in two-player zero-sum games, while Nash-\(Q\) in general-sum games is PPAD-hard and needs restrictive assumptions to converge.
  116. What is the margin formula for an SVM in terms of the weight vector?Margin = 2 / ||w||_2. Maximizing the margin is equivalent to minimizing ||w||_2.
  117. In the SVM objective, how are labels y_i transformed into y'_i?y'_i = 2y_i - 1, mapping labels into {-1, +1}.
  118. Which feature does ID3 choose to split on?The feature with the maximum information gain I(Y; X).
  119. What is the formula for entropy H(Y) in ID3?H(Y) = -Σ_{y=1}^{K} p_y log_2 p_y.
  120. How many trainable parameters do pooling layers have in a CNN?Zero. Pooling layers have no trainable parameters.
  121. What does the causal mask do in scaled dot-product attention?It sets future entries (s < t) to -∞ before the softmax, preventing attention to future positions.
  122. Write the scaled dot-product attention formula.Attention(Q, K, V) = softmax(QK^T / √m + M_mask) V.
  123. What are the time and space complexities of BFS?Time T = Σ_{k=0}^{d} b^k; Space S = b^{d+1}.
  124. What are the time and space complexities of DFS?Time T = 1 + Σ_{k=D-d+1}^{D} b^k; Space S = (b-1)D + 1.
  125. Which evaluation function does each of UCS, Greedy, and A* use?UCS uses g(s); Greedy uses h(s); A* uses g(s) + h(s) with 0 ≤ h ≤ h*.
  126. State the UCB1 action selection rule for multi-armed bandits.a_t = argmax_k (μ̂_k + c√(2 ln t / n_k)), balancing exploitation μ̂_k and an uncertainty bonus.
  127. What is the Bellman optimality equation for Q*?Q*(s,a) = R(s,a) + β Σ_{s'} P(s'|s,a) max_{a'} Q*(s',a').
  128. Write the policy gradient update expression.∇_w V = E[Q^π ∇_w log π(a|s; w)].
  129. What is the A2C loss function?L_A2C = -(r_t + β V̂(s_{t+1}) - V̂(s_t)) log π(a_t|s_t).
  130. What output activation does a policy network use versus a DQN?Policy network uses Softmax output; DQN uses a Linear output.
  131. What optimization method does PEGASOS use to update the SVM objective?PEGASOS updates via subgradients.

Velocer est gratuit : répétition espacée et vos propres cartes à partir de n'importe quel document.

PDF to flashcards · Lecture to flashcards · Practice exam · Syllabus study plan · Anki import

Plus de paquets de University of Wisconsin–Madison