LSTM, Clearly Explained ↗
Before or after H1: explain the roles of sigmoid, tanh, retained memory, and exposed state.
Creator’s lesson / source code
Machine LearningNCKU · Fall 2026 · Monday 14:00–17:00 · English-taught
Understand the mechanism. Run the experiment. Reproduce the result. Explain what the evidence supports.
Instructor: Prof. Chi-Hua Jonny Yu
Focus: ML foundations, reproducibility, interpretability, and bounded agent workflows.
Work through definitions, mechanisms, equations, and numerical examples.
Keep data identity, split boundaries, seeds, versions, and actual measured outputs.
Connect results to assumptions; test interventions and state limits.
The complete semester
Monday meetings run from 14:00 to 17:00. ML foundations lead into sequence modeling, reliable evaluation, and agent workflows. The 19 October class follows the three-part sequence requested for this week.
Read · predict · run · modify · explain
Every teaching week has a complete worked practice notebook with Markdown explanations, expected checkpoints, troubleshooting, and an evidence export. The same .ipynb works in Colab and local Jupyter.
Weekly notebooks are in-class practice and optional extensions. Graded Homework occurs only at announced milestones. Midterm and final assessments each include a written examination and an oral examination.
Describe a row, a unit, a target, and an evidence chain.
Describe a row, a unit, a target, and an evidence chain.
Open course-introduction slides
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Build a preprocessing pipeline and inspect held-out classification errors.
Build a preprocessing pipeline and inspect held-out classification errors.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Choose a baseline and distinguish continuous from categorical targets.
Choose a baseline and distinguish continuous from categorical targets.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Follow the current semester calendar; no new in-class practice.
No new notebook is assigned on this calendar holiday. You may revisit the previous teaching module.
Explain precision, recall, specificity, thresholds, and validation. Homework milestone: ML Problem Brief.
Explain precision, recall, specificity, thresholds, and validation. Homework milestone: ML Problem Brief.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Interpret PCA and clusters while separating geometry from physical meaning.
Interpret PCA and clusters while separating geometry from physical meaning.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Trace LSTM memory, compute attention, and train/test a tiny causal Transformer across three one-hour modules.
H1 · 14:00–15:00 · 60 MIN · 30 SLIDES
From ordered windows and honest splits to RNN state, LSTM gates, trained forecasts, and baseline comparisons.
H2 · 15:00–16:00 · 60 MIN · 30 SLIDES
Resolve the context bottleneck; compute QK scores, softmax and weighted retrieval; inspect masks and interpretation limits.
H3 · 16:00–17:00 · 60 MIN · 30 SLIDES
Add positions, heads, residuals and feed-forward layers; train a small decoder and test future-token isolation.
How the three hours work: about 90 minutes of explanation and worked reasoning, with 90 minutes of prediction, guided execution, experiments, and explain-back distributed across the three modules. Every slide has a two-minute facilitation cue; notebook operations provide the practice within that time.
Completion evidence: an LSTM baseline comparison, a verified attention calculation, a Transformer causality test, and one saved evidence record per notebook.
Download the full W07 LaTeX lecture chapter · Read the nine-page W07 PDF · Download all three slide decks and notebooks
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Consolidate the sequence notebooks; no new in-class practice.
No new notebook is assigned on this calendar holiday. You may revisit the previous teaching module.
Stress-test model assumptions and report subgroup failures.
Stress-test model assumptions and report subgroup failures.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Rebuild a baseline from frozen data and split IDs. Homework milestone: ML Workflow.
Rebuild a baseline from frozen data and split IDs. Homework milestone: ML Workflow.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Explain project data, baseline, evaluation, limitations, and reproduction.
Explain project data, baseline, evaluation, limitations, and reproduction.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Separate next-token generation from validated action execution.
Separate next-token generation from validated action execution.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Build a lexical retrieval baseline with source IDs and abstention.
Build a lexical retrieval baseline with source IDs and abstention.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Enforce permissions, step budgets, and human review. Homework milestone: Final Agent Plan.
Enforce permissions, step budgets, and human review. Homework milestone: Final Agent Plan.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Produce traceable descriptive results with a validated input schema.
Produce traceable descriptive results with a validated input schema.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Compare candidates using reference cases and recorded failures. Homework milestone: Demo Readiness.
Compare candidates using reference cases and recorded failures. Homework milestone: Demo Readiness.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Package data identity, code, result cards, limitations, and AI-use disclosure.
Package data identity, code, result cards, limitations, and AI-use disclosure.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Defend the final project with a reproducible evidence package.
Defend the final project with a reproducible evidence package.
Predict, run, change one factor, and explain the evidence. This is not an additional weekly graded assignment.
Homework · Forecasting and explanation
Compare persistence, Ridge regression, and LSTM using a reproducible chronological evaluation. Explain your system and evidence in a five-minute English video. This is a separately announced HW, not an extra weekly exercise.
Includes the full English brief, grading rubric, data-leakage rules, submission checklist, and a guided Colab/Jupyter starter. Free CPU workflow; no paid API or deployment required. Due date: to be announced.
Supplementary explanations
The lecture and notebooks are self-contained. These creator-hosted videos provide alternative explanations and optional deeper study; the three-hour class does not depend on watching full videos.
Before or after H1: explain the roles of sigmoid, tanh, retained memory, and exposed state.
Creator’s lesson / source codeAfter H2: pause before softmax and compute a query-to-key ranking yourself.
Creator’s lesson / source codeA longer optional implementation study; the full video is not required during the three-hour class.
Creator’s lesson / source codeChoose seminars after completing the core notebooks; these research talks are not assumed prerequisites.
Creator’s lesson / source codeTextbook and primary sources
The Week 07 LaTeX chapter follows the same order as the three decks and notebooks: chronological windows, recurrent memory, attention arithmetic, and a causal Transformer.
Colab or local Jupyter
For local work: download the .ipynb, install Python and Jupyter, then run the setup cell. The setup installs missing free packages; all core data are generated locally or included with scikit-learn.
No API keys, paid model calls, GPU allocation, or private datasets are required for the core exercises.