Skip to content

feat(site): render LaTeX math via KaTeX + convert plain-text formulas#293

Open
Jayantkhandebharad wants to merge 65 commits into
rohitg00:mainfrom
Jayantkhandebharad:feat/latex-math-rendering
Open

feat(site): render LaTeX math via KaTeX + convert plain-text formulas#293
Jayantkhandebharad wants to merge 65 commits into
rohitg00:mainfrom
Jayantkhandebharad:feat/latex-math-rendering

Conversation

@Jayantkhandebharad

Copy link
Copy Markdown

Closes #158.

Math formulas across the curriculum were written as ASCII art in untagged code fences or as plain text inline, which reads poorly. The blocker was that the site had no math renderer at all — so simply writing $...$ would have shown literal dollar signs. This PR adds the renderer and converts the formulas.

1. Render LaTeX with KaTeX (site/lesson.html)

  • Pinned KaTeX 0.17.0 via CDN with SRI integrity hashes.
  • Extended the client-side markdown renderer to support inline $...$ and block $$...$$ (single- and multi-line, including \begin{aligned} and bmatrix).
  • Inline math uses the Pandoc rule (opening $ not followed by a space; closing $ not preceded by a space nor followed by a digit) so prose dollar amounts that are common in this curriculum — $50,000, $0.25/$2.50 — are never mistaken for math. Verified 0 false positives across all 503 docs.
  • Inline code and math are stashed behind sentinels before the escape/emphasis pass, so a $ inside `code` and a * inside a formula stay verbatim. Invalid or unloaded TeX degrades to the raw source rather than blanking the lesson.

2. Convert plain-text formulas (54 lessons, one commit each)

Genuine formulas were converted to $...$ / $$...$$; the math is unchanged, only the notation. Architecture diagrams, terminal sessions, code, mermaid blocks, and shape-annotation sketches were deliberately left as monospace.

The three examples from the issue now render, e.g.:

  • $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$
  • $f'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}$
  • $\nabla f = \left[ \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y}, \frac{\partial f}{\partial z} \right]$

Verification

  • 1,742 math spans (1,448 inline + 294 block) compile-checked with KaTeX throwOnError0 failures; 0 literal pipes inside table-cell math.
  • Inline/block parsing covered by unit tests of the real parser (money-safety, $-in-code, *-in-math, edge cases).
  • Live browser render confirmed for the issue examples and for converted content (aligned derivations, bmatrix, inline-in-prose, table-cell math).
  • python3 scripts/audit_lessons.py0 issues across 503 lessons. No new broken links introduced.

site/data.js is left for CI to regenerate on merge, per AGENTS.md.

🤖 Generated with Claude Code

jkhandebharad and others added 30 commits June 15, 2026 23:07
Lesson docs had no way to show real math: formulas were ASCII art in
untagged code fences or plain-text inline, which reads poorly. Add
pinned KaTeX 0.17.0 (CDN + SRI) and teach the client-side markdown
renderer two math forms:

- inline $...$ via the Pandoc rule (opener not followed by space,
  closer not preceded by space nor followed by a digit) so prose dollar
  amounts like $50,000 and $0.25/$2.50 are never mistaken for math
- block $$...$$ (single- or multi-line) rendered as a display equation

Inline code and math are stashed behind sentinels before the escape /
emphasis pass so a $ inside `code` and a * inside a formula stay
verbatim. Bad or unloaded TeX degrades to the raw source, never a blank.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jkhandebharad and others added 16 commits June 16, 2026 00:02
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Render formulas via KaTeX ($...$ / $$...$$) instead of ASCII art and
plain-text notation. Math is unchanged; only notation is converted.
Part of rohitg00#158.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 15, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3395e531-e217-414c-95f5-43eabad43fa8

📥 Commits

Reviewing files that changed from the base of the PR and between e923e8c and db6e6b1.

📒 Files selected for processing (1)
  • phases/01-math-foundations/16-sampling-methods/docs/en.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • phases/01-math-foundations/16-sampling-methods/docs/en.md

📝 Walkthrough

Walkthrough

Adds KaTeX math rendering to site/lesson.html (loading CSS/JS, extending the markdown parser to handle $$...$$ block and $...$ inline math with fallback), then converts plain-text/code-formatted mathematical expressions to LaTeX notation across 45+ lesson documents spanning all curriculum phases.

Changes

LaTeX Math Rendering

