PCCMT503 · MOD 4 Unsupervised Models, Apps & Embeddings
0 / 8 Mastered

Module 4 — Unsupervised Deep Learning Models, Applications & Word Embeddings

Official Syllabus (PCCMT503): AutoEncoders (Undercomplete, Sparse, Deep, Contractive, Denoising, Convolutional, Variational AE), Boltzmann Machines (Restricted Boltzmann Machines, Deep Belief Networks, Deep Boltzmann Machines), Applications (Speech Processing, Computer Vision, NLP), Word Embedding Techniques (TF-IDF, Word2Vec, GloVe).

Merged Sources: DL MODULE 4 FINAL.pdf (49p), DL Module4 Autoencoders Notes.docx, MODULE 4.pdf (28p, AE only), M 4.1.pdf (102 slides), M 4.2.pdf (36 slides).

Filter:

4.1 AutoEncoders (AE): Concept, Architecture & AE vs. PCA

🔥 HIGH YIELD 3M · 6M Sources: DL MODULE 4 FINAL, M 4.1.pdf, .docx
Simple Intuition (ELI5): The Sketch Artist & Rebuilder Imagine squeezing a detailed 784-pixel handwritten digit down into just 32 compact numbers (Encoder → Bottleneck Code), throwing away the original picture, and forcing another network (Decoder) to redraw the digit from those 32 numbers alone! Because space is tight, the network is forced to discover the true essential structure of digits without a single human label!

1. Architecture, Equations & Properties

  • Definition: An unsupervised (self-supervised) feedforward neural network trained to reconstruct its own input x as x̂ (or r) through a compressed internal latent representation h (or z).
  • Three Components:
    1. Encoder (h = fθ(x)): Compresses high-dimensional input x into code h (e.g., 784 → 32 = 24.5× compression; or 100×100 (10,000) → 100 = 100× compression).
    2. Bottleneck / Latent Space (h / z): Compact feature summary storing salient patterns.
    3. Decoder (x̂ = gφ(h)): Symmetrical mirror network reconstructing x̂ = g(f(x)).
  • Reconstruction Losses: MSE (1/N) ∑(xi − x̂i)² (continuous inputs) or Binary Cross-Entropy / BCE (normalized [0,1] inputs).
  • 3 Key Properties: (1) Data-specific (digit AE fails on faces, unlike generic JPEG/gzip), (2) Lossy, (3) Self-supervised (no external labels).
  • 4 Core Hyperparameters: Code size, number of layers (input excluded), nodes per layer (usually symmetric "sandwich"), reconstruction loss function.
STANDARD AUTOENCODER ARCHITECTURE (Hourglass / Sandwich Symmetry) xInput (784) Encoder fθ(x) Code h / z Bottleneck (32) Decoder gφ(h) x̂Reconst (784) L(x, x̂) MSE / BCE
Figure 4.1: Standard Autoencoder Hourglass Pipeline (Encoder → Bottleneck Code → Decoder → Loss)

2. Autoencoder vs. PCA

PropertyPCA (Principal Component Analysis)Autoencoder (AE)
TransformationStrictly linear projections (orthogonal eigenvectors)Non-linear activations (ReLU/Sigmoid/tanh) & multi-layer stacks
RelationExam Key Fact: A single linear-decoder undercomplete AE trained with MSE learns to span the exact same subspace as PCA!
Complex ManifoldsCannot capture curved/non-linear data structuresLearns curved manifolds, images (ConvAE), and distributions (VAE)

4.2 All 7 Types of Autoencoders (Formulas, Mechanisms & VAE)

🔥 TOP MODULE 4 QUESTION 6M · 9M Sources: DL MOD 4 FINAL, M 4.1.pdf, MOD 4.pdf

Central Problem Solved by All AE Variants: If an autoencoder has too much capacity, it simply learns the useless identity function g(f(x)) = x (memorization). Each of the 7 AE types restricts copying in a distinct way:

