Skip to content

Commit 2a019d1

Browse files
committed
Replace Week 10 Automation with Transformers for materials
RL/automation is skipped this course; Week 10 now teaches transformer applications in characterization (promoted from the former Week 9 companion). Drops the Week 9 companion line, updates the slide link and section header, and rewrites week10_summary.md accordingly.
1 parent 767b889 commit 2a019d1

2 files changed

Lines changed: 46 additions & 45 deletions

File tree

index.qmd

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -366,16 +366,14 @@ Construct a simple ML-based process map; compare constrained vs unconstrained mo
366366

367367
---
368368

369-
### Unit IV — Characterization, Automation, and Uncertainty (Weeks 9–11)
369+
### Unit IV — Characterization, Transformers, and Uncertainty (Weeks 9–11)
370370

371371
#### Week 9 – ML for characterization signals
372372

373373
*Lecture: Tuesday, 09.06.2026, 14:15-15:45 | Exercise: Thursday, 11.06.2026, 16:15-17:45*
374374

375375
**Slides:** [Open](https://pelzlab.science/public_presentations/ml_for_characterization_and_processing/unit09_characterization_signals/10_characterization_signals.html)
376376

377-
Companion deck (within Week 9): **Transformers for materials**[Open](https://pelzlab.science/public_presentations/ml_for_characterization_and_processing/unit09b_transformers_for_materials/transformers_for_materials.html)
378-
379377
- Spectral data: XRD, EELS, EDS.
380378
- Denoising, peak finding, dimensionality reduction.
381379
- Using ML without destroying physical meaning.
@@ -392,24 +390,25 @@ Apply PCA/NMF to spectral datasets; interpret components physically.
392390

393391
---
394392

395-
#### Week 10 – Automation in microscopy and characterization
393+
#### Week 10 – Transformers for materials characterization
396394

397395
*Lecture: Tuesday, 16.06.2026, 14:15-15:45 | Exercise: Thursday, 18.06.2026, 16:15-17:45*
398396

399-
**Slides:** [Open](https://pelzlab.science/public_presentations/ml_for_characterization_and_processing/unit10_automation/11_automation.html)
397+
**Slides:** [Open](https://pelzlab.science/public_presentations/ml_for_characterization_and_processing/unit10_transformers_for_materials/transformers_for_materials.html)
400398

401-
- Autofocus, drift correction, parameter selection.
402-
- ML as a control component, not just a predictor.
399+
- Why attention: long-range correlations beyond CNN receptive fields.
400+
- Scaled dot-product attention and the Vision Transformer (ViT).
401+
- Flash Attention for tractable long sequences.
403402

404403
**Summary:**
405404

406-
- **Autonomous characterization**: ML moves from passive analysis to active instrument control
407-
- **Multi-modal data fusion** (SEM + EDS + process logs) via Bayesian frameworks
408-
- **Reinforcement learning** for instrument tuning and process optimization
409-
- Pipelines that autonomously find → characterize → decide the next experiment
405+
- **Self-attention** and the **Vision Transformer (ViT)** for materials imaging
406+
- **Flash Attention**: long sequences without the L×L memory blow-up
407+
- Applications: **ViT on 4D-STEM** diffraction; cross-attention across LPBF layer stacks
408+
- Scaling alternatives (**Mamba / state-space models**) — and when *not* to reach for a transformer
410409

411410
**Exercise:**
412-
Implement a simple ML-assisted autofocus or defect detector.
411+
Apply a small ViT / attention model to a characterization dataset (e.g. 4D-STEM patches); compare against a CNN baseline.
413412

414413
---
415414

week10_summary.md

Lines changed: 35 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,49 @@
1-
# Week 10 Summary: Automation in microscopy and characterization
1+
# Week 10 Summary: Transformers for materials characterization
22

33
## Cross-Book Summary
44

5-
### 1. Multi-Modal Data Fusion
6-
- **Beyond Single Sensors:** Fuse images (SEM), chemistry (EDS), and orientations (EBSD) for a complete physical picture.
7-
- **Bayesian Sensor Fusion:** Combines uncertain measurements using precision-weighted posteriors.
8-
- **Latent Fusion:** Autoencoders/PCA find shared embeddings to combine diverse data types.
5+
### 1. Why Attention for Materials
6+
- **Long-range correlations:** Many characterization signals (diffraction, micrograph stacks) have dependencies that exceed practical CNN receptive fields.
7+
- **Self-attention:** Lets every token attend to every other token directly, capturing global structure in one layer.
98

10-
### 2. Reinforcement Learning for Control
11-
- **Autonomous Agent:** Learns to interact with environments (e.g., microscopes) to maximize rewards.
12-
- **RL Loop:** State (image), Action (adjust focus), Reward (sharpness/SNR).
13-
- **Policy Gradients:** Train NNs for optimal scientific decision-making.
9+
### 2. The Transformer Toolkit
10+
- **Scaled dot-product attention:** The core operation and its O(L²) cost.
11+
- **Vision Transformer (ViT):** Patchify → embed → encode → classify; transformers applied to image-like data.
12+
- **Flash Attention:** A fused kernel that makes long sequences tractable without materialising the L×L matrix.
1413

15-
### 3. Computer Vision in the Lab
16-
- **Automated Workflows:** CNNs for real-time ROI detection, autofocus, and pattern classification.
14+
### 3. Materials Applications
15+
- **ViT on 4D-STEM:** Diffraction patches become a token sequence for a ViT encoder.
16+
- **Cross-attention across LPBF layers:** Long-stack micrograph context for additive-manufacturing monitoring.
17+
18+
### 4. Scaling Alternatives (Awareness Only)
19+
- **Mamba / structured state-space models (SSMs):** O(L) compute, constant memory; competitive on long sequences. Cross-reference the Week 7 time-series deck.
1720

1821
## 90-Minute Lecture Strategy
1922

20-
### Part 1: Toward the Self-Driving Lab
21-
- The automation stack.
22-
- Autonomous Characterization: Scan, Analyze, Decide, Repeat.
23+
### Part 1: Where We Are
24+
- Recap of Week 9 (characterization signals) and why we now need attention.
2325

24-
### Part 2: ML-Assisted Instrument Tuning
25-
- Autofocus and Beam Alignment.
26-
- Real-time feedback loops.
26+
### Part 2: Why Attention
27+
- Long-range correlations exceed CNN receptive fields.
2728

28-
### Part 3: Fusing Multi-Modal Data
29-
- Bayesian Fusion for sensor noise.
30-
- Multi-head NNs.
31-
- Combining XRD and EDS.
29+
### Part 3: Mechanics
30+
- Scaled dot-product attention: the formula and the cost.
31+
- ViT in five lines: patchify, embed, encode, classify.
32+
- Flash Attention: the kernel that makes long sequences tractable.
3233

33-
### Part 4: RL for Lab Control
34-
- RL Framework overview.
35-
- Reward Functions for science.
36-
- Industrial glass processing control.
34+
### Part 4: Materials Applications
35+
- ViT on 4D-STEM diffraction.
36+
- Cross-attention across LPBF layer stacks.
3737

38-
### Part 5: The Integrated Pipeline
39-
- "On-the-fly" discovery.
40-
- Automation challenges: Latency and safety.
38+
### Part 5: Practice and Pitfalls
39+
- `nn.MultiheadAttention` vs `F.scaled_dot_product_attention`.
40+
- Scaling alternatives (Mamba / SSMs) — mention only.
41+
- Anti-patterns: what *not* to do.
42+
- Exercise preview.
4143

4244
## Quarto Website Update (Summary)
43-
**Summary for ML-PC Week 11:**
44-
- Explores Autonomous Characterization and active instrument control.
45-
- Introduces Multi-Modal Data Fusion (Bayesian and Latent).
46-
- Uses Reinforcement Learning (RL) for laboratory task automation.
47-
- Details building integrated pipelines for "on-the-fly" scientific discovery.
45+
**Summary for ML-PC Week 10:**
46+
- Motivates self-attention for long-range structure in characterization data.
47+
- Covers scaled dot-product attention, the Vision Transformer, and Flash Attention.
48+
- Applies transformers to 4D-STEM diffraction and LPBF layer-stack context.
49+
- Notes Mamba / state-space models as scaling alternatives, and when not to reach for a transformer.

0 commit comments

Comments
 (0)