MACHINE LEARNING

106403
Back to MACHINE LEARNING

Module 5: Probabilistic & Reinforcement Methods

  1. Q3a. Define how Bayesian networks and Markov random fields are used to represent probability distributions, and briefly describe the trade-offs involved in choosing one versus the other.20227m

    Module 5: Probabilistic & Reinforcement Methods

    Define how Bayesian networks and Markov random fields are used to represent probability distributions, and briefly describe the trade-offs involved in choosing one versus the other.

    View this question on its own page →
    Worked Solution

    Bayesian Networks (BN) vs Markov Random Fields (MRF):

    Both are Probabilistic Graphical Models representing joint distribution p(x1..xn)p(x_1..x_n) via graph factorization.

    Bayesian Networks — Directed Acyclic Graph (DAG):

    • Nodes = random variables, directed edges = direct dependencies (parent → child = causal).
    • Factorization: p(x)=∏ip(xi∣Pa(xi))p(x)=\prod_{i} p(x_i | Pa(x_i)) (chain rule with conditional independence via d-separation).
    • Need Conditional Probability Tables (CPTs) for discrete nodes.
    • Represents causal / asymmetric dependencies, natural for generative processes (e.g., disease → symptom).
    • Inference: exact (variable elimination, junction tree) NP-hard; approx MCMC.
    • Learning: DAG structure learning NP-hard, parameter learning via MLE.

    Markov Random Fields — Undirected Graph:

    • Nodes linked by undirected edges, factorization over cliques via potentials ψC(xC)\psi_C(x_C): p(x)=1Z∏CψC(xC)p(x)=\frac1Z \prod_{C} \psi_C(x_C) where Z=∑x∏CψCZ=\sum_x \prod_C \psi_C (partition function, global normalization).
    • Represents symmetric / non-causal correlations, spatial interactions (e.g., pixels in image — neighboring pixels similar, Ising model).
    • Conditional independence via graph separation.
    • No CPTs, more flexible for cyclic dependencies.

    Trade-offs:

    Aspect BN MRF
    Edge meaning Causal, directed Correlation, undirected
    Normalization Local (each CPT sums to 1) Global ZZ — expensive
    Cycles Cannot handle directed cycles Handles cycles naturally
    Interpretability High (causal) Lower
    Learning complexity Structure NP-hard but local norm easy Potential learning hard, ZZ intractable
    Inference Slightly cheaper if DAG sparse Often costlier due to ZZ
    Use cases Diagnosis, causal reasoning, time series (DBN) Image segmentation, stereo, spatial stats

    Choosing: Use BN when direction/causality known, need generative sampling, DAG natural. Use MRF when dependencies symmetric, lattice-like, or cyclic correlations (images, social networks). Many distributions can be represented by either with transformations (moralization), but efficiency differs.

  2. Q8a. Write short notes on Probably Approximately Correct (PAC) learning model.20237m

    Module 5: Probabilistic & Reinforcement Methods

    Write short notes on Probably Approximately Correct (PAC) learning model.

    View this question on its own page →
    Worked Solution

    Probably Approximately Correct (PAC) Learning Model (Valiant 1984):

    Framework to analyze learnability: when can learner, with high probability, find approximately correct hypothesis with polynomial sample/computation?

    Setup: Instance space XX, concept class CC, hypothesis space HH, distribution DD over XX, target c∈Cc\in C, training set S∼DmS\sim D^m labeled by cc.

    Learner outputs h∈Hh\in H.

    Definition: CC is PAC-learnable if exists algorithm LL and polynomial poly(1/ϵ,1/δ,n,size(c))poly(1/\epsilon,1/\delta,n,size(c)) such that for any ϵ,δ∈(0,1)\epsilon,\delta\in(0,1), any DD, any c∈Cc\in C, given m≥poly(...)m\ge poly(...) examples, LL outputs hh with P(ErrorD(h)≤ϵ)≥1−δP(Error_D(h)\le \epsilon) \ge 1-\delta.

    Error: $Error_D(h)=P_{x\sim D}[h(x)
    eq c(x)]$, training error zero for consistent learner.

    ϵ\epsilon: Accuracy parameter (approximately correct, error ≤ϵ\epsilon). δ\delta: Confidence (probably, with probability 1-δ\delta).

    Sample complexity bounds:
    For finite ∣H∣|H|: m≥1ϵ(ln⁡∣H∣+ln⁡1/δ)m \ge \frac1\epsilon(\ln|H| + \ln1/\delta) sufficient for consistent learner (if realizable). Using Hoeffding: P(∃h∈H:Errortrain=0butErrortrue>ϵ)≤∣H∣e−ϵmP(\exists h\in H: Error_{train}=0 but Error_{true}>\epsilon) \le |H|e^{-\epsilon m}.

    For infinite HH, VC-dimension d=VC(H)d=VC(H): m=O(1ϵ(dlog⁡1/ϵ+log⁡1/δ))m = O(\frac1\epsilon(d\log1/\epsilon +\log1/\delta)) (agnostic: m=O(1ϵ2(d+log⁡1/δ))m=O(\frac1{\epsilon^2}(d+\log1/\delta))).

    Examples:

    • Conjunctions of nn literals: PAC-learnable with m=O(1ϵ(nlog⁡n+log⁡1/δ))m=O(\frac1\epsilon(n\log n +\log1/\delta))
    • Axis-aligned rectangles in R2\mathbb{R}^2 PAC-learnable, VC=4VC=4.
    • Parity not efficiently PAC-learnable.

    Agnostic PAC: $c
    otin Hornoise,learnerfinds or noise, learner finds hwitherror≤ with error ≤ \min_{h\in H}Error_D(h)+\epsilon$.

    Implications: PAC gives theoretical guarantee linking sample size, hypothesis complexity (∣H∣|H| or VC), accuracy and confidence. Guides Occam's razor: simpler HH needs fewer samples.

    Limitations: Distribution-free worst-case, often loose bounds, assumes i.i.d.

  3. Q9b. Write short notes on the following: (b) Reinforcement learning20227m

    Module 5: Probabilistic & Reinforcement Methods

    Write short notes on the following:
    (b) Reinforcement learning

    View this question on its own page →
    Worked Solution

    (b) Reinforcement Learning:

    Definition: Paradigm where agent learns optimal policy π∗:S→A\pi^*:S\to A by interacting with environment and maximizing cumulative reward, not from labeled examples but from delayed reward signal.

    Components: Agent, Environment, State ss, Action aa, Reward rr, Policy π\pi, Value Vπ,QπV^\pi, Q^\pi, Model p(s′∣s,a)p(s'|s,a), discount γ\gamma.

    Types:

    • Model-free: No explicit model; directly learn V/Q/πV/Q/\pi. Value-based (Q-learning Q(s,a)←Q+α[r+γmax⁡Q(s′,a′)−Q]Q(s,a)\leftarrow Q+\alpha[r+\gamma\max Q(s',a')-Q]), Policy-based (REINFORCE $
      abla J=E[
      abla\log\pi(a|s) Q]$), Actor-Critic.
    • Model-based: Learn/know p(s′∣s,a)p(s'|s,a), plan via DP (Value Iteration, MCTS in AlphaGo).
    • On-policy (SARSA) learns about π\pi being followed; off-policy (Q-learning) learns about optimal π\pi from any behavior.

    Exploration-Exploitation: ϵ\epsilon-greedy, UCB, Thompson, entropy regularization.

    Algorithms: Q-learning, SARSA, DQN (deep QQ with replay + target network), Policy Gradient, PPO, A3C.

    Challenges: Credit assignment (delayed reward), exploration, instability, sample inefficiency.

    Applications: Game playing (AlphaGo, Atari DQN), robotics control, autonomous driving, recommender systems (long-term engagement), finance trading.

    Example: Grid maze: states = cells, actions = up/down/left/right, reward +10 goal, -1 wall, agent via Q-learning propagates values back from goal to learn shortest path.

    Differences vs supervised: No correct output provided, only reward; sequential, action affects next state (non-i.i.d).

    Rewards shape behavior; reward engineering crucial.