Layer / File(s) Summary
KaTeX rendering infrastructure
site/lesson.html
Loads KaTeX stylesheet and JS bundle from jsDelivr with SRI pinning, adds .math-block/.math-fallback CSS, extends the markdown parser state machine to detect single-line and multi-line $$...$$ blocks and Pandoc-style $...$ inline math, and implements renderMathInline/renderMathBlock helpers with graceful monospace TeX fallback when KaTeX is unavailable or parsing fails.
Math foundations LaTeX conversion
phases/01-math-foundations/*/docs/en.md
Converts plain-text/code-block math to LaTeX across all phase-01 lessons: linear algebra (vectors, dot product, Gram-Schmidt), calculus (derivatives, Hessian, Taylor series, integrals, Jacobian), chain rule/autodiff (dual numbers, forward/reverse mode), probability (distributions, softmax, log-probs), Bayes theorem (conjugate priors, A/B testing), optimization (gradient descent, momentum, Adam), information theory (entropy, KL divergence, mutual information), SVD (pseudoinverse, PCA), numerical stability (log-sum-exp, LayerNorm), norms/distances (L1/L2/Lp/cosine/Wasserstein), statistics (t-test, chi-squared, CLT), sampling methods (MCMC, reparameterization, Gumbel-Softmax), linear systems (LU/QR/Cholesky, condition number), convex optimization (KKT, SVM duality), complex numbers (Euler, DFT), Fourier transform (FFT, windowing), and stochastic processes (Markov chains, Metropolis-Hastings, diffusion).
ML fundamentals, deep learning, and computer vision LaTeX conversion
phases/02-ml-fundamentals/*/docs/en.md, phases/03-deep-learning-core/*/docs/en.md, phases/04-computer-vision/*/docs/en.md
Converts math to LaTeX in decision trees (Gini, entropy, MDI), KNN (distance metrics, weighted regression), bias-variance (decomposition, double descent), feature selection (variance, mutual information), perceptron (step function, decision boundary), optimizers (SGD, momentum, Adam, AdamW), regularization (dropout, BatchNorm, LayerNorm, RMSNorm), image fundamentals (BT.601 luminance), convolutions (output size, receptive field), CNNs/ResNet (degradation problem, residual connection), Mask R-CNN (loss formula), diffusion (forward process, DDPM loss), 3D/NeRF (volumetric rendering, positional encoding), ViT (pre-LN residual), self-supervised (InfoNCE, DINO), metric learning (triplet loss), keypoint/pose (heatmap regression), and rectified flow (velocity target).
Transformers, generative AI, LLM engineering, and remaining docs LaTeX conversion
phases/07-transformers-deep-dive/*/docs/en.md, phases/08-generative-ai/*/docs/en.md, phases/10-llms-from-scratch/*/docs/en.md, phases/11-llm-engineering/*/docs/en.md, phases/12-multimodal-ai/*/docs/en.md, phases/13-tools-and-protocols/*/docs/en.md, phases/16-multi-agent-and-swarms/*/docs/en.md, phases/18-ethics-safety-alignment/*/docs/en.md, phases/19-capstone-projects/*/docs/en.md
Converts math to LaTeX in self-attention (scaled dot-product, multi-head), positional encoding (sinusoidal, RoPE, ALiBi), scaling laws (Hoffmann loss, compute-optimal), attention variants (SWA, differential attention), generative models taxonomy, VAE (ELBO, reparameterization), DDPM (forward/reverse process, score matching), flow matching (straight-line flow, CFG), VAR (residual VQ), tokenizers (WordPiece criterion), differential attention v2, embeddings (cosine/dot/L2 similarity, HNSW), RAG (vector similarity), production app (cost projection), multimodal ViT (patch parameter count), parallel tool calls, PSO swarm optimization, reward hacking/Goodhart's Law, and multi-agent capstone (handoff accounting).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 7

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (8)
site/lesson.html (1)

2202-2204: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle required docs frontmatter before markdown parsing.

At Line 2202, parseMd parses raw markdown directly; there’s no YAML frontmatter strip step. If docs adopt required docs/en.md frontmatter, the opening --- will be treated as markdown content (<hr> + visible metadata lines), breaking lesson rendering.

Suggested fix
+      function stripFrontmatter(md) {
+        // Supports:
+        // ---
+        // key: value
+        // ---
+        if (!md || md.slice(0, 4) !== '---\n') return md;
+        var end = md.indexOf('\n---', 4);
+        if (end === -1) return md;
+        return md.slice(end + 4).replace(/^\r?\n/, '');
+      }
+
       function parseMd(md) {
+        md = stripFrontmatter(md);
         var lines = md.split(/\r?\n/);

As per coding guidelines, "**/docs/en.md: Include frontmatter in docs/en.md with fields: Title, one-line hook, Type (Learn|Build|Reference), Languages, Prerequisites, Time estimate, and Learning Objectives."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@site/lesson.html` around lines 2202 - 2204, The parseMd function currently
processes markdown content without stripping YAML frontmatter, which means if
markdown files include frontmatter blocks delimited by `---` at the beginning,
these will be rendered as markdown content (producing `<hr>` tags and visible
metadata lines) instead of being extracted and removed. Before processing the
markdown lines, add logic to detect and strip YAML frontmatter: check if the
markdown starts with `---`, find the closing `---` delimiter, and remove
everything between them (including the delimiters themselves) before continuing
with the rest of the markdown parsing logic.