# & AE TypeConstraint / Loss FormulaHow Identity Copying Is Prevented & Uses
1. Undercomplete AEL(x, g(f(x))) with dim(h) < dim(x)Information capacity bottleneck forces learning salient structure. (Can overfit if encoder/decoder are huge on tiny datasets.)
2. Sparse AEL(x, g(f(x))) + Ω(h)
• L1: λ ∑ |hᵢ| (Laplace prior)
• KL: ∑ [ρ log(ρ/ρ̂ⱼ) + (1−ρ)log((1−ρ)/(1−ρ̂ⱼ))]
Allows overcomplete codes (dim(h) ≥ dim(x)) while forcing most hidden neurons near 0 (e.g. target sparsity ρ = 0.05). Learns interpretable part detectors!
3. Deep AEStacked encoder/decoder layers (e.g. 784→512→256→64→256→512→784)Hierarchical non-linear compression (MNIST → 30D). Historically RBM greedy pretrained; now end-to-end with ReLU/BatchNorm.
4. Contractive AE (CAE)L(x, g(f(x))) + λ ||Jf(x)||F²
where ||J||F² = ∑i ||∇x hi||² = ∑i,j (∂hi/∂xj)²
Jacobian Frobenius norm penalizes changes in h for small changes in x (Δh ≈ J Δx) → locally invariant manifold features!
5. Denoising AE (DAE)Corrupt input x → x̃ via C(x̃ | x);
Minimize L(x, g(f(x̃))) vs clean x
Input differs from target! Forced to learn true data distribution to strip Gaussian/masking/salt-and-pepper noise (used for robust pretraining & denoising).
6. Convolutional AEConv + Pool Encoder (`28×28→14×14→7×7→h=10`) + Reshape & Transposed Conv ("Deconv") DecoderPreserves 2D spatial neighborhoods with shared filter weights instead of flattening huge images (128×128×3 = 49,152 inputs).
7. Variational AE (VAE)Probabilistic encoder outputs (μ, σ²); Reparameterization z = μ + σ ⊙ ε (ε~N(0,I));
ELBO Loss: L(x, x̂) + DKL(q(z|x) ‖ N(0,I))
Forces smooth, continuous Gaussian latent space so random sampling z ~ N(0, I) + Decoder generates brand-new realistic samples!
VARIATIONAL AUTOENCODER (VAE): REPARAMETERIZATION TRICK (z = μ + σ ⊙ ε) & ELBO LOSS Input x Encoderqφ(z | x) Mean μ Std Dev σ ε ~ N(0, I) Sample zz = μ + σ ⊙ ε Decoderpθ(x | z) Output x̂Recon + D_KL Loss
Figure 4.2: Variational Autoencoder (VAE) Moving Randomness Outside Backprop via Reparameterization Trick

4.3 Boltzmann Machines (Energy Model + Worked 2-Unit Numerical)

🔥 HIGH YIELD 🧮 FULL 2-UNIT BM NUMERICAL 6M · 9M Sources: DL MOD 4 FINAL, M 4.2.pdf
Simple Intuition (ELI5): Marble Settling into Energy Valleys Think of a Boltzmann Machine like a sculpted landscape of hills and valleys. Valid training data (like real digit images) sit in deep low-energy valleys with high probability, while nonsense patterns sit on high peaks (low probability). Learning pushes training states' valleys deeper and raises false hallucinated states!

1. General Boltzmann Machine Structure & Energy Equations

  • Stochastic, symmetric, undirected energy-based generative network (Hinton & Sejnowski) using binary states {0, 1} across Visible units (v) and Hidden units (h).
  • Every unit connects symmetrically to every other unit (wij = wji, no self-loops), including intra-layer visible–visible (L), hidden–hidden (J), and inter-layer visible–hidden (W) links.
