cy0307 commited on
Commit
d73516f
Β·
verified Β·
1 Parent(s): 16b7e05

Upload from Ropedia Academy

Browse files
Files changed (1) hide show
  1. README.md +73 -15
README.md CHANGED
@@ -4,19 +4,25 @@ library_name: pytorch
4
  tags:
5
  - ropedia-academy
6
  - educational
 
 
 
7
  - self-supervised
8
  ---
9
 
10
  # Masked Autoencoder (MAE)
11
 
12
- Masks half the image patches and reconstructs them on real handwritten digits β€” the MAE / VideoMAE pretraining objective; reports held-out reconstruction error.
13
 
14
- Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/)** β€” an interactive, bilingual course on embodied & spatial AI. **Educational model:** small and quick to train; the value is the *method* and a reproducible pipeline, not a leaderboard score.
 
 
15
 
16
  | | |
17
  |---|---|
 
18
  | **Task** | self-supervised pretraining |
19
- | **Data** | real handwritten digits (sklearn) |
20
  | **Track** | B Β· 3D & rendering |
21
  | **Notebook** | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_mae_pretrain.ipynb) |
22
 
@@ -28,23 +34,51 @@ Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedi
28
  - **Split:** 1,257 train / 540 test (held-out reconstruction)
29
  - **Source:** scikit-learn load_digits (UCI Optical Recognition of Handwritten Digits)
30
 
31
- ## Results
32
 
33
- | metric | value |
34
- |---|---|
35
- | recon_mse (final) | 0.1393 |
36
- | test_recon_mse | 0.1365 |
 
 
 
 
37
 
38
 
39
  ![figure](figure.png)
40
 
41
- ## How to use
42
 
43
  ```python
44
  import torch
45
- state = torch.load("model.pt", map_location="cpu") # some labs save pose.pt / gaussians.pt / transform.pt
46
- # Rebuild the model class from the Ropedia Academy notebook (linked above), then:
47
- # model.load_state_dict(state)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  ```
49
 
50
  ## Files
@@ -54,10 +88,34 @@ state = torch.load("model.pt", map_location="cpu") # some labs save pose.pt /
54
  - `metrics.json`
55
 
56
 