Source: Coding guidelines

phases/01-math-foundations/01-linear-algebra-intuition/docs/en.md (1)

1-16: ⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Add required YAML frontmatter for docs/en.md and migrate metadata fields.

At Lines 1-16, the file still uses inline metadata (**Type:**, **Languages:**, etc.) instead of required frontmatter. This should be converted in this file and consistently across the other updated phase-01 lesson docs in this PR to keep docs schema-compliant.

Suggested frontmatter shape
---
Title: Linear Algebra Intuition
Hook: Every AI model is just matrix math wearing a fancy hat.
Type: Learn
Languages: [Python, Julia]
Prerequisites: Phase 0
Time estimate: 60 minutes
Learning Objectives:
  - Implement vector and matrix operations (addition, dot product, matrix multiply) from scratch in Python
  - Explain geometrically what the dot product, projection, and Gram-Schmidt process do
  - Determine linear independence, rank, and basis of a set of vectors using row reduction
  - Connect linear algebra concepts to AI applications: embeddings, attention scores, and LoRA
---

As per coding guidelines, "**/docs/en.md: Include frontmatter in docs/en.md with fields: Title, one-line hook, Type (Learn|Build|Reference), Languages, Prerequisites, Time estimate, and 4-6 Learning Objectives bullet pointsandThe Languages: field ... must match the languages with a main.* file in the code/ directory`."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/01-linear-algebra-intuition/docs/en.md` around
lines 1 - 16, Convert the inline metadata in the markdown file from markdown
bold formatting to YAML frontmatter at the top. Remove the existing inline
metadata fields (Type, Languages, Prerequisites, Time) and the blockquote hook,
then add a YAML block delimited by --- at the very beginning of the file
containing: Title (set to "Linear Algebra Intuition"), Hook (the blockquote
text), Type (Learn), Languages (as a list: [Python, Julia]), Prerequisites
(Phase 0), Time estimate (60 minutes), and Learning Objectives (as a list of the
four bullet points currently in the body). After the closing ---, start with the
main heading "# Linear Algebra Intuition" and the remaining content.

Source: Coding guidelines

phases/01-math-foundations/11-singular-value-decomposition/docs/en.md (1)

446-448: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Don't assign the seed call to image.

np.random.seed() returns None, so this line is misleading and briefly sets image to a non-array value. Make the seed call standalone.

💡 Suggested fix
- image = np.random.seed(42)
+ np.random.seed(42)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/11-singular-value-decomposition/docs/en.md` around
lines 446 - 448, The np.random.seed() function returns None, so assigning its
result to the image variable makes image None instead of an array, which is
misleading. Remove the assignment operator from the line np.random.seed(42) and
make it a standalone statement that just sets the random seed without assigning
to image. Keep the subsequent lines that define rows and cols, and then create
the image array with np.random.randn(rows, cols).
phases/01-math-foundations/16-sampling-methods/docs/en.md (3)

615-618: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Stop taking log() of logits.

These inputs are named logits, but math.log(p) treats them like probabilities and will fail on valid negative logits. Add Gumbel noise directly to the logits, or rename the parameter if you really mean probabilities.

🛠 Suggested fix
 def gumbel_softmax(logits, temperature):