Energy Function:   E(v, h, θ) = −12 vTLv − 12 hTJh − vTWh   (− biases bTv − cTh)
Boltzmann Joint Probability:   P(v, h) = e−E(v,h,θ)Zθ,    where Partition Function Zθ = ∑v,h e−E(v,h,θ)
Learning Rule:   Δwij = η (⟨sisj⟩data − ⟨sisj⟩model)   (Positive Data phase − Negative Model/Dream phase)

Crucial Limitation of General BM: Computing the partition function Zθ sums over all 2(V+H) configurations and full intra-layer couplings block fast sampling — intractable for large networks! That directly motivates RBMs.

2. Boltzmann Machine vs. Ordinary Feedforward DNN (M 4.2.pdf Slide 3)

Ordinary Feedforward Neural NetworkBoltzmann Machine (Generative)
Learns a deterministic mapping x → yLearns a probability distribution P(v, h) over data
Discriminative: Classification & regressionGenerative: Can sample & generate new configurations
Information flows strictly forward in directed layersUses undirected symmetric connections + Energy function
Worked Numerical (M 4.2.pdf pp. 4–11): 2-Unit Boltzmann Machine Update

Given: Two binary visible units x = [x₁, x₂]T ∈ {0, 1}², zero biases, symmetric weight matrix U = [[0, w], [w, 0]] so energy is E(x) = −xT U x = −2 w x₁ x₂. Training sample x = [1, 1]T, initial w = 0, learning rate η = 0.1.

  1. Initial State (w = 0): All 4 binary states (0,0), (0,1), (1,0), (1,1) have E = 0 ⇒ e⁰ = 1 each ⇒ Partition Z = 4 ⇒ P(x) = 1/4 = 0.25 for every state.
  2. Iteration 1 Weight Update (for training target [1,1]):
    • Data correlation: ⟨x₁x₂⟩data = 1×1 = 1;   Model expectation: ⟨x₁x₂⟩model = 1·P(1,1) = 0.25.
    • Gradient factor (from −∂E/∂w = 2 x₁x₂): Δw = 0.1 × 2(1 − 0.25) = 0.15 ⇒ wnew = 0 + 0.15 = 0.15.
  3. Updated Probabilities (w = 0.15):
    • Energy of (1,1) drops to E(1,1) = −2(0.15)(1)(1) = −0.3; other 3 states stay E = 0.
    • New Partition: Z = e⁰ + e⁰ + e⁰ + e0.3 = 3 + 1.350 = 4.350.
    • New Probability of training sample: P(1,1) = 1.350 / 4.350 = 0.310 (jumped from 25% → 31%!).
  4. Iteration 2: Δw = 0.1 × 2(1 − 0.310) = 0.138 ⇒ w2 = 0.15 + 0.138 = 0.288.

4.4 Types of Boltzmann Machines: RBM, DBN & DBM

🔥 GUARANTEED PART B COMPARISON 3M · 6M · 9M Sources: DL MOD 4 FINAL, M 4.2.pdf, .docx
1. Boltzmann Machine h₁ h₂ v₁ v₂ All-to-All (Intra-links!) 2. Restricted BM (RBM) h₁ h₂ v₁ v₂ Bipartite: No intra-links! 3. Deep Belief Net (DBN) Top RBM + Lower ↓ Directed 4. Deep Boltzmann (DBM) ALL Layers Undirected ↔
Figure 4.3: Connectivity Architecture of Boltzmann Machine, RBM, DBN (Hybrid), and DBM
ModelConnections & Graph TypeTraining MethodPros / Uses
RBM2 layers (v, h), bipartite undirected; NO intra-layer connections (L=0, J=0)Contrastive Divergence (CD-k):
Δwij ∝ ⟨vihj⟩data − ⟨vihj⟩recon
Conditional independence makes sampling fast; feature extraction, recommendation systems (Netflix), building block for DBNs.
DBN
(Hinton, 2006)
Stacked multi-layer Hybrid: top 2 layers = undirected RBM; lower layers = directed top-down(1) Greedy layer-wise CD pretraining + (2) Backprop or Wake-Sleep algorithm fine-tuningFast top-down sampling; layer-wise representation learning & generative modeling.
DBMMulti-layer fully undirected between adjacent layers; no intra-layer linksGreedy RBM pretraining + Gibbs sampling / CD + SGD joint fine-tuningBidirectional top-down & bottom-up ambiguity resolution; slow/costly inference.