57
- ## Reproduce / train your own
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
- Open the [lab notebook in Colab](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_mae_pretrain.ipynb) β†’ **Runtime β†’ GPU β†’ Run all**, then its *Publish to the Hugging Face Hub* cell. Browse every lab in the [Ropedia Academy Labs tab](https://chaoyue0307.github.io/ropedia-academy/labs).
 
 
 
60
 
61
 
62
  ---
63
- *Part of the [Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/) trained-model collection.*
 
4
  tags:
5
  - ropedia-academy
6
  - educational
7
+ - embodied-ai
8
+ - from-scratch
9
+ - reproducible
10
  - self-supervised
11
  ---
12
 
13
  # Masked Autoencoder (MAE)
14
 
15
+ > Masks half the image patches and reconstructs them on real handwritten digits β€” the MAE / VideoMAE pretraining objective; reports held-out reconstruction error.
16
 
17
+ Trained from scratch in **[Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/)** β€” an interactive, bilingual course on embodied & spatial AI. **Educational model:** small and quick to train; the value is the *method* and a reproducible pipeline, not a leaderboard score. Try it live in the **[Ropedia demos Space](https://huggingface.co/spaces/cy0307/ropedia-demos)**.
18
+
19
+ ## At a glance
20
 
21
  | | |
22
  |---|---|
23
+ | **Base model** | Trained **from scratch** (random initialization) β€” no pretrained base model. |
24
  | **Task** | self-supervised pretraining |
25
+ | **Training objective** | **Masked patch reconstruction** (MSE on masked tokens) β€” self-supervised pretraining. |
26
  | **Track** | B Β· 3D & rendering |
27
  | **Notebook** | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_mae_pretrain.ipynb) |
28
 
 
34
  - **Split:** 1,257 train / 540 test (held-out reconstruction)
35
  - **Source:** scikit-learn load_digits (UCI Optical Recognition of Handwritten Digits)
36
 
37
+ ## Training config
38
 
39
+ Adam (lr 1e-3), 1200 steps, batch 128; 16 patches of 2Γ—2, 50% masked; 2-layer transformer enc/dec.
40
+
41
+ ## Evaluation results
42
+
43
+ | metric | value | meaning |
44
+ |---|---|---|
45
+ | `recon_mse (final)` | 0.1393 | |
46
+ | `test_recon_mse` | 0.1365 | held-out masked-patch reconstruction MSE (lower = better) |
47
 
48
 
49
  ![figure](figure.png)
50
 
51
+ ## Inference example
52
 
53
  ```python
54
  import torch
55
+ state = torch.load("mae.pt", map_location="cpu") # this repo's checkpoint
56
+ # Rebuild the exact module from the lab notebook (see "Reproduce"), then:
57
+ # model.load_state_dict(state); model.eval()
58
+ ```
59
+
60
+ ## Limitations
61
+
62
+ **Educational scale.** Trained quickly on CPU on small or synthetic data, so absolute numbers are not competitive with production systems β€” the value is the *method* and a reproducible pipeline. No large-scale data, no hyperparameter sweep, and no multi-seed variance is reported. **Not for production use.**
63
+
64
+ Tiny model on **8Γ—8 digits** β†’ blurry reconstructions; not a general visual encoder.
65
+
66
+ ## Failure cases
67
+
68
+ A high mask ratio with only 16 patches removes too much context β†’ over-smoothed fills.
69
+
70
+ ## Reproduce / train your own
71
+
72
+ **One click:** open the notebook in Colab β†’ **Runtime β†’ GPU β†’ Run all**, then run its *Publish to the Hugging Face Hub* cell.
73
+
74
+ [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ChaoYue0307/ropedia-academy/blob/main/notebooks/training/B_mae_pretrain.ipynb)
75
+
76
+ **From a shell:**
77
+ ```bash
78
+ git clone https://github.com/ChaoYue0307/ropedia-academy.git && cd ropedia-academy
79
+ pip install torch numpy matplotlib scikit-learn scikit-image gymnasium
80
+ jupyter nbconvert --to notebook --execute notebooks/training/B_mae_pretrain.ipynb --output run.ipynb
81
+ # optional: override training length, e.g. STEPS=2000 (or EPISODES=600) before running
82
  ```
83
 
84
  ## Files
 
88
  - `metrics.json`
89
 
90
 
91
+ ## License
92
+
93
+ Code & weights: **MIT** (this repository) β€” educational use encouraged.
94
+ Handwritten-digits data: UCI ML Repository via scikit-learn β€” CC BY 4.0.
95
+
96
+ ## Citation
97
+
98
+ If you use this model or the course materials, please cite:
99
+
100
+ ```bibtex
101
+ @misc{ropedia_academy,
102
+ title = {Ropedia Academy: an interactive course on embodied & spatial AI},
103
+ author = {Ropedia Academy},
104
+ year = {2026},
105
+ howpublished = {\url{https://chaoyue0307.github.io/ropedia-academy/}}
106
+ }
107
+ ```
108
+
109
+
110
+ **Method / original work:** He et al., *Masked Autoencoders Are Scalable Vision Learners (MAE)*, CVPR 2022; Tong et al., *VideoMAE*, NeurIPS 2022.
111
+
112
+ ## Related assets
113
 
114
+ - πŸš€ **Live demos:** [https://huggingface.co/spaces/cy0307/ropedia-demos](https://huggingface.co/spaces/cy0307/ropedia-demos)
115
+ - πŸ€— **All trained models + collection:** [https://huggingface.co/cy0307](https://huggingface.co/cy0307)
116
+ - πŸ“š **Course & all labs:** [https://chaoyue0307.github.io/ropedia-academy/](https://chaoyue0307.github.io/ropedia-academy/) Β· [Labs tab](https://chaoyue0307.github.io/ropedia-academy/labs)
117
+ - πŸ’» **Source / notebooks:** [github.com/ChaoYue0307/ropedia-academy](https://github.com/ChaoYue0307/ropedia-academy)
118
 
119
 
120
  ---
121
+ *Part of the [Ropedia Academy](https://chaoyue0307.github.io/ropedia-academy/) trained-model collection. Contributions & issues welcome on [GitHub](https://github.com/ChaoYue0307/ropedia-academy).*