-    gumbels = [math.log(p) + gumbel_sample() for p in logits]
+    gumbels = [z + gumbel_sample() for z in logits]
     return softmax([g / temperature for g in gumbels])
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/16-sampling-methods/docs/en.md` around lines 615 -
618, The gumbel_softmax function incorrectly applies math.log() to its inputs
despite naming the parameter logits. Logits are unnormalized scores that can be
negative, and taking their logarithm will fail or produce invalid results.
Remove the math.log(p) call and instead add the gumbel_sample() output directly
to each logit value in the list comprehension, since the Gumbel-Softmax
technique adds Gumbel noise directly to logits before temperature scaling and
softmax.

557-560: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Handle temperature = 0 explicitly.

The prose says T = 0.0 means greedy decoding, but this function divides by temperature and will raise on that input. Special-case zero before scaling.

🧩 Suggested fix
 def temperature_sample(logits, temperature):
+    if temperature == 0:
+        return max(range(len(logits)), key=lambda i: logits[i])
     scaled = [z / temperature for z in logits]
     probs = softmax(scaled)
     return sample_from_probs(probs)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/16-sampling-methods/docs/en.md` around lines 557 -
560, The temperature_sample function performs division by temperature without
handling the case when temperature equals zero, which causes a division error
and contradicts the documented behavior that T = 0.0 should perform greedy
decoding. Add an explicit check at the beginning of the temperature_sample
function: if temperature is 0, return the index of the maximum logit value
(greedy selection) directly. Otherwise, proceed with the existing scaling and
sampling logic.

468-470: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Avoid log(0) in the exponential sampler.

random.random() can return 0.0, so -math.log(u) can fail. log1p(-u) keeps the inverse-CDF transform well-defined on [0, 1).

🔧 Suggested fix
 def sample_exponential_inverse_cdf(lam):
     u = random.random()
-    return -math.log(u) / lam
+    return -math.log1p(-u) / lam
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/16-sampling-methods/docs/en.md` around lines 468 -
470, The sample_exponential_inverse_cdf function uses -math.log(u) which fails
when u equals 0.0 (since random.random() can return 0.0). Replace -math.log(u)
with -math.log1p(-u) to compute log(1-u) in a numerically stable way that
remains well-defined across the entire [0, 1) range that random.random()
produces.
phases/01-math-foundations/17-linear-systems/docs/en.md (1)

245-249: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Correct the least-squares example solution.

The normal-equations system here solves to [1.5, 1.6], not [1.5, 1.7]. The current value disagrees with the derivation above it.

📌 Suggested fix
- Solve: x = [1.5, 1.7]
+ Solve: x = [1.5, 1.6]
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/17-linear-systems/docs/en.md` around lines 245 -
249, The least-squares solution vector in the normal equations example is
incorrect. Change the solution from x = [1.5, 1.7] to x = [1.5, 1.6] to match
the correct result that solves the normal-equations system A^T A x = A^T b shown
in the diff.
phases/11-llm-engineering/13-production-app/docs/en.md (1)

206-209: ⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Two critical KaTeX rendering failures in production-app doc.

Both issues stem from the markdown-to-KaTeX pipeline in site/lesson.html and will break rendering:

Issue 1 — Line 231: The expression $50{,}000 \times (1 - 0.35)$ uses LaTeX's {,} command for spacing, which KaTeX does not support. KaTeX has no built-in support for {,}; use \, (thin space) or plain 50,000 instead.

Issue 2 — Lines 206–209: The Scaling table's currency amounts ($50/month, $500/month, $5K/month, $50K+/month) will be matched by the Pandoc inline-math regex /\$(?=\S)([^$\n]+?)\$(?!\d)/ (opening $ not after space, closing $ not before space/digit, followed by / or K not a digit). These will be incorrectly interpreted as LaTeX inline math and render as broken expressions instead of plain currency text. Escape or wrap in code.