RBM Contrastive Divergence & DBN Pretraining Steps (M 4.2.pdf Slides 17–36)

5-Step RBM Learning Cycle (CD)

  1. Present training example to Visible units vi.
  2. Compute hidden activation probabilities hj.
  3. Reconstruct visible units back from hj.
  4. Update weights via Δwij ∝ ⟨vihj⟩data − ⟨vihj⟩reconstruction.
  5. Repeat across iterations/mini-batches.

5-Step DBN Layer-Wise Pretraining & Sampling

  1. Train RBM-1 directly on raw input data (e.g. digit 8 pixels → edges/curves).
  2. Feed RBM-1 hidden activations as visible input to RBM-2 (curves/shapes).
  3. Repeat greedy stacking up to top RBM (full digit structure).
  4. Fine-tune: add output layer + labeled Backprop (or generative Wake-Sleep).
  5. Generate: Gibbs sample top undirected pair → propagate top-down through directed layers. (Limitation: exact inference is intractable.)

4.5 Applications of Deep Learning (Speech, Computer Vision, NLP)

⭐ HIGHLY TESTED SHORT/ESSAY TOPIC 3M · 6M Sources: DL MODULE 4 FINAL.pdf, .docx

1. Speech Processing

  • Automatic Speech Recognition (ASR): Spoken audio → text via CNNs, RNNs, LSTMs (Siri, Google Assistant, Alexa).
  • Text-to-Speech (TTS) & Synthesis: Natural human-like speech generation (DeepMind WaveNet).
  • Speaker ID & Verification: Voice biometrics from acoustic spectrograms.
  • Speech Enhancement & Denoising: Separating speech from background noise (Denoising AE / RNNs).

2. Computer Vision (CV)

  • Image Classification: Medical imaging (X-ray/MRI tumor classification), ResNet/Inception backbones.
  • Object Detection: Real-time bounding boxes & classes via YOLO, SSD in autonomous driving & surveillance.
  • Image Segmentation: Pixel-level semantic & instance boundaries (U-Net, medical organs, self-driving lanes).
  • Facial Recognition & Generation: Security authentication, GANs/VAEs/Diffusion, neural style transfer.

3. Natural Language Processing

  • Machine Translation: Encoder–Decoder LSTM & Transformers (Google Translate).
  • Sentiment Analysis: Classifying reviews, tweets, and customer feedback polarity.
  • Named Entity Recognition (NER) & Tagging: BiRNN/BiLSTM identifying persons, locations, orgs.
  • Summarization, QA & Chatbots: Abstractive document condensing & conversational AI.

4.6 Word Embeddings Overview & TF-IDF (+ All 7 Worked Numericals)

🔥 GUARANTEED NUMERICALS 🧮 ALL 4 CORPORA WORKED 3M · 6M · 9M Sources: DL MODULE 4 FINAL.pdf, .docx

Why Embeddings? One-hot & Bag-of-Words vectors have huge dimension |V| (vocabulary size), are mostly zeros (sparse), and treat every word pair as orthogonal (zero similarity between cat and dog). Word embeddings map words into compact dense continuous vectors (50–300 dims) capturing semantic similarity.

1. Three-Way Comparison: TF-IDF vs. Word2Vec vs. GloVe

