|
1 | | -# Week 10 Summary: Transformers for materials characterization |
| 1 | +# Week 10 Summary: ML for characterization signals |
2 | 2 |
|
3 | 3 | ## Cross-Book Summary |
4 | 4 |
|
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. |
| 5 | +### 1. Clustering Spectral Data |
| 6 | +- **K-Means:** Groups similar spectra (XRD/EDS) to identify distinct phases. |
| 7 | +- **Mini-Batch K-Means:** Speeds up high-throughput characterization. |
| 8 | +- **t-SNE:** Projects high-dimensional spectra to 2D to reveal outliers/relationships. |
8 | 9 |
|
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. |
| 10 | +### 2. Autoencoders for Signal Processing |
| 11 | +- **Latent Representations:** Compresses spectra to essential physical information. |
| 12 | +- **Denoising:** Reconstructs clean signals from noisy inputs without blurring. |
| 13 | +- **Non-linear Compression:** Outperforms PCA for complex spectral libraries. |
13 | 14 |
|
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. |
| 15 | +### 3. Scientific Integrity in ML |
| 16 | +- **Peak Preservation:** ML must assist, not invent or smooth away real physics. |
20 | 17 |
|
21 | 18 | ## 90-Minute Lecture Strategy |
22 | 19 |
|
23 | | -### Part 1: Where We Are |
24 | | -- Recap of Week 9 (characterization signals) and why we now need attention. |
| 20 | +### Part 1: High-Dimensional Signals |
| 21 | +- Digital footprint: XRD, EDS, EELS, Raman. |
| 22 | +- Manual vs. automated peak-picking. |
| 23 | +- Vector spectrum representation. |
25 | 24 |
|
26 | | -### Part 2: Why Attention |
27 | | -- Long-range correlations exceed CNN receptive fields. |
| 25 | +### Part 2: Clustering Structure |
| 26 | +- K-Means algorithm. |
| 27 | +- Elbow Method for phase counting. |
| 28 | +- Ternary alloy mapping. |
28 | 29 |
|
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. |
| 30 | +### Part 3: Visualizing the Unseen |
| 31 | +- t-SNE Stochastic Proximity. |
| 32 | +- Hidden relationships. |
| 33 | +- t-SNE distance pitfalls. |
33 | 34 |
|
34 | | -### Part 4: Materials Applications |
35 | | -- ViT on 4D-STEM diffraction. |
36 | | -- Cross-attention across LPBF layer stacks. |
| 35 | +### Part 4: Autoencoders & Denoising |
| 36 | +- Encoder-Bottleneck-Decoder. |
| 37 | +- Denoising characterization signals. |
| 38 | +- Bottlenecks as physical descriptors. |
37 | 39 |
|
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. |
| 40 | +### Part 5: Data to Discovery |
| 41 | +- Real-time spectral analysis. |
| 42 | +- Physical consistency in ML. |
| 43 | +- Automated pipelines. |
43 | 44 |
|
44 | 45 | ## Quarto Website Update (Summary) |
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. |
| 46 | +**Summary for ML-PC Week 10:** |
| 47 | +- Processes high-dimensional Characterization Signals (XRD, EDS). |
| 48 | +- Employs K-Means and t-SNE for automated phase identification. |
| 49 | +- Uses Autoencoders for latent space compression and denoising. |
| 50 | +- Enhances high-throughput data analysis while preserving physics. |
0 commit comments