Fixes:

  • Line 231: Change $50{,}000 \times (1 - 0.35)$$50,000 \times (1 - 0.35)$
  • Lines 206–209: Wrap currency in backticks (`$50/month`) or escape dollar signs (\$50/month)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/11-llm-engineering/13-production-app/docs/en.md` around lines 206 -
209, Fix two KaTeX rendering failures in the production-app documentation. At
lines 206-209 in the Scaling table, wrap all currency amounts (`$50/month`,
`$500/month`, `$5K/month`, `$50K+/month`) in backticks (e.g., `` `$50/month` ``)
or escape the dollar signs (e.g., `\$50/month`) to prevent Pandoc's
markdown-to-KaTeX pipeline from misinterpreting them as LaTeX inline math
expressions. At line 231, change the cost expression from `$50{,}000 \times (1 -
0.35)$` to `$50,000 \times (1 - 0.35)$` by removing the unsupported `{,}` LaTeX
command and replacing it with a plain comma.
🧹 Nitpick comments (1)
phases/01-math-foundations/22-stochastic-processes/docs/en.md (1)

168-170: 💤 Low value

Consider rewording to avoid successive sentences starting with "At."

Lines 170–171 have three consecutive sentences opening with "At," which breaks sentence-variety conventions.

✏️ Optional rewrite
-At temperature $T = 0$, this is pure gradient descent. At high temperature, it is nearly a random walk. At the right temperature, the particle explores the energy landscape and spends more time in low-energy regions.
+At temperature $T = 0$, this is pure gradient descent. Higher temperatures produce nearly random-walk behavior. The sweet spot allows the particle to explore the energy landscape and spend more time in low-energy regions.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@phases/01-math-foundations/22-stochastic-processes/docs/en.md` around lines
168 - 170, The three consecutive sentences in the temperature description
paragraph all begin with "At," creating poor sentence variety. Reword at least
one or two of these sentences to vary the sentence structure while maintaining
the same information about how the particle behaves at temperature T=0, at high
temperature, and at the right temperature. Consider using alternative phrasings
such as describing conditions differently or restructuring the sentences to lead
with different elements.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@phases/01-math-foundations/07-bayes-theorem/docs/en.md`:
- Around line 423-427: The fenced code block starting at line 423 in the
pseudocode section is missing a required language tag. Add the "text" language
identifier to the opening fence by changing the bare triple backticks to ```text
to comply with markdown documentation guidelines and eliminate lint violations.

In `@phases/01-math-foundations/13-numerical-stability/docs/en.md`:
- Around line 573-575: The "Precision hunt" exercise incorrectly defines machine
epsilon by asking for the smallest positive float32 value where `1.0 + x ==
1.0`. Machine epsilon should be the smallest positive value where the addition
actually produces a change, not values that get completely rounded away. Modify
the condition in the "Precision hunt" exercise from `1.0 + x == 1.0` to `1.0 + x
> 1.0` to correctly ask students to find the smallest positive value that makes
the sum strictly greater than 1.0.

In `@phases/01-math-foundations/14-norms-and-distances/docs/en.md`:
- Line 31: The sentence makes an overly broad claim that every distance function
can be written as the norm of their difference, but not all distances covered in
the lesson follow this form. Replace "Every distance function between two
vectors" with more accurate language such as "many vector distances" or
"norm-induced distances" to properly qualify the claim and reflect that only
certain types of distances can be expressed as ||a - b||.

In `@phases/01-math-foundations/15-statistics-for-ml/docs/en.md`:
- Around line 179-186: The confidence interval formula is incorrectly using the
z-distribution with sample standard deviation s. When the population standard
deviation is unknown and you use the sample standard deviation s, you must use
the t-distribution instead of the z-distribution. Replace the reference to z =
1.96 with the appropriate t-critical value from the t-distribution with degrees
of freedom n-1, and update the explanation to clarify that this is the
t-interval formula. Note that t ≈ 1.96 for large samples but is larger for
smaller samples, which is an important distinction for proper statistical
inference.

In `@phases/01-math-foundations/16-sampling-methods/docs/en.md`:
- Around line 111-123: The acceptance rate formula stated at the end of the
rejection sampling algorithm section does not account for the possibility of
unnormalized target densities, which was explicitly mentioned earlier in the
section. Modify the "Acceptance rate = 1/M" statement to add a qualification
clarifying that this formula applies only when p(x) is normalized. If p(x) is
unnormalized with normalization constant Z, the actual acceptance rate would be
1/(M*Z), which is unknown without knowing Z. Ensure the revised statement makes
this distinction clear so readers understand the acceptance rate depends on
whether the target density is normalized or not.

In `@phases/01-math-foundations/17-linear-systems/docs/en.md`:
- Around line 324-329: The condition number formula for regularized matrices in
the regularization explanation is incorrect. When λI is added to the normal
equations (A^T A), the eigenvalues of the modified matrix become σ^2 + λ (using
squared singular values), not σ + λ. Update the condition number formula to
correctly reflect that the improved condition number should be written as
(σ_max^2 + λ) / (σ_min^2 + λ) in terms of squared singular values, not (σ_max +
λ) / (σ_min + λ).