PropertyTF-IDFWord2VecGloVe
Core IdeaTerm frequency vs rarity across docsShallow 2-layer NN context predictionGlobal corpus co-occurrence matrix factorization
Vector TypeSparse (size |V| or N)Dense (100–300 dims)Dense (50–300 dims)
Semantic Similarity?No (statistical importance only)Yes (king−man+woman ≈ queen)Yes
Variants / ObjectiveTF × IDFCBOW & Skip-gram (local windows)Weighted least squares J using log Xij

2. TF-IDF Formulas

TF(t, d) = count of t in dtotal terms in d,    IDF(t, D) = log(NDF(t)),    TF-IDF(t, d, D) = TF(t, d) × IDF(t, D)
Smoothed / Sublinear variants (.docx):   IDFsmooth = log(1 + N1 + df) + 1,    TFsub = 1 + log(tf)

3. Complete Worked TF-IDF Numericals (From Source Notes & Exam Problems)

Numerical Set 4.6A (Corpus A — Cat/Dog/Pets, N = 3 Docs)

Documents: D₁ = "The cat sat on the mat." (6 words), D₂ = "The dog played in the park." (6 words), D₃ = "Cats and dogs are great pets." (6 words).

  1. Term "cat" in D₁: TF = 1/6 = 0.1667.
    • Exact match (`FINAL.pdf` p. 28): DF("cat") = 1 (ignoring `"Cats"`) ⇒ IDF = log₁₀(3/1) = 0.4771 ⇒ TF-IDF = 0.1667 × 0.4771 = 0.0795.
    • Stemmed match (`.docx`): treating `"Cats"` as `"cat"` gives DF = 2 ⇒ IDF = log₁₀(3/2) = 0.1761 ⇒ TF-IDF = 0.1667 × 0.1761 = 0.029.
  2. Term "the" in D₁: TF = 2/6 = 0.3333, DF = 2 ⇒ IDF = log₁₀(3/2) = 0.1761 ⇒ 0.0587.
  3. Term "dog" in D₂ & "pets" in D₃: Exact match TF = 1/6, DF = 1, IDF = log₁₀(3) = 0.4771 ⇒ 0.0795 (note p. 30 prints 0.471 typo for 0.4771).
Numerical 4.6B (Problem 5 — "AI" in D₁, N = 10 Docs) + Log Base Alert

Given: Term "AI" appears 4 times in Document D₁ (total terms = 20). Across N = 10 documents, DF("AI") = 2.

  1. TF = 4 / 20 = 0.2.
  2. Base-10 Log (exact solved sheet output): IDF = log₁₀(10/2) = log₁₀(5) = 0.6990 ⇒ TF-IDF = 0.2 × 0.6990 = 0.1398.
  3. Log-base discrepancy warning: The text prompt asks for "natural-log IDF" while calculating with log₁₀(5) = 0.6990! With true natural log ln(5) = 1.6094, TF-IDF = 0.2 × 1.6094 = 0.3219 — always state the log base explicitly!
Numerical 4.6C (Problem 6 — Query Ranking for "Data Scientists", N = 3 Docs)

Corpus: D₁ = "Ben studies about Data in Computer Lab." (7 terms), D₂ = "Steve teaches at Brown University." (5 terms), D₃ = "Data Scientists work on large datasets." (6 terms).

  1. IDFs: IDF("Data") = log₁₀(3/2) = 0.1761 (in D₁, D₃);   IDF("Scientists") = log₁₀(3/1) = 0.4771 (only D₃).
  2. Doc scores for Query "Data Scientists":
    • D₁: (1/7)×0.1761 + 0 = 0.143 × 0.1761 = 0.025
    • D₂: 0 + 0 = 0
    • D₃: (1/6)×0.1761 + (1/6)×0.4771 = 0.029 + 0.080 = 0.109 (Most Relevant!)
Numerical 4.6D (Corpus B from .docx — Deep Learning Docs, N = 3)

D₁ = "I love deep learning" (4), D₂ = "I love machine learning" (4), D₃ = "deep learning needs data" (4).

  • In D₁ (TF = 1/4 = 0.25): words I, love, deep have df = 2 ⇒ 0.25 × log₁₀(3/2) = 0.25 × 0.176 = 0.044.
  • Word "learning" appears in all 3 docs (df = 3) ⇒ IDF = log₁₀(3/3) = 0 (stop-like term gets 0 weight!).
  • Word "machine" in D₂ (df = 1) ⇒ 0.25 × log₁₀(3) = 0.25 × 0.477 = 0.119.

4.7 Word2Vec (CBOW & Skip-Gram + Worked CBOW Numerical)

🔥 HIGH YIELD 🧮 CBOW VECTOR AVERAGE + SKIP-GRAM PAIRS 6M · 9M Source: DL MODULE 4 FINAL.pdf pp. 35–45

Model (Mikolov et al., 2013): Shallow 2-layer neural network (One-hot V → Linear Projection d → Softmax V) whose learned input weight matrix W ∈ ℝV×d serves as the dense word embedding lookup table.

A. CBOW: Context Words → Target Center Word wₜ₋₂ (“quick”) wₜ₋₁ (“brown”) wₜ₊₁ (“jumps”) wₜ₊₂ (“over”) Sum / Avgh̄ = [2, 2] “fox” (wₜ) B. SKIP-GRAM: Target Center Word → Context Words “fox” (wₜ) Projectionv(“fox”) P(wₜ₋₂ | fox) P(wₜ₋₁ | fox) P(wₜ₊₁ | fox) P(wₜ₊₂ | fox)
Figure 4.4: Word2Vec CBOW (Context → Target) vs. Skip-Gram (Target → Context)
Worked Example (DL MODULE 4 FINAL.pdf pp. 36–45): "The quick brown fox jumps over the lazy dog"

Window = 2, Target Word = "fox", Context = {"quick", "brown", "jumps", "over"}:

  • CBOW Vector Averaging: Given context vectors vquick=[1,2], vbrown=[2,1], vjumps=[3,2], vover=[2,3]:
    h̄ = (1/4) ([1,2] + [2,1] + [3,2] + [2,3]) = [8, 8] / 4 = [2, 2] → projected through output matrix W′ + Softmax P(w|C) = ez_w / ∑ ez_j.
  • Skip-Gram Training Pairs (Target "fox"): Generates 4 pairs: (fox, quick), (fox, brown), (fox, jumps), (fox, over). Faster = CBOW (better frequent words); Better for rare words = Skip-gram!

4.8 GloVe (Global Vectors + Worked Co-Occurrence Matrix)

🔥 HIGH YIELD 🧮 CO-OCCURRENCE MATRIX EXAMPLE 3M · 6M Source: DL MODULE 4 FINAL.pdf pp. 46–49

GloVe (Pennington et al., Stanford, 2014): Captures the best of both worlds by combining global corpus co-occurrence counts (like matrix factorization) with local context window predictive geometry (like Word2Vec). Key insight: ratios of co-occurrence probabilities P(k | ice) / P(k | steam) isolate semantic meaning (large for solid, small for gas, ~1 for water).