In `@phases/01-math-foundations/20-fourier-transform/docs/en.md`:
- Around line 45-52: Add language tags to three text blocks in the markdown file
to comply with documentation guidelines. At lines 45-52, wrap the step-by-step
walk positions content with ```text opening and closing fence markers. At lines
247-256, wrap the STFT procedure content with ```text tags. At lines 264-273,
wrap the aliasing example content with ```text tags. Each fenced code block must
include an explicit language identifier per the coding standards.

---

Outside diff comments:
In `@phases/01-math-foundations/01-linear-algebra-intuition/docs/en.md`:
- Around line 1-16: Convert the inline metadata in the markdown file from
markdown bold formatting to YAML frontmatter at the top. Remove the existing
inline metadata fields (Type, Languages, Prerequisites, Time) and the blockquote
hook, then add a YAML block delimited by --- at the very beginning of the file
containing: Title (set to "Linear Algebra Intuition"), Hook (the blockquote
text), Type (Learn), Languages (as a list: [Python, Julia]), Prerequisites
(Phase 0), Time estimate (60 minutes), and Learning Objectives (as a list of the
four bullet points currently in the body). After the closing ---, start with the
main heading "# Linear Algebra Intuition" and the remaining content.

In `@phases/01-math-foundations/11-singular-value-decomposition/docs/en.md`:
- Around line 446-448: The np.random.seed() function returns None, so assigning
its result to the image variable makes image None instead of an array, which is
misleading. Remove the assignment operator from the line np.random.seed(42) and
make it a standalone statement that just sets the random seed without assigning
to image. Keep the subsequent lines that define rows and cols, and then create
the image array with np.random.randn(rows, cols).

In `@phases/01-math-foundations/16-sampling-methods/docs/en.md`:
- Around line 615-618: The gumbel_softmax function incorrectly applies
math.log() to its inputs despite naming the parameter logits. Logits are
unnormalized scores that can be negative, and taking their logarithm will fail
or produce invalid results. Remove the math.log(p) call and instead add the
gumbel_sample() output directly to each logit value in the list comprehension,
since the Gumbel-Softmax technique adds Gumbel noise directly to logits before
temperature scaling and softmax.
- Around line 557-560: The temperature_sample function performs division by
temperature without handling the case when temperature equals zero, which causes
a division error and contradicts the documented behavior that T = 0.0 should
perform greedy decoding. Add an explicit check at the beginning of the
temperature_sample function: if temperature is 0, return the index of the
maximum logit value (greedy selection) directly. Otherwise, proceed with the
existing scaling and sampling logic.
- Around line 468-470: The sample_exponential_inverse_cdf function uses
-math.log(u) which fails when u equals 0.0 (since random.random() can return
0.0). Replace -math.log(u) with -math.log1p(-u) to compute log(1-u) in a
numerically stable way that remains well-defined across the entire [0, 1) range
that random.random() produces.

In `@phases/01-math-foundations/17-linear-systems/docs/en.md`:
- Around line 245-249: The least-squares solution vector in the normal equations
example is incorrect. Change the solution from x = [1.5, 1.7] to x = [1.5, 1.6]
to match the correct result that solves the normal-equations system A^T A x =
A^T b shown in the diff.

In `@phases/11-llm-engineering/13-production-app/docs/en.md`:
- Around line 206-209: Fix two KaTeX rendering failures in the production-app
documentation. At lines 206-209 in the Scaling table, wrap all currency amounts
(`$50/month`, `$500/month`, `$5K/month`, `$50K+/month`) in backticks (e.g., ``
`$50/month` ``) or escape the dollar signs (e.g., `\$50/month`) to prevent
Pandoc's markdown-to-KaTeX pipeline from misinterpreting them as LaTeX inline
math expressions. At line 231, change the cost expression from `$50{,}000 \times
(1 - 0.35)$` to `$50,000 \times (1 - 0.35)$` by removing the unsupported `{,}`
LaTeX command and replacing it with a plain comma.

In `@site/lesson.html`:
- Around line 2202-2204: The parseMd function currently processes markdown
content without stripping YAML frontmatter, which means if markdown files
include frontmatter blocks delimited by `---` at the beginning, these will be
rendered as markdown content (producing `<hr>` tags and visible metadata lines)
instead of being extracted and removed. Before processing the markdown lines,
add logic to detect and strip YAML frontmatter: check if the markdown starts
with `---`, find the closing `---` delimiter, and remove everything between them
(including the delimiters themselves) before continuing with the rest of the
markdown parsing logic.

---

Nitpick comments:
In `@phases/01-math-foundations/22-stochastic-processes/docs/en.md`:
- Around line 168-170: The three consecutive sentences in the temperature
description paragraph all begin with "At," creating poor sentence variety.
Reword at least one or two of these sentences to vary the sentence structure
while maintaining the same information about how the particle behaves at
temperature T=0, at high temperature, and at the right temperature. Consider
using alternative phrasings such as describing conditions differently or
restructuring the sentences to lead with different elements.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 092d54c9-f364-434b-ad73-79f7a5620b52

📥 Commits

Reviewing files that changed from the base of the PR and between 574a5d6 and 754990c.

📒 Files selected for processing (55)
  • phases/01-math-foundations/01-linear-algebra-intuition/docs/en.md
  • phases/01-math-foundations/04-calculus-for-ml/docs/en.md
  • phases/01-math-foundations/05-chain-rule-and-autodiff/docs/en.md
  • phases/01-math-foundations/06-probability-and-distributions/docs/en.md
  • phases/01-math-foundations/07-bayes-theorem/docs/en.md
  • phases/01-math-foundations/08-optimization/docs/en.md
  • phases/01-math-foundations/09-information-theory/docs/en.md
  • phases/01-math-foundations/11-singular-value-decomposition/docs/en.md
  • phases/01-math-foundations/13-numerical-stability/docs/en.md
  • phases/01-math-foundations/14-norms-and-distances/docs/en.md
  • phases/01-math-foundations/15-statistics-for-ml/docs/en.md
  • phases/01-math-foundations/16-sampling-methods/docs/en.md
  • phases/01-math-foundations/17-linear-systems/docs/en.md
  • phases/01-math-foundations/18-convex-optimization/docs/en.md
  • phases/01-math-foundations/19-complex-numbers/docs/en.md
  • phases/01-math-foundations/20-fourier-transform/docs/en.md
  • phases/01-math-foundations/22-stochastic-processes/docs/en.md
  • phases/02-ml-fundamentals/04-decision-trees/docs/en.md
  • phases/02-ml-fundamentals/06-knn-and-distances/docs/en.md
  • phases/02-ml-fundamentals/10-bias-variance/docs/en.md
  • phases/02-ml-fundamentals/18-feature-selection/docs/en.md
  • phases/03-deep-learning-core/01-the-perceptron/docs/en.md
  • phases/03-deep-learning-core/06-optimizers/docs/en.md
  • phases/03-deep-learning-core/07-regularization/docs/en.md
  • phases/04-computer-vision/01-image-fundamentals/docs/en.md
  • phases/04-computer-vision/02-convolutions-from-scratch/docs/en.md
  • phases/04-computer-vision/03-cnns-lenet-to-resnet/docs/en.md
  • phases/04-computer-vision/08-instance-segmentation-mask-rcnn/docs/en.md
  • phases/04-computer-vision/10-image-generation-diffusion/docs/en.md
  • phases/04-computer-vision/13-3d-vision-nerf/docs/en.md
  • phases/04-computer-vision/14-vision-transformers/docs/en.md
  • phases/04-computer-vision/17-self-supervised-vision/docs/en.md
  • phases/04-computer-vision/20-image-retrieval-metric/docs/en.md
  • phases/04-computer-vision/21-keypoint-pose/docs/en.md
  • phases/04-computer-vision/23-diffusion-transformers-rectified-flow/docs/en.md
  • phases/07-transformers-deep-dive/02-self-attention-from-scratch/docs/en.md
  • phases/07-transformers-deep-dive/04-positional-encoding/docs/en.md
  • phases/07-transformers-deep-dive/13-scaling-laws/docs/en.md
  • phases/07-transformers-deep-dive/15-attention-variants/docs/en.md
  • phases/08-generative-ai/01-generative-models-taxonomy-history/docs/en.md
  • phases/08-generative-ai/02-autoencoders-vae/docs/en.md
  • phases/08-generative-ai/06-diffusion-ddpm-from-scratch/docs/en.md
  • phases/08-generative-ai/13-flow-matching-rectified-flows/docs/en.md
  • phases/08-generative-ai/19-visual-autoregressive-var/docs/en.md
  • phases/10-llms-from-scratch/01-tokenizers/docs/en.md
  • phases/10-llms-from-scratch/16-differential-attention-v2/docs/en.md
  • phases/11-llm-engineering/04-embeddings/docs/en.md
  • phases/11-llm-engineering/06-rag/docs/en.md
  • phases/11-llm-engineering/13-production-app/docs/en.md
  • phases/12-multimodal-ai/01-vision-transformer-patch-tokens/docs/en.md
  • phases/13-tools-and-protocols/03-parallel-and-streaming-tool-calls/docs/en.md
  • phases/16-multi-agent-and-swarms/19-swarm-optimization-pso-aco/docs/en.md
  • phases/18-ethics-safety-alignment/02-reward-hacking-goodhart/docs/en.md
  • phases/19-capstone-projects/10-multi-agent-software-team/docs/en.md
  • site/lesson.html

Comment thread phases/01-math-foundations/07-bayes-theorem/docs/en.md Outdated
Comment thread phases/01-math-foundations/13-numerical-stability/docs/en.md Outdated
Comment thread phases/01-math-foundations/14-norms-and-distances/docs/en.md Outdated
Comment thread phases/01-math-foundations/15-statistics-for-ml/docs/en.md
Comment thread phases/01-math-foundations/16-sampling-methods/docs/en.md
Comment thread phases/01-math-foundations/17-linear-systems/docs/en.md Outdated
Comment thread phases/01-math-foundations/20-fourier-transform/docs/en.md
jkhandebharad and others added 9 commits June 16, 2026 00:42
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ate caveat

Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ition number

Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jayantkhandebharad

Jayantkhandebharad commented Jun 15, 2026

Copy link
Copy Markdown
Author

Review feedback addressed

Thanks for the thorough pass. I verified each finding against the actual code and KaTeX before acting. Summary below; all changed math re-validated (KaTeX throwOnError compile-check of 643 spans in the touched files → 0 failures; audit_lessons.py → 0 issues).

Fixed

In-diff (replied inline): norm-induced distance claim, machine-epsilon exercise, t-interval caveat, rejection-sampling acceptance rate, regularized condition number (squared spectrum), and the untyped fences in bayes/fourier.

Outside-diff:

  • 11-singular-value-decomposition — dropped the misleading image = np.random.seed(42) assignment (92af52f).
  • 16-sampling-methodssample_exponential_inverse_cdf now uses -math.log1p(-u) (well-defined at u = 0), and temperature_sample returns the argmax for T = 0 instead of dividing by zero, matching the documented "T = 0.0: greedy decoding" behavior (e649c7c).
  • 17-linear-systems — corrected the least-squares example to x = [1.5, 1.6] (the normal equations [[4,10],[10,30]] x = [22,63] solve to exactly that) (e0ad0bd).
  • 22-stochastic-processes — varied the three consecutive "At …" sentence openings (e923e8c).

Not changed (verified non-issues)

  • 11-llm-engineering/13-production-app "critical KaTeX failures" — both are false positives.

    • The Scaling-table currency ($50/month, $500/month, $5K/month, $50K+/month) is not matched by the inline regex: every $ is immediately followed by a digit, so none qualifies as a closing delimiter under the Pandoc rule (\$(?!\d) on the closer). I re-ran the regex over that exact row → 0 matches, consistent with the 0 false positives this rule produces across all 503 docs.
    • $50{,}000 \times (1 - 0.35)$ renders fine — {,} is a braced group, the standard idiom for a tight thousands-separator in math mode, and it's in the compile-checked span set (katex.renderToString(..., {throwOnError:true}) passes). No change needed.
  • YAML frontmatter (stripFrontmatter in site/lesson.html; migrating docs/en.md to a --- block). This repo's lesson contract (AGENTS.md) uses inline **Type:** / **Languages:** / **Prerequisites:** / **Time:** metadata, not YAML frontmatter — the renderer special-cases those **key:** value lines (lesson-meta-tag). Introducing --- frontmatter would render as an <hr> plus visible metadata and diverge from all 503 docs, so I've kept the existing convention. Happy to revisit if the project decides to adopt YAML frontmatter repo-wide (that'd be its own change).

gumbel_softmax took math.log() of values named logits, which crashes on negative logits and is mathematically wrong. The Gumbel-Softmax trick adds Gumbel noise directly to logits, matching code/sampling.py. Addresses CodeRabbit review feedback on rohitg00#293.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Jayantkhandebharad

Copy link
Copy Markdown
Author

@rohitg00 can you take a look at this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Convert plain text math formulas to LaTeX rendering

2 participants