Weighted Least-Squares Objective:   J = ∑i,j=1..V f(Xij) · (wiT w̃j + bi + b̃j − log Xij)²
Weighting Function:   f(x) = { (x / xmax)α if x < xmax, else 1 }   (typically xmax = 100, α = 0.75; sets f(0) = 0 so zero entries are skipped and frequent stop words don't dominate)
Worked Illustrative Example (DL MODULE 4 FINAL.pdf pp. 47–48)

Corpus: "The cat drinks milk. The dog drinks milk." (Focused tokens: cat, dog, drinks, milk).

Co-occ Matrix Xcatdogdrinksmilk
cat0011
dog0011
drinks1102
milk1120
WordLearned Dim 1Learned Dim 2
cat0.80.6
dog0.70.5
drinks0.20.9
milk0.30.8

Notice cat and dog share identical context co-occurrence rows with drinks (1) and milk (1), so GloVe places their learned vectors [0.8, 0.6] and [0.7, 0.5] close together!

Module 4 Revision (A–D): Checklist, Definitions & Diagrams

A. Official Syllabus Coverage Checklist

  • ✅ Autoencoders (components, MSE/BCE, properties, hyperparameters, AE vs PCA)
  • ✅ All 7 Autoencoder Types (Undercomplete, Sparse [L1/KL/Laplace], Deep, Contractive [Jacobian], Denoising, Convolutional, Variational [Reparameterization + ELBO])
  • ✅ Boltzmann Machines (energy function, partition function, positive/negative learning phases, worked 2-unit BM numerical)
  • ✅ Types of Boltzmann Machines: RBM (Contrastive Divergence), DBN (hybrid undirected top + directed bottom, greedy + Wake-Sleep/Backprop), DBM (all undirected)
  • ✅ Deep Learning Applications: Speech Processing (ASR, WaveNet TTS, Speaker ID), Computer Vision (Detection/YOLO, Segmentation), NLP (Translation, NER, QA)
  • ✅ Word Embeddings: TF-IDF (+ all 4 corpora / 7 numericals + discrepancy warnings), Word2Vec (CBOW `[2,2]` numerical & Skip-gram), GloVe (`J`, `f(x)`, co-occurrence matrix)

B. Must-Know 3-Mark Definitions

Reparameterization Trick

Expresses random latent sample z ~ N(μ, σ²) as deterministic z = μ + σ ⊙ ε with external noise ε ~ N(0, I) so gradients flow through μ and σ during VAE backpropagation.

Contrastive Divergence (CD)

Fast approximate RBM gradient method replacing infinite Gibbs sampling equilibrium with a short k-step reconstruction: Δwij ∝ ⟨vihj⟩data − ⟨vihj⟩recon.

Contractive Penalty

Adds squared Frobenius norm of Encoder Jacobian λ ||∂h/∂x||F² to reconstruction loss so hidden codes stay invariant under tiny input perturbations.

Partition Function Zθ

Normalizing denominator ∑v,h e−E(v,h) in Boltzmann Machines ensuring probabilities sum to 1; sums exponentially many states, making general BMs intractable.

Module 4 Revision (E): Master Formula & Equation Sheet

1. Sparse AE KL: ∑ [ρ log(ρ/ρ̂ⱼ) + (1−ρ)log((1−ρ)/(1−ρ̂ⱼ))]  |  Contractive AE: L + λ ∑i ||∇x hi||²
2. VAE: z = μ + σ ⊙ ε (ε~N(0,I)),    LVAE = L(x, x̂) + DKL(q(z|x) ‖ N(0,I))
3. BM Energy & Prob: E(v,h) = −½ vTLv − ½ hTJh − vTWh,    P(v,h) = e−E/Zθ,    Δw = η(⟨sisj⟩data − ⟨sisj⟩model)
4. TF-IDF: TF = count/total,   IDF = log(N/DF),   Score = TF × IDF  |  CBOW Avg: h̄ = (1/C)∑ vc
5. GloVe: J = ∑i,j f(Xij)(wiTw̃j + bi + b̃j − log Xij)²

Module 4 Revision (F): 3M / 6M / 9M Question Bank (With Answers)

Q1 [3M]: How does a Contractive Autoencoder differ from a Denoising Autoencoder?3 Marks
Show Answer

DAE injects random noise at the input (x̃) and asks the decoder to recover clean x. CAE feeds clean x and adds an explicit analytical penalty λ ||Jf(x)||F² to force the encoder derivatives to be small everywhere along local neighborhoods.

Q2 [6M]: Differentiate Restricted Boltzmann Machine (RBM), Deep Belief Network (DBN), and Deep Boltzmann Machine (DBM).6 Marks
Show Answer

Sketch Figure 4.3, explain RBM bipartite structure (no intra-links → fast conditional sampling via Contrastive Divergence), DBN hybrid structure (top 2 layers undirected RBM + lower layers directed top-down; greedy pretraining + Wake-Sleep/Backprop), and DBM (all inter-layer edges undirected).

Q3 [9M]: Compute TF-IDF of query "Data Scientists" across 3 docs and compare TF-IDF, Word2Vec (CBOW/Skip-gram), and GloVe.9 Marks
Show Answer

Part (a): Solve Numerical 4.6C showing D₁=0.025, D₂=0, D₃=0.109 (D₃ ranks #1) [4M]. Part (b): Compare TF-IDF vs Word2Vec (CBOW average `[2,2]` vs Skip-gram pairs) vs GloVe (weighted least squares on global matrix Xij) with comparison table & Figure 4.4 [5M].

Module 4 Revision (G): 10-Minute Last-Minute Cheat Sheet

  • 7 AE Tricks Against Copying: Undercomplete (small dim), Sparse (L1/KL penalty), Deep (multi-layer bottleneck), Contractive (Jacobian ||J||F²), Denoising (corrupt input → clean target), Conv (2D filters + Deconv), VAE ((μ, σ²) + Reparam z=μ+σε + ELBO).
  • BM Family: BM = all connected (intractable Z); RBM = bipartite (CD training); DBN = top RBM + directed down; DBM = all undirected.
  • Embeddings: TF-IDF = sparse importance (log₁₀(N/DF)); Word2Vec = local 2-layer NN (CBOW=ctx→word, Skipgram=word→ctx); GloVe = global co-occurrence weighted regression.

Module 4 Revision (H): KTU 2024 Pattern Module 4 Mock Exam (15 Marks)

KTU PCCMT503 — MODULE 4 MOCK TEST (15 Marks)
PART A2 × 3 = 6 Marks

1. Compare Autoencoders and PCA. Why is an Undercomplete AE with linear activations equivalent to PCA? [3M]

2. Given Term `"AI"` appears 4 times in a 20-term document out of N=10 documents where DF("AI")=2, calculate its TF-IDF score (using log₁₀ and noting ln difference). [3M]

PART B (Answer EITHER 3 OR 4)1 × 9 = 9 Marks

3. (a) Explain Variational Autoencoder (VAE) with its Reparameterization Trick and ELBO loss, plus Sparse & Contractive AE penalties. [6M]
(b) List two major Deep Learning applications each in Speech Processing, Computer Vision, and NLP. [3M]

— OR —

4. (a) Derive the Boltzmann distribution and perform 1 learning step for a 2-unit BM (w=0, η=0.1, x=[1,1], E=−2wx₁x₂) to find wnew and new P(1,1). [5M]
(b) Explain Word2Vec (CBOW & Skip-gram) and compute the CBOW hidden average vector for `"fox"` given `[1,2], [2,1], [3,2], [2,3]`. [4M]

Show Complete Mock Exam Solutions
  • Q1: Linear MSE AE spans exact same principal subspace as PCA; adding non-linear activations learns curved data manifolds.
  • Q2: TF = 4/20 = 0.2; IDF₁₀ = log₁₀(5) = 0.6990 ⇒ 0.1398 (with ln(5)=1.6094 ⇒ 0.3219).
  • Q3: (a) Draw Fig 4.2, write z=μ+σ⊙ε + ELBO + L1/KL sparse + Jacobian norm ||J||F²; (b) ASR/TTS(WaveNet), Detection(YOLO)/Segmentation, Translation/NER.
  • Q4: (a) P(1,1)init=0.25 → Δw = 0.1×2(1−0.25)=0.15 → Z=3+e0.3=4.350 → P(1,1)=0.310; (b) Draw Fig 4.4, h̄ = [8,8]/4 = [2,2].