KlondikeDev commited on
Commit
0688058
·
verified ·
1 Parent(s): d12bb4f

Lucy: 71M-param unconditional 128x128 face DDPM, trained from scratch

Browse files
.gitattributes CHANGED
@@ -33,3 +33,24 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ samples/sample_grid.png filter=lfs diff=lfs merge=lfs -text
37
+ training/progress/step_0003000.png filter=lfs diff=lfs merge=lfs -text
38
+ training/progress/step_0006000.png filter=lfs diff=lfs merge=lfs -text
39
+ training/progress/step_0009000.png filter=lfs diff=lfs merge=lfs -text
40
+ training/progress/step_0012000.png filter=lfs diff=lfs merge=lfs -text
41
+ training/progress/step_0015000.png filter=lfs diff=lfs merge=lfs -text
42
+ training/progress/step_0018000.png filter=lfs diff=lfs merge=lfs -text
43
+ training/progress/step_0021000.png filter=lfs diff=lfs merge=lfs -text
44
+ training/progress/step_0024000.png filter=lfs diff=lfs merge=lfs -text
45
+ training/progress/step_0027000.png filter=lfs diff=lfs merge=lfs -text
46
+ training/progress/step_0030000.png filter=lfs diff=lfs merge=lfs -text
47
+ training/progress/step_0033000.png filter=lfs diff=lfs merge=lfs -text
48
+ training/progress/step_0036000.png filter=lfs diff=lfs merge=lfs -text
49
+ training/progress/step_0039000.png filter=lfs diff=lfs merge=lfs -text
50
+ training/progress/step_0042000.png filter=lfs diff=lfs merge=lfs -text
51
+ training/progress/step_0045000.png filter=lfs diff=lfs merge=lfs -text
52
+ training/progress/step_0048000.png filter=lfs diff=lfs merge=lfs -text
53
+ training/progress/step_0051000.png filter=lfs diff=lfs merge=lfs -text
54
+ training/progress/step_0054000.png filter=lfs diff=lfs merge=lfs -text
55
+ training/progress/step_0057000.png filter=lfs diff=lfs merge=lfs -text
56
+ training/progress/step_0060000.png filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
README.md ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ library_name: diffusers
4
+ pipeline_tag: unconditional-image-generation
5
+ tags:
6
+ - diffusers
7
+ - ddpm
8
+ - unconditional-image-generation
9
+ - diffusion
10
+ - faces
11
+ - pytorch
12
+ - safetensors
13
+ datasets:
14
+ - tglcourse/CelebA-faces-cropped-128
15
+ ---
16
+
17
+ # Lucy
18
+
19
+ **Lucy** is a small unconditional denoising diffusion model (DDPM) that generates
20
+ 128×128 RGB face images. It was trained from scratch — no pretrained
21
+ initialization, no fine-tuning of an existing checkpoint — on a single consumer
22
+ GPU (RTX 3060, 12 GB) in under ten hours.
23
+
24
+ Weights are open: Apache-2.0, `safetensors`, plus the complete training script
25
+ and the raw training log used to produce them. Everything needed to reproduce
26
+ the run is in this repo.
27
+
28
+ ![Samples from Lucy](samples/sample_grid.png)
29
+
30
+ ---
31
+
32
+ ## Quick start
33
+
34
+ ```bash
35
+ pip install diffusers transformers accelerate torch safetensors
36
+ ```
37
+
38
+ ```python
39
+ from diffusers import DDPMPipeline
40
+
41
+ pipe = DDPMPipeline.from_pretrained("opencerebral/Lucy").to("cuda")
42
+ images = pipe(batch_size=4).images
43
+ images[0].save("face.png")
44
+ ```
45
+
46
+ ### Faster sampling with DDIM
47
+
48
+ The default DDPM scheduler runs the full 1000-step reverse chain. The samples in
49
+ this card were generated with **DDIM at 50 steps**, which is ~20× faster and what
50
+ the training script itself uses for its periodic previews:
51
+
52
+ ```python
53
+ import torch
54
+ from diffusers import DDIMPipeline, DDIMScheduler, UNet2DModel
55
+
56
+ unet = UNet2DModel.from_pretrained("opencerebral/Lucy", subfolder="unet").to("cuda")
57
+ sched = DDIMScheduler(num_train_timesteps=1000, beta_schedule="linear")
58
+ pipe = DDIMPipeline(unet=unet, scheduler=sched).to("cuda")
59
+
60
+ images = pipe(batch_size=16, num_inference_steps=50,
61
+ generator=torch.manual_seed(42)).images
62
+ ```
63
+
64
+ The model is unconditional: there is no text prompt, no class label, and no
65
+ guidance. The only control you have over the output is the initial noise, i.e.
66
+ the random seed.
67
+
68
+ ---
69
+
70
+ ## Model details
71
+
72
+ | | |
73
+ |---|---|
74
+ | Architecture | `UNet2DModel` (diffusers), epsilon-prediction |
75
+ | Parameters | **71.4 M** |
76
+ | Resolution | 128 × 128, RGB |
77
+ | Conditioning | none (unconditional) |
78
+ | Block channels | `[128, 128, 256, 256, 512]` |
79
+ | Down blocks | `DownBlock2D ×3`, `AttnDownBlock2D`, `DownBlock2D` |
80
+ | Up blocks | `UpBlock2D`, `AttnUpBlock2D`, `UpBlock2D ×3` |
81
+ | Layers per block | 2 |
82
+ | Attention head dim | 8 (self-attention at the 16×16 stage and in the mid block) |
83
+ | Norm | GroupNorm, 32 groups, eps 1e-5 |
84
+ | Activation | SiLU |
85
+ | Timestep embedding | positional |
86
+ | Weights format | `safetensors`, fp32 (286 MB) |
87
+ | diffusers version | 0.39.0 |
88
+
89
+ ### Noise schedule
90
+
91
+ Linear beta schedule, `beta_start = 1e-4`, `beta_end = 0.02`, `T = 1000`
92
+ timesteps, `prediction_type = "epsilon"`, `variance_type = "fixed_small"`,
93
+ `clip_sample = True`. Standard DDPM (Ho et al., 2020) settings.
94
+
95
+ Attention sits at exactly one resolution (the second-to-last downsampling
96
+ stage, 16×16). That is deliberate: at 128×128 a full-resolution attention map is
97
+ what blows up memory on a 12 GB card, and a single mid-depth attention stage
98
+ recovers most of the global coherence — face symmetry, consistent lighting
99
+ across the image — for very little cost.
100
+
101
+ ---
102
+
103
+ ## Training
104
+
105
+ | | |
106
+ |---|---|
107
+ | Dataset | [`tglcourse/CelebA-faces-cropped-128`](https://huggingface.co/datasets/tglcourse/CelebA-faces-cropped-128) — 192,469 rows used |
108
+ | Hardware | 1 × NVIDIA GeForce RTX 3060 (12 GB) |
109
+ | Precision | fp16 AMP (`torch.autocast`) with `GradScaler`; TF32 matmul enabled |
110
+ | Optimizer | AdamW, lr `1e-4`, 500-step linear warmup, constant thereafter |
111
+ | Batch size | 16 (no gradient accumulation) |
112
+ | Grad clipping | global norm 1.0 |
113
+ | EMA | decay 0.9999, updated every optimizer step; **the released weights are the EMA weights** |
114
+ | Steps | 60,000 (≈ 5 epochs) |
115
+ | Wall clock | **9.54 hours**, ~1.75 it/s steady state |
116
+ | Seed | 42 |
117
+ | Loss | MSE on predicted noise, computed in fp32 |
118
+
119
+ Augmentation was resize → center crop to 128 → random horizontal flip →
120
+ normalize to `[-1, 1]`. Nothing else.
121
+
122
+ ### Loss curve
123
+
124
+ Training loss over the run, read from `training/train.log`:
125
+
126
+ | step | loss |
127
+ |---:|---:|
128
+ | 100 | 0.5997 |
129
+ | 200 | 0.0715 |
130
+ | 300 | 0.0467 |
131
+ | 60,000 | 0.0131 |
132
+
133
+ Note that the *first* logged value is the only large one — DDPM epsilon-loss
134
+ collapses almost immediately to the ~0.05 range because most sampled timesteps
135
+ are easy, and the remaining 59,700 steps buy a slow grind from 0.047 down to
136
+ 0.013. Loss is a poor progress signal here; the sample grids are the real one.
137
+
138
+ ### Training progression
139
+
140
+ `training/progress/` contains an EMA sample grid rendered every 3,000 steps
141
+ (`step_0003000.png` … `step_0060000.png`), all from the same fixed seed, so you
142
+ can watch the same 16 latents resolve from noise into faces over the run.
143
+
144
+ ---
145
+
146
+ ## What's in this repo
147
+
148
+ ```
149
+ model_index.json DDPMPipeline definition
150
+ unet/ UNet2DModel config + EMA weights (safetensors)
151
+ scheduler/ DDPMScheduler config
152
+ samples/sample_grid.png 16 samples, DDIM 50 steps, seed 42
153
+ samples/one_face.png single 128x128 sample
154
+ training/train.py the full training script
155
+ training/run.sh the exact launch command for this run
156
+ training/train.log complete stdout of the 60k-step run
157
+ training/progress/ EMA previews every 3,000 steps
158
+ ```
159
+
160
+ ### Reproducing
161
+
162
+ ```bash
163
+ pip install torch torchvision diffusers datasets accelerate tensorboard
164
+ bash training/run.sh # edit --output_dir first
165
+ ```
166
+
167
+ The script stops at `min(--max_train_steps, --max_hours)`, checkpoints every
168
+ 20,000 steps keeping the last 2, and writes a ready-to-load `DDPMPipeline` to
169
+ `<output_dir>/final` when it finishes. It supports `--resume_from` for restarts.
170
+
171
+ Optimizer-state checkpoints (`step_*.pt`, ~1.2 GB each) are **not** included
172
+ here — they are large and only useful for resuming this specific run. The EMA
173
+ weights in `unet/` are the artifact worth keeping.
174
+
175
+ ---
176
+
177
+ ## Limitations
178
+
179
+ Be realistic about what a 71M-parameter model trained for 9.5 hours produces:
180
+
181
+ - **Fidelity.** Outputs are recognizably faces with plausible structure,
182
+ lighting, and hair, but they are soft, and fine detail — teeth, eyes at close
183
+ range, jewelry, text — is often wrong. Compare the samples above before
184
+ assuming this is drop-in usable.
185
+ - **Backgrounds are mush.** CelebA is celebrity photos with wildly varied,
186
+ cluttered backgrounds. The model has learned "a colorful blur behind a face"
187
+ and little more.
188
+ - **Occasional structural failures.** A minority of samples have distorted or
189
+ doubled features. There is no rejection sampling or guidance to filter these.
190
+ - **No control.** Unconditional means unconditional. You cannot ask for an age,
191
+ an expression, a pose, or a style. Seed search is the only lever.
192
+ - **Dataset bias.** CelebA is a celebrity face dataset and is well documented as
193
+ skewed in age, skin tone, and attractiveness-as-labeled. Lucy reproduces that
194
+ skew faithfully. It is not a representative sample of human faces and should
195
+ not be treated as one.
196
+ - **Resolution.** Fixed at 128×128. The UNet's `sample_size` is 128 and it will
197
+ degrade badly if you ask it for other sizes.
198
+
199
+ ## Intended use
200
+
201
+ Research, education, and demonstration of small-scale from-scratch diffusion
202
+ training. It is a good teaching artifact: the whole pipeline is one 270-line
203
+ script, and the log shows exactly what a 60k-step run costs on hardware people
204
+ actually own.
205
+
206
+ **Not** intended for generating imagery of, or presented as, real people. The
207
+ model was trained on photographs of real individuals; while its outputs are not
208
+ reconstructions of specific training images, do not use it to imply the depiction
209
+ of any real person, and do not use it in any identity, verification, or
210
+ surveillance context.
211
+
212
+ ## Licensing
213
+
214
+ - **Model weights and code in this repo: Apache-2.0.**
215
+ - **Training data is a separate matter.** The weights derive from CelebA, which
216
+ is released for **non-commercial research use only** under its original terms.
217
+ The Apache-2.0 grant here covers what the repo authors can grant; it does not
218
+ and cannot override upstream dataset terms. If you plan to use Lucy
219
+ commercially, review the CelebA license yourself first — the honest reading is
220
+ that a CelebA-derived model inherits that non-commercial restriction.
221
+
222
+ ## Citation
223
+
224
+ DDPM, the method this implements:
225
+
226
+ ```bibtex
227
+ @inproceedings{ho2020ddpm,
228
+ title = {Denoising Diffusion Probabilistic Models},
229
+ author = {Ho, Jonathan and Jain, Ajay and Abbeel, Pieter},
230
+ booktitle = {Advances in Neural Information Processing Systems},
231
+ year = {2020}
232
+ }
233
+ ```
234
+
235
+ This model:
236
+
237
+ ```bibtex
238
+ @misc{lucy2026,
239
+ title = {Lucy: a 71M-parameter unconditional face diffusion model trained from scratch},
240
+ author = {OpenCerebral},
241
+ year = {2026},
242
+ howpublished = {\url{https://huggingface.co/opencerebral/Lucy}}
243
+ }
244
+ ```
model_index.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "DDPMPipeline",
3
+ "_diffusers_version": "0.39.0",
4
+ "scheduler": [
5
+ "diffusers",
6
+ "DDPMScheduler"
7
+ ],
8
+ "unet": [
9
+ "diffusers",
10
+ "UNet2DModel"
11
+ ]
12
+ }
samples/one_face.png ADDED
samples/sample_grid.png ADDED

Git LFS Details

  • SHA256: 8ad27efa4e8141ef3e671a6e57de73ecc7b19fc00938ab5d52ce946ff8a40e88
  • Pointer size: 131 Bytes
  • Size of remote file: 466 kB
scheduler/scheduler_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "DDPMScheduler",
3
+ "_diffusers_version": "0.39.0",
4
+ "beta_end": 0.02,
5
+ "beta_schedule": "linear",
6
+ "beta_start": 0.0001,
7
+ "clip_sample": true,
8
+ "clip_sample_range": 1.0,
9
+ "dynamic_thresholding_ratio": 0.995,
10
+ "num_train_timesteps": 1000,
11
+ "prediction_type": "epsilon",
12
+ "rescale_betas_zero_snr": false,
13
+ "sample_max_value": 1.0,
14
+ "steps_offset": 0,
15
+ "thresholding": false,
16
+ "timestep_spacing": "leading",
17
+ "trained_betas": null,
18
+ "variance_type": "fixed_small"
19
+ }
training/progress/step_0003000.png ADDED

Git LFS Details

  • SHA256: dc816e5cf83014558ae07caeebc6236e5eed7edf44fc662c7c4a0adb0676da0e
  • Pointer size: 131 Bytes
  • Size of remote file: 723 kB
training/progress/step_0006000.png ADDED

Git LFS Details

  • SHA256: 94baca99c6e17e39e71e54e6b68d1e35ac7eb2db5b964366340179e0d6d78e9b
  • Pointer size: 131 Bytes
  • Size of remote file: 564 kB
training/progress/step_0009000.png ADDED

Git LFS Details

  • SHA256: cdd2db8d95d67e3021a553a35540892244f256da2d03a18fabc7891841ac508e
  • Pointer size: 131 Bytes
  • Size of remote file: 512 kB
training/progress/step_0012000.png ADDED

Git LFS Details

  • SHA256: b9bf3f5ec94a9f6ca7e9338fdc3fd8bb4810311ee9a63bb03d8ee43333a67c9a
  • Pointer size: 131 Bytes
  • Size of remote file: 481 kB
training/progress/step_0015000.png ADDED

Git LFS Details

  • SHA256: 3b1ae89cc81b2d3ec5a82d2ef2097d4e1dba42c49fd1bfc7a21b4f7cc0c57d00
  • Pointer size: 131 Bytes
  • Size of remote file: 429 kB
training/progress/step_0018000.png ADDED

Git LFS Details

  • SHA256: ad0b0ba556c94bc7f85ca9fe4ad3a8408b24334ea1428e46b0fcdfc8978ecc74
  • Pointer size: 131 Bytes
  • Size of remote file: 376 kB
training/progress/step_0021000.png ADDED

Git LFS Details

  • SHA256: db433a8f840d177f600cdcf7a11644a0bf4bd23b6548a1663f3675d9d6772603
  • Pointer size: 131 Bytes
  • Size of remote file: 355 kB
training/progress/step_0024000.png ADDED

Git LFS Details

  • SHA256: e8f201e52e6586e569183ffa5124fdebb52f1aec1e240632adb7783e2514795d
  • Pointer size: 131 Bytes
  • Size of remote file: 362 kB
training/progress/step_0027000.png ADDED

Git LFS Details

  • SHA256: d9268bfa7752aac3de53b0656b1d29c90c8cae1e14baa1ca884b074b9df79fe6
  • Pointer size: 131 Bytes
  • Size of remote file: 397 kB
training/progress/step_0030000.png ADDED

Git LFS Details

  • SHA256: 977bdac09bb9b0d02d78eff700cbe6516018d699c1c534c1d057da816fa13ae0
  • Pointer size: 131 Bytes
  • Size of remote file: 430 kB
training/progress/step_0033000.png ADDED

Git LFS Details

  • SHA256: 384182e2beef94284ccfaee36a6993b02fc5f4fc774ab7c52f4c44a7be3f2526
  • Pointer size: 131 Bytes
  • Size of remote file: 459 kB
training/progress/step_0036000.png ADDED

Git LFS Details

  • SHA256: b463a8805cb6b333ab6125c0a70584c63b66bc4586db46a4068d7fa08672d2d5
  • Pointer size: 131 Bytes
  • Size of remote file: 482 kB
training/progress/step_0039000.png ADDED

Git LFS Details

  • SHA256: f6991a9273638144d1ec57cd11e55e76d8a9917fed36f3d7a84482a6f96b6443
  • Pointer size: 131 Bytes
  • Size of remote file: 494 kB
training/progress/step_0042000.png ADDED

Git LFS Details

  • SHA256: c877fbab3577d1f78d64c5b373ff0b66144e445d3f57592a4e2d7c9d44678c58
  • Pointer size: 131 Bytes
  • Size of remote file: 497 kB
training/progress/step_0045000.png ADDED

Git LFS Details

  • SHA256: 9b318f922fe235286f6c40e428b2131dd105668518ce23511b9d983a6f61f990
  • Pointer size: 131 Bytes
  • Size of remote file: 494 kB
training/progress/step_0048000.png ADDED

Git LFS Details

  • SHA256: 8c420454a8b52d3447ab6057635a76b37f6558702d690e2641f1f9f3744caf13
  • Pointer size: 131 Bytes
  • Size of remote file: 486 kB
training/progress/step_0051000.png ADDED

Git LFS Details

  • SHA256: e7c09f8644526d599bed6b5848dc28954022a8d2f42f0bd2fa96fdeaf3683985
  • Pointer size: 131 Bytes
  • Size of remote file: 476 kB
training/progress/step_0054000.png ADDED

Git LFS Details

  • SHA256: 3df6e558a547479b03a647972437eef67030879fa3823b56fe84d026dde022cb
  • Pointer size: 131 Bytes
  • Size of remote file: 463 kB
training/progress/step_0057000.png ADDED

Git LFS Details

  • SHA256: 9d9fa71baddf374adb8454ced6830f1811c3766fef080e9ecc8b73d23b364e97
  • Pointer size: 131 Bytes
  • Size of remote file: 454 kB
training/progress/step_0060000.png ADDED

Git LFS Details

  • SHA256: 0e625af84262e66fec09208ca5495f71958cae5a4782a215fbcfe43850a7948f
  • Pointer size: 131 Bytes
  • Size of remote file: 448 kB
training/run.sh ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Overnight pretraining run (RTX 3060). Launch detached:
3
+ # nohup bash run.sh > train.log 2>&1 &
4
+ # or inside tmux: tmux new -s train 'bash run.sh'
5
+ set -euo pipefail
6
+ cd "$(dirname "$0")"
7
+ export HF_HOME=/media/joseph/Media/.hf-cache
8
+ export TOKENIZERS_PARALLELISM=false
9
+
10
+ exec ./.venv/bin/python -u train.py \
11
+ --dataset_name tglcourse/CelebA-faces-cropped-128 \
12
+ --resolution 128 \
13
+ --train_batch_size 16 \
14
+ --max_train_steps 60000 \
15
+ --max_hours 13.5 \
16
+ --output_dir /media/joseph/Media/diffusion128/runs/celeba128
training/train.log ADDED
@@ -0,0 +1,603 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Warning: You are sending unauthenticated requests to the HF Hub. Please set a HF_TOKEN to enable higher rate limits and faster downloads.
2
+ model params: 71.4M | dataset rows: 192469 | batch 16 x accum 1
3
+ step 100/60000 | epoch 0 | loss 0.5997 | grad 0.28 | 1.49 it/s | ETA 11.16h
4
+ step 200/60000 | epoch 0 | loss 0.0715 | grad 0.17 | 1.56 it/s | ETA 10.64h
5
+ step 300/60000 | epoch 0 | loss 0.0467 | grad 0.42 | 1.60 it/s | ETA 10.33h
6
+ step 400/60000 | epoch 0 | loss 0.0403 | grad 0.37 | 1.63 it/s | ETA 10.15h
7
+ step 500/60000 | epoch 0 | loss 0.0346 | grad 0.59 | 1.65 it/s | ETA 10.02h
8
+ step 600/60000 | epoch 0 | loss 0.0279 | grad 0.25 | 1.66 it/s | ETA 9.93h
9
+ step 700/60000 | epoch 0 | loss 0.0225 | grad 0.17 | 1.67 it/s | ETA 9.86h
10
+ step 800/60000 | epoch 0 | loss 0.0265 | grad 0.15 | 1.68 it/s | ETA 9.80h
11
+ step 900/60000 | epoch 0 | loss 0.0232 | grad 0.11 | 1.68 it/s | ETA 9.76h
12
+ step 1000/60000 | epoch 0 | loss 0.0219 | grad 0.26 | 1.68 it/s | ETA 9.74h
13
+ step 1100/60000 | epoch 0 | loss 0.0199 | grad 0.37 | 1.68 it/s | ETA 9.72h
14
+ step 1200/60000 | epoch 0 | loss 0.0201 | grad 0.06 | 1.68 it/s | ETA 9.72h
15
+ step 1300/60000 | epoch 0 | loss 0.0205 | grad 0.29 | 1.68 it/s | ETA 9.72h
16
+ step 1400/60000 | epoch 0 | loss 0.0195 | grad 0.25 | 1.68 it/s | ETA 9.71h
17
+ step 1500/60000 | epoch 0 | loss 0.0192 | grad 0.20 | 1.68 it/s | ETA 9.70h
18
+ step 1600/60000 | epoch 0 | loss 0.0172 | grad 0.17 | 1.67 it/s | ETA 9.69h
19
+ step 1700/60000 | epoch 0 | loss 0.0173 | grad 0.21 | 1.67 it/s | ETA 9.69h
20
+ step 1800/60000 | epoch 0 | loss 0.0187 | grad 0.18 | 1.67 it/s | ETA 9.68h
21
+ step 1900/60000 | epoch 0 | loss 0.0169 | grad 0.18 | 1.67 it/s | ETA 9.66h
22
+ step 2000/60000 | epoch 0 | loss 0.0166 | grad 0.20 | 1.67 it/s | ETA 9.63h
23
+ step 2100/60000 | epoch 0 | loss 0.0191 | grad 0.10 | 1.67 it/s | ETA 9.60h
24
+ step 2200/60000 | epoch 0 | loss 0.0185 | grad 0.16 | 1.68 it/s | ETA 9.58h
25
+ step 2300/60000 | epoch 0 | loss 0.0191 | grad 0.11 | 1.67 it/s | ETA 9.58h
26
+ step 2400/60000 | epoch 0 | loss 0.0169 | grad 0.16 | 1.67 it/s | ETA 9.59h
27
+ step 2500/60000 | epoch 0 | loss 0.0190 | grad 0.11 | 1.66 it/s | ETA 9.59h
28
+ step 2600/60000 | epoch 0 | loss 0.0195 | grad 0.12 | 1.66 it/s | ETA 9.60h
29
+ step 2700/60000 | epoch 0 | loss 0.0190 | grad 0.07 | 1.66 it/s | ETA 9.60h
30
+ step 2800/60000 | epoch 0 | loss 0.0172 | grad 0.15 | 1.66 it/s | ETA 9.60h
31
+ step 2900/60000 | epoch 0 | loss 0.0154 | grad 0.16 | 1.65 it/s | ETA 9.59h
32
+ step 3000/60000 | epoch 0 | loss 0.0188 | grad 0.12 | 1.65 it/s | ETA 9.59h
33
+ step 3100/60000 | epoch 0 | loss 0.0165 | grad 0.05 | 1.64 it/s | ETA 9.64h
34
+ step 3200/60000 | epoch 0 | loss 0.0166 | grad 0.08 | 1.64 it/s | ETA 9.64h
35
+ step 3300/60000 | epoch 0 | loss 0.0158 | grad 0.13 | 1.64 it/s | ETA 9.63h
36
+ step 3400/60000 | epoch 0 | loss 0.0167 | grad 0.08 | 1.63 it/s | ETA 9.62h
37
+ step 3500/60000 | epoch 0 | loss 0.0165 | grad 0.28 | 1.63 it/s | ETA 9.61h
38
+ step 3600/60000 | epoch 0 | loss 0.0154 | grad 0.25 | 1.63 it/s | ETA 9.61h
39
+ step 3700/60000 | epoch 0 | loss 0.0170 | grad 0.23 | 1.63 it/s | ETA 9.60h
40
+ step 3800/60000 | epoch 0 | loss 0.0168 | grad 0.15 | 1.63 it/s | ETA 9.58h
41
+ step 3900/60000 | epoch 0 | loss 0.0167 | grad 0.08 | 1.63 it/s | ETA 9.54h
42
+ step 4000/60000 | epoch 0 | loss 0.0160 | grad 0.14 | 1.64 it/s | ETA 9.50h
43
+ step 4100/60000 | epoch 0 | loss 0.0178 | grad 0.05 | 1.64 it/s | ETA 9.46h
44
+ step 4200/60000 | epoch 0 | loss 0.0178 | grad 0.17 | 1.65 it/s | ETA 9.42h
45
+ step 4300/60000 | epoch 0 | loss 0.0170 | grad 0.05 | 1.65 it/s | ETA 9.38h
46
+ step 4400/60000 | epoch 0 | loss 0.0164 | grad 0.03 | 1.65 it/s | ETA 9.34h
47
+ step 4500/60000 | epoch 0 | loss 0.0164 | grad 0.18 | 1.66 it/s | ETA 9.31h
48
+ step 4600/60000 | epoch 0 | loss 0.0167 | grad 0.17 | 1.66 it/s | ETA 9.27h
49
+ step 4700/60000 | epoch 0 | loss 0.0160 | grad 0.12 | 1.66 it/s | ETA 9.24h
50
+ step 4800/60000 | epoch 0 | loss 0.0141 | grad 0.07 | 1.67 it/s | ETA 9.20h
51
+ step 4900/60000 | epoch 0 | loss 0.0182 | grad 0.17 | 1.67 it/s | ETA 9.17h
52
+ step 5000/60000 | epoch 0 | loss 0.0154 | grad 0.05 | 1.67 it/s | ETA 9.14h
53
+ step 5100/60000 | epoch 0 | loss 0.0180 | grad 0.09 | 1.67 it/s | ETA 9.10h
54
+ step 5200/60000 | epoch 0 | loss 0.0159 | grad 0.13 | 1.68 it/s | ETA 9.07h
55
+ step 5300/60000 | epoch 0 | loss 0.0152 | grad 0.21 | 1.68 it/s | ETA 9.04h
56
+ step 5400/60000 | epoch 0 | loss 0.0161 | grad 0.21 | 1.68 it/s | ETA 9.01h
57
+ step 5500/60000 | epoch 0 | loss 0.0159 | grad 0.10 | 1.69 it/s | ETA 8.98h
58
+ step 5600/60000 | epoch 0 | loss 0.0153 | grad 0.04 | 1.69 it/s | ETA 8.96h
59
+ step 5700/60000 | epoch 0 | loss 0.0150 | grad 0.13 | 1.69 it/s | ETA 8.93h
60
+ step 5800/60000 | epoch 0 | loss 0.0169 | grad 0.07 | 1.69 it/s | ETA 8.91h
61
+ step 5900/60000 | epoch 0 | loss 0.0169 | grad 0.19 | 1.69 it/s | ETA 8.91h
62
+ step 6000/60000 | epoch 0 | loss 0.0144 | grad 0.16 | 1.68 it/s | ETA 8.91h
63
+ step 6100/60000 | epoch 0 | loss 0.0161 | grad 0.11 | 1.68 it/s | ETA 8.93h
64
+ step 6200/60000 | epoch 0 | loss 0.0156 | grad 0.23 | 1.67 it/s | ETA 8.93h
65
+ step 6300/60000 | epoch 0 | loss 0.0157 | grad 0.12 | 1.67 it/s | ETA 8.93h
66
+ step 6400/60000 | epoch 0 | loss 0.0185 | grad 0.11 | 1.67 it/s | ETA 8.92h
67
+ step 6500/60000 | epoch 0 | loss 0.0141 | grad 0.12 | 1.67 it/s | ETA 8.92h
68
+ step 6600/60000 | epoch 0 | loss 0.0165 | grad 0.10 | 1.66 it/s | ETA 8.91h
69
+ step 6700/60000 | epoch 0 | loss 0.0137 | grad 0.11 | 1.66 it/s | ETA 8.91h
70
+ step 6800/60000 | epoch 0 | loss 0.0178 | grad 0.08 | 1.66 it/s | ETA 8.90h
71
+ step 6900/60000 | epoch 0 | loss 0.0151 | grad 0.12 | 1.66 it/s | ETA 8.90h
72
+ step 7000/60000 | epoch 0 | loss 0.0151 | grad 0.13 | 1.65 it/s | ETA 8.90h
73
+ step 7100/60000 | epoch 0 | loss 0.0164 | grad 0.10 | 1.65 it/s | ETA 8.89h
74
+ step 7200/60000 | epoch 0 | loss 0.0175 | grad 0.11 | 1.65 it/s | ETA 8.88h
75
+ step 7300/60000 | epoch 0 | loss 0.0169 | grad 0.05 | 1.65 it/s | ETA 8.88h
76
+ step 7400/60000 | epoch 0 | loss 0.0165 | grad 0.12 | 1.65 it/s | ETA 8.88h
77
+ step 7500/60000 | epoch 0 | loss 0.0158 | grad 0.10 | 1.64 it/s | ETA 8.88h
78
+ step 7600/60000 | epoch 0 | loss 0.0173 | grad 0.03 | 1.64 it/s | ETA 8.87h
79
+ step 7700/60000 | epoch 0 | loss 0.0134 | grad 0.07 | 1.64 it/s | ETA 8.87h
80
+ step 7800/60000 | epoch 0 | loss 0.0142 | grad 0.11 | 1.64 it/s | ETA 8.86h
81
+ step 7900/60000 | epoch 0 | loss 0.0153 | grad 0.16 | 1.63 it/s | ETA 8.86h
82
+ step 8000/60000 | epoch 0 | loss 0.0159 | grad 0.03 | 1.63 it/s | ETA 8.85h
83
+ step 8100/60000 | epoch 0 | loss 0.0163 | grad 0.05 | 1.63 it/s | ETA 8.85h
84
+ step 8200/60000 | epoch 0 | loss 0.0143 | grad 0.12 | 1.63 it/s | ETA 8.84h
85
+ step 8300/60000 | epoch 0 | loss 0.0157 | grad 0.06 | 1.63 it/s | ETA 8.84h
86
+ step 8400/60000 | epoch 0 | loss 0.0149 | grad 0.09 | 1.62 it/s | ETA 8.83h
87
+ step 8500/60000 | epoch 0 | loss 0.0141 | grad 0.10 | 1.62 it/s | ETA 8.82h
88
+ step 8600/60000 | epoch 0 | loss 0.0149 | grad 0.12 | 1.62 it/s | ETA 8.81h
89
+ step 8700/60000 | epoch 0 | loss 0.0164 | grad 0.07 | 1.62 it/s | ETA 8.81h
90
+ step 8800/60000 | epoch 0 | loss 0.0160 | grad 0.16 | 1.62 it/s | ETA 8.80h
91
+ step 8900/60000 | epoch 0 | loss 0.0151 | grad 0.14 | 1.62 it/s | ETA 8.79h
92
+ step 9000/60000 | epoch 0 | loss 0.0182 | grad 0.08 | 1.61 it/s | ETA 8.78h
93
+ step 9100/60000 | epoch 0 | loss 0.0149 | grad 0.12 | 1.61 it/s | ETA 8.79h
94
+ step 9200/60000 | epoch 0 | loss 0.0173 | grad 0.08 | 1.61 it/s | ETA 8.78h
95
+ step 9300/60000 | epoch 0 | loss 0.0143 | grad 0.10 | 1.61 it/s | ETA 8.77h
96
+ step 9400/60000 | epoch 0 | loss 0.0135 | grad 0.12 | 1.60 it/s | ETA 8.76h
97
+ step 9500/60000 | epoch 0 | loss 0.0152 | grad 0.08 | 1.61 it/s | ETA 8.74h
98
+ step 9600/60000 | epoch 0 | loss 0.0141 | grad 0.09 | 1.61 it/s | ETA 8.71h
99
+ step 9700/60000 | epoch 0 | loss 0.0159 | grad 0.09 | 1.61 it/s | ETA 8.69h
100
+ step 9800/60000 | epoch 0 | loss 0.0161 | grad 0.08 | 1.61 it/s | ETA 8.66h
101
+ step 9900/60000 | epoch 0 | loss 0.0156 | grad 0.08 | 1.61 it/s | ETA 8.64h
102
+ step 10000/60000 | epoch 0 | loss 0.0136 | grad 0.06 | 1.61 it/s | ETA 8.61h
103
+ step 10100/60000 | epoch 0 | loss 0.0138 | grad 0.09 | 1.61 it/s | ETA 8.59h
104
+ step 10200/60000 | epoch 0 | loss 0.0151 | grad 0.03 | 1.62 it/s | ETA 8.56h
105
+ step 10300/60000 | epoch 0 | loss 0.0153 | grad 0.05 | 1.62 it/s | ETA 8.54h
106
+ step 10400/60000 | epoch 0 | loss 0.0136 | grad 0.09 | 1.62 it/s | ETA 8.52h
107
+ step 10500/60000 | epoch 0 | loss 0.0151 | grad 0.12 | 1.62 it/s | ETA 8.49h
108
+ step 10600/60000 | epoch 0 | loss 0.0150 | grad 0.10 | 1.62 it/s | ETA 8.47h
109
+ step 10700/60000 | epoch 0 | loss 0.0151 | grad 0.10 | 1.62 it/s | ETA 8.45h
110
+ step 10800/60000 | epoch 0 | loss 0.0159 | grad 0.12 | 1.62 it/s | ETA 8.42h
111
+ step 10900/60000 | epoch 0 | loss 0.0157 | grad 0.09 | 1.62 it/s | ETA 8.40h
112
+ step 11000/60000 | epoch 0 | loss 0.0146 | grad 0.08 | 1.62 it/s | ETA 8.38h
113
+ step 11100/60000 | epoch 0 | loss 0.0146 | grad 0.08 | 1.63 it/s | ETA 8.35h
114
+ step 11200/60000 | epoch 0 | loss 0.0171 | grad 0.10 | 1.63 it/s | ETA 8.33h
115
+ step 11300/60000 | epoch 0 | loss 0.0154 | grad 0.09 | 1.63 it/s | ETA 8.31h
116
+ step 11400/60000 | epoch 0 | loss 0.0151 | grad 0.05 | 1.63 it/s | ETA 8.29h
117
+ step 11500/60000 | epoch 0 | loss 0.0150 | grad 0.06 | 1.63 it/s | ETA 8.26h
118
+ step 11600/60000 | epoch 0 | loss 0.0152 | grad 0.13 | 1.63 it/s | ETA 8.24h
119
+ step 11700/60000 | epoch 0 | loss 0.0154 | grad 0.10 | 1.63 it/s | ETA 8.22h
120
+ step 11800/60000 | epoch 0 | loss 0.0150 | grad 0.05 | 1.63 it/s | ETA 8.20h
121
+ step 11900/60000 | epoch 0 | loss 0.0149 | grad 0.20 | 1.63 it/s | ETA 8.17h
122
+ step 12000/60000 | epoch 0 | loss 0.0166 | grad 0.02 | 1.64 it/s | ETA 8.15h
123
+ step 12100/60000 | epoch 1 | loss 0.0149 | grad 0.07 | 1.63 it/s | ETA 8.14h
124
+ step 12200/60000 | epoch 1 | loss 0.0145 | grad 0.08 | 1.63 it/s | ETA 8.12h
125
+ step 12300/60000 | epoch 1 | loss 0.0139 | grad 0.05 | 1.64 it/s | ETA 8.10h
126
+ step 12400/60000 | epoch 1 | loss 0.0151 | grad 0.20 | 1.64 it/s | ETA 8.08h
127
+ step 12500/60000 | epoch 1 | loss 0.0156 | grad 0.08 | 1.64 it/s | ETA 8.06h
128
+ step 12600/60000 | epoch 1 | loss 0.0169 | grad 0.08 | 1.64 it/s | ETA 8.03h
129
+ step 12700/60000 | epoch 1 | loss 0.0148 | grad 0.08 | 1.64 it/s | ETA 8.01h
130
+ step 12800/60000 | epoch 1 | loss 0.0150 | grad 0.12 | 1.64 it/s | ETA 7.99h
131
+ step 12900/60000 | epoch 1 | loss 0.0157 | grad 0.05 | 1.64 it/s | ETA 7.97h
132
+ step 13000/60000 | epoch 1 | loss 0.0144 | grad 0.08 | 1.64 it/s | ETA 7.95h
133
+ step 13100/60000 | epoch 1 | loss 0.0160 | grad 0.08 | 1.64 it/s | ETA 7.93h
134
+ step 13200/60000 | epoch 1 | loss 0.0151 | grad 0.03 | 1.64 it/s | ETA 7.91h
135
+ step 13300/60000 | epoch 1 | loss 0.0155 | grad 0.07 | 1.64 it/s | ETA 7.89h
136
+ step 13400/60000 | epoch 1 | loss 0.0142 | grad 0.11 | 1.65 it/s | ETA 7.87h
137
+ step 13500/60000 | epoch 1 | loss 0.0158 | grad 0.05 | 1.65 it/s | ETA 7.85h
138
+ step 13600/60000 | epoch 1 | loss 0.0145 | grad 0.09 | 1.65 it/s | ETA 7.83h
139
+ step 13700/60000 | epoch 1 | loss 0.0139 | grad 0.06 | 1.65 it/s | ETA 7.80h
140
+ step 13800/60000 | epoch 1 | loss 0.0143 | grad 0.11 | 1.65 it/s | ETA 7.78h
141
+ step 13900/60000 | epoch 1 | loss 0.0140 | grad 0.13 | 1.65 it/s | ETA 7.76h
142
+ step 14000/60000 | epoch 1 | loss 0.0136 | grad 0.06 | 1.65 it/s | ETA 7.74h
143
+ step 14100/60000 | epoch 1 | loss 0.0151 | grad 0.14 | 1.65 it/s | ETA 7.72h
144
+ step 14200/60000 | epoch 1 | loss 0.0127 | grad 0.09 | 1.65 it/s | ETA 7.70h
145
+ step 14300/60000 | epoch 1 | loss 0.0151 | grad 0.09 | 1.65 it/s | ETA 7.68h
146
+ step 14400/60000 | epoch 1 | loss 0.0150 | grad 0.08 | 1.65 it/s | ETA 7.66h
147
+ step 14500/60000 | epoch 1 | loss 0.0144 | grad 0.10 | 1.65 it/s | ETA 7.64h
148
+ step 14600/60000 | epoch 1 | loss 0.0146 | grad 0.03 | 1.65 it/s | ETA 7.62h
149
+ step 14700/60000 | epoch 1 | loss 0.0155 | grad 0.11 | 1.66 it/s | ETA 7.60h
150
+ step 14800/60000 | epoch 1 | loss 0.0157 | grad 0.08 | 1.66 it/s | ETA 7.58h
151
+ step 14900/60000 | epoch 1 | loss 0.0139 | grad 0.09 | 1.66 it/s | ETA 7.56h
152
+ step 15000/60000 | epoch 1 | loss 0.0139 | grad 0.07 | 1.66 it/s | ETA 7.55h
153
+ step 15100/60000 | epoch 1 | loss 0.0146 | grad 0.05 | 1.65 it/s | ETA 7.55h
154
+ step 15200/60000 | epoch 1 | loss 0.0140 | grad 0.10 | 1.65 it/s | ETA 7.53h
155
+ step 15300/60000 | epoch 1 | loss 0.0143 | grad 0.06 | 1.65 it/s | ETA 7.52h
156
+ step 15400/60000 | epoch 1 | loss 0.0143 | grad 0.04 | 1.65 it/s | ETA 7.51h
157
+ step 15500/60000 | epoch 1 | loss 0.0137 | grad 0.13 | 1.65 it/s | ETA 7.50h
158
+ step 15600/60000 | epoch 1 | loss 0.0141 | grad 0.12 | 1.65 it/s | ETA 7.48h
159
+ step 15700/60000 | epoch 1 | loss 0.0138 | grad 0.11 | 1.65 it/s | ETA 7.47h
160
+ step 15800/60000 | epoch 1 | loss 0.0148 | grad 0.03 | 1.65 it/s | ETA 7.46h
161
+ step 15900/60000 | epoch 1 | loss 0.0147 | grad 0.09 | 1.65 it/s | ETA 7.44h
162
+ step 16000/60000 | epoch 1 | loss 0.0157 | grad 0.07 | 1.65 it/s | ETA 7.43h
163
+ step 16100/60000 | epoch 1 | loss 0.0143 | grad 0.06 | 1.64 it/s | ETA 7.41h
164
+ step 16200/60000 | epoch 1 | loss 0.0166 | grad 0.05 | 1.64 it/s | ETA 7.40h
165
+ step 16300/60000 | epoch 1 | loss 0.0139 | grad 0.07 | 1.64 it/s | ETA 7.38h
166
+ step 16400/60000 | epoch 1 | loss 0.0149 | grad 0.10 | 1.64 it/s | ETA 7.37h
167
+ step 16500/60000 | epoch 1 | loss 0.0141 | grad 0.04 | 1.64 it/s | ETA 7.35h
168
+ step 16600/60000 | epoch 1 | loss 0.0149 | grad 0.11 | 1.64 it/s | ETA 7.34h
169
+ step 16700/60000 | epoch 1 | loss 0.0141 | grad 0.10 | 1.64 it/s | ETA 7.32h
170
+ step 16800/60000 | epoch 1 | loss 0.0143 | grad 0.08 | 1.64 it/s | ETA 7.31h
171
+ step 16900/60000 | epoch 1 | loss 0.0136 | grad 0.12 | 1.64 it/s | ETA 7.29h
172
+ step 17000/60000 | epoch 1 | loss 0.0150 | grad 0.03 | 1.64 it/s | ETA 7.28h
173
+ step 17100/60000 | epoch 1 | loss 0.0148 | grad 0.14 | 1.64 it/s | ETA 7.26h
174
+ step 17200/60000 | epoch 1 | loss 0.0153 | grad 0.04 | 1.64 it/s | ETA 7.25h
175
+ step 17300/60000 | epoch 1 | loss 0.0143 | grad 0.11 | 1.64 it/s | ETA 7.23h
176
+ step 17400/60000 | epoch 1 | loss 0.0150 | grad 0.08 | 1.64 it/s | ETA 7.22h
177
+ step 17500/60000 | epoch 1 | loss 0.0142 | grad 0.12 | 1.64 it/s | ETA 7.20h
178
+ step 17600/60000 | epoch 1 | loss 0.0139 | grad 0.04 | 1.64 it/s | ETA 7.18h
179
+ step 17700/60000 | epoch 1 | loss 0.0140 | grad 0.06 | 1.64 it/s | ETA 7.17h
180
+ step 17800/60000 | epoch 1 | loss 0.0125 | grad 0.07 | 1.64 it/s | ETA 7.15h
181
+ step 17900/60000 | epoch 1 | loss 0.0163 | grad 0.09 | 1.64 it/s | ETA 7.14h
182
+ step 18000/60000 | epoch 1 | loss 0.0129 | grad 0.03 | 1.64 it/s | ETA 7.12h
183
+ step 18100/60000 | epoch 1 | loss 0.0153 | grad 0.06 | 1.64 it/s | ETA 7.12h
184
+ step 18200/60000 | epoch 1 | loss 0.0165 | grad 0.07 | 1.63 it/s | ETA 7.10h
185
+ step 18300/60000 | epoch 1 | loss 0.0141 | grad 0.09 | 1.63 it/s | ETA 7.09h
186
+ step 18400/60000 | epoch 1 | loss 0.0150 | grad 0.08 | 1.63 it/s | ETA 7.07h
187
+ step 18500/60000 | epoch 1 | loss 0.0159 | grad 0.12 | 1.63 it/s | ETA 7.06h
188
+ step 18600/60000 | epoch 1 | loss 0.0125 | grad 0.10 | 1.63 it/s | ETA 7.04h
189
+ step 18700/60000 | epoch 1 | loss 0.0140 | grad 0.04 | 1.63 it/s | ETA 7.03h
190
+ step 18800/60000 | epoch 1 | loss 0.0130 | grad 0.08 | 1.63 it/s | ETA 7.01h
191
+ step 18900/60000 | epoch 1 | loss 0.0153 | grad 0.09 | 1.63 it/s | ETA 6.99h
192
+ step 19000/60000 | epoch 1 | loss 0.0163 | grad 0.08 | 1.63 it/s | ETA 6.98h
193
+ step 19100/60000 | epoch 1 | loss 0.0131 | grad 0.04 | 1.63 it/s | ETA 6.96h
194
+ step 19200/60000 | epoch 1 | loss 0.0148 | grad 0.12 | 1.63 it/s | ETA 6.95h
195
+ step 19300/60000 | epoch 1 | loss 0.0130 | grad 0.09 | 1.63 it/s | ETA 6.93h
196
+ step 19400/60000 | epoch 1 | loss 0.0140 | grad 0.09 | 1.63 it/s | ETA 6.91h
197
+ step 19500/60000 | epoch 1 | loss 0.0138 | grad 0.05 | 1.63 it/s | ETA 6.90h
198
+ step 19600/60000 | epoch 1 | loss 0.0150 | grad 0.06 | 1.63 it/s | ETA 6.88h
199
+ step 19700/60000 | epoch 1 | loss 0.0146 | grad 0.08 | 1.63 it/s | ETA 6.87h
200
+ step 19800/60000 | epoch 1 | loss 0.0133 | grad 0.07 | 1.63 it/s | ETA 6.85h
201
+ step 19900/60000 | epoch 1 | loss 0.0137 | grad 0.08 | 1.63 it/s | ETA 6.83h
202
+ step 20000/60000 | epoch 1 | loss 0.0146 | grad 0.09 | 1.63 it/s | ETA 6.80h
203
+ step 20100/60000 | epoch 1 | loss 0.0144 | grad 0.11 | 1.63 it/s | ETA 6.78h
204
+ step 20200/60000 | epoch 1 | loss 0.0151 | grad 0.03 | 1.63 it/s | ETA 6.76h
205
+ step 20300/60000 | epoch 1 | loss 0.0148 | grad 0.06 | 1.64 it/s | ETA 6.74h
206
+ step 20400/60000 | epoch 1 | loss 0.0144 | grad 0.07 | 1.64 it/s | ETA 6.72h
207
+ step 20500/60000 | epoch 1 | loss 0.0141 | grad 0.09 | 1.64 it/s | ETA 6.70h
208
+ step 20600/60000 | epoch 1 | loss 0.0142 | grad 0.10 | 1.64 it/s | ETA 6.68h
209
+ step 20700/60000 | epoch 1 | loss 0.0132 | grad 0.08 | 1.64 it/s | ETA 6.66h
210
+ step 20800/60000 | epoch 1 | loss 0.0137 | grad 0.06 | 1.64 it/s | ETA 6.64h
211
+ step 20900/60000 | epoch 1 | loss 0.0131 | grad 0.02 | 1.64 it/s | ETA 6.62h
212
+ step 21000/60000 | epoch 1 | loss 0.0132 | grad 0.12 | 1.64 it/s | ETA 6.60h
213
+ step 21100/60000 | epoch 1 | loss 0.0144 | grad 0.09 | 1.64 it/s | ETA 6.59h
214
+ step 21200/60000 | epoch 1 | loss 0.0133 | grad 0.04 | 1.64 it/s | ETA 6.57h
215
+ step 21300/60000 | epoch 1 | loss 0.0127 | grad 0.11 | 1.64 it/s | ETA 6.55h
216
+ step 21400/60000 | epoch 1 | loss 0.0139 | grad 0.02 | 1.64 it/s | ETA 6.53h
217
+ step 21500/60000 | epoch 1 | loss 0.0145 | grad 0.10 | 1.64 it/s | ETA 6.51h
218
+ step 21600/60000 | epoch 1 | loss 0.0128 | grad 0.03 | 1.64 it/s | ETA 6.49h
219
+ step 21700/60000 | epoch 1 | loss 0.0143 | grad 0.06 | 1.64 it/s | ETA 6.47h
220
+ step 21800/60000 | epoch 1 | loss 0.0153 | grad 0.07 | 1.65 it/s | ETA 6.45h
221
+ step 21900/60000 | epoch 1 | loss 0.0140 | grad 0.03 | 1.65 it/s | ETA 6.43h
222
+ step 22000/60000 | epoch 1 | loss 0.0152 | grad 0.04 | 1.65 it/s | ETA 6.41h
223
+ step 22100/60000 | epoch 1 | loss 0.0137 | grad 0.06 | 1.65 it/s | ETA 6.39h
224
+ step 22200/60000 | epoch 1 | loss 0.0137 | grad 0.08 | 1.65 it/s | ETA 6.37h
225
+ step 22300/60000 | epoch 1 | loss 0.0142 | grad 0.07 | 1.65 it/s | ETA 6.35h
226
+ step 22400/60000 | epoch 1 | loss 0.0133 | grad 0.11 | 1.65 it/s | ETA 6.33h
227
+ step 22500/60000 | epoch 1 | loss 0.0128 | grad 0.10 | 1.65 it/s | ETA 6.31h
228
+ step 22600/60000 | epoch 1 | loss 0.0131 | grad 0.09 | 1.65 it/s | ETA 6.29h
229
+ step 22700/60000 | epoch 1 | loss 0.0155 | grad 0.07 | 1.65 it/s | ETA 6.27h
230
+ step 22800/60000 | epoch 1 | loss 0.0140 | grad 0.13 | 1.65 it/s | ETA 6.25h
231
+ step 22900/60000 | epoch 1 | loss 0.0136 | grad 0.09 | 1.65 it/s | ETA 6.23h
232
+ step 23000/60000 | epoch 1 | loss 0.0151 | grad 0.10 | 1.65 it/s | ETA 6.21h
233
+ step 23100/60000 | epoch 1 | loss 0.0146 | grad 0.10 | 1.65 it/s | ETA 6.19h
234
+ step 23200/60000 | epoch 1 | loss 0.0125 | grad 0.06 | 1.66 it/s | ETA 6.18h
235
+ step 23300/60000 | epoch 1 | loss 0.0132 | grad 0.07 | 1.66 it/s | ETA 6.16h
236
+ step 23400/60000 | epoch 1 | loss 0.0144 | grad 0.18 | 1.66 it/s | ETA 6.14h
237
+ step 23500/60000 | epoch 1 | loss 0.0134 | grad 0.10 | 1.66 it/s | ETA 6.12h
238
+ step 23600/60000 | epoch 1 | loss 0.0148 | grad 0.08 | 1.66 it/s | ETA 6.10h
239
+ step 23700/60000 | epoch 1 | loss 0.0147 | grad 0.07 | 1.66 it/s | ETA 6.08h
240
+ step 23800/60000 | epoch 1 | loss 0.0138 | grad 0.02 | 1.66 it/s | ETA 6.06h
241
+ step 23900/60000 | epoch 1 | loss 0.0138 | grad 0.06 | 1.66 it/s | ETA 6.04h
242
+ step 24000/60000 | epoch 1 | loss 0.0132 | grad 0.10 | 1.66 it/s | ETA 6.02h
243
+ step 24100/60000 | epoch 2 | loss 0.0144 | grad 0.08 | 1.66 it/s | ETA 6.01h
244
+ step 24200/60000 | epoch 2 | loss 0.0149 | grad 0.09 | 1.66 it/s | ETA 5.99h
245
+ step 24300/60000 | epoch 2 | loss 0.0148 | grad 0.04 | 1.66 it/s | ETA 5.97h
246
+ step 24400/60000 | epoch 2 | loss 0.0144 | grad 0.08 | 1.66 it/s | ETA 5.95h
247
+ step 24500/60000 | epoch 2 | loss 0.0140 | grad 0.03 | 1.66 it/s | ETA 5.93h
248
+ step 24600/60000 | epoch 2 | loss 0.0139 | grad 0.02 | 1.66 it/s | ETA 5.91h
249
+ step 24700/60000 | epoch 2 | loss 0.0143 | grad 0.08 | 1.66 it/s | ETA 5.89h
250
+ step 24800/60000 | epoch 2 | loss 0.0137 | grad 0.05 | 1.66 it/s | ETA 5.88h
251
+ step 24900/60000 | epoch 2 | loss 0.0152 | grad 0.09 | 1.66 it/s | ETA 5.86h
252
+ step 25000/60000 | epoch 2 | loss 0.0149 | grad 0.06 | 1.67 it/s | ETA 5.84h
253
+ step 25100/60000 | epoch 2 | loss 0.0141 | grad 0.07 | 1.67 it/s | ETA 5.82h
254
+ step 25200/60000 | epoch 2 | loss 0.0145 | grad 0.06 | 1.67 it/s | ETA 5.80h
255
+ step 25300/60000 | epoch 2 | loss 0.0137 | grad 0.07 | 1.67 it/s | ETA 5.78h
256
+ step 25400/60000 | epoch 2 | loss 0.0149 | grad 0.10 | 1.67 it/s | ETA 5.76h
257
+ step 25500/60000 | epoch 2 | loss 0.0144 | grad 0.09 | 1.67 it/s | ETA 5.75h
258
+ step 25600/60000 | epoch 2 | loss 0.0146 | grad 0.05 | 1.67 it/s | ETA 5.73h
259
+ step 25700/60000 | epoch 2 | loss 0.0150 | grad 0.12 | 1.67 it/s | ETA 5.71h
260
+ step 25800/60000 | epoch 2 | loss 0.0133 | grad 0.09 | 1.67 it/s | ETA 5.69h
261
+ step 25900/60000 | epoch 2 | loss 0.0132 | grad 0.13 | 1.67 it/s | ETA 5.67h
262
+ step 26000/60000 | epoch 2 | loss 0.0124 | grad 0.11 | 1.67 it/s | ETA 5.65h
263
+ step 26100/60000 | epoch 2 | loss 0.0152 | grad 0.10 | 1.67 it/s | ETA 5.63h
264
+ step 26200/60000 | epoch 2 | loss 0.0147 | grad 0.08 | 1.67 it/s | ETA 5.62h
265
+ step 26300/60000 | epoch 2 | loss 0.0155 | grad 0.06 | 1.67 it/s | ETA 5.60h
266
+ step 26400/60000 | epoch 2 | loss 0.0119 | grad 0.10 | 1.67 it/s | ETA 5.58h
267
+ step 26500/60000 | epoch 2 | loss 0.0132 | grad 0.11 | 1.67 it/s | ETA 5.56h
268
+ step 26600/60000 | epoch 2 | loss 0.0135 | grad 0.06 | 1.67 it/s | ETA 5.54h
269
+ step 26700/60000 | epoch 2 | loss 0.0136 | grad 0.05 | 1.67 it/s | ETA 5.52h
270
+ step 26800/60000 | epoch 2 | loss 0.0136 | grad 0.05 | 1.67 it/s | ETA 5.51h
271
+ step 26900/60000 | epoch 2 | loss 0.0138 | grad 0.06 | 1.68 it/s | ETA 5.49h
272
+ step 27000/60000 | epoch 2 | loss 0.0143 | grad 0.06 | 1.68 it/s | ETA 5.47h
273
+ step 27100/60000 | epoch 2 | loss 0.0143 | grad 0.12 | 1.68 it/s | ETA 5.46h
274
+ step 27200/60000 | epoch 2 | loss 0.0149 | grad 0.13 | 1.68 it/s | ETA 5.44h
275
+ step 27300/60000 | epoch 2 | loss 0.0135 | grad 0.08 | 1.68 it/s | ETA 5.42h
276
+ step 27400/60000 | epoch 2 | loss 0.0152 | grad 0.03 | 1.68 it/s | ETA 5.40h
277
+ step 27500/60000 | epoch 2 | loss 0.0124 | grad 0.05 | 1.68 it/s | ETA 5.38h
278
+ step 27600/60000 | epoch 2 | loss 0.0152 | grad 0.06 | 1.68 it/s | ETA 5.36h
279
+ step 27700/60000 | epoch 2 | loss 0.0137 | grad 0.07 | 1.68 it/s | ETA 5.35h
280
+ step 27800/60000 | epoch 2 | loss 0.0131 | grad 0.09 | 1.68 it/s | ETA 5.33h
281
+ step 27900/60000 | epoch 2 | loss 0.0142 | grad 0.13 | 1.68 it/s | ETA 5.31h
282
+ step 28000/60000 | epoch 2 | loss 0.0146 | grad 0.09 | 1.68 it/s | ETA 5.29h
283
+ step 28100/60000 | epoch 2 | loss 0.0147 | grad 0.05 | 1.68 it/s | ETA 5.27h
284
+ step 28200/60000 | epoch 2 | loss 0.0128 | grad 0.07 | 1.68 it/s | ETA 5.26h
285
+ step 28300/60000 | epoch 2 | loss 0.0141 | grad 0.05 | 1.68 it/s | ETA 5.24h
286
+ step 28400/60000 | epoch 2 | loss 0.0142 | grad 0.12 | 1.68 it/s | ETA 5.22h
287
+ step 28500/60000 | epoch 2 | loss 0.0141 | grad 0.10 | 1.68 it/s | ETA 5.20h
288
+ step 28600/60000 | epoch 2 | loss 0.0144 | grad 0.12 | 1.68 it/s | ETA 5.18h
289
+ step 28700/60000 | epoch 2 | loss 0.0130 | grad 0.14 | 1.68 it/s | ETA 5.17h
290
+ step 28800/60000 | epoch 2 | loss 0.0151 | grad 0.03 | 1.68 it/s | ETA 5.15h
291
+ step 28900/60000 | epoch 2 | loss 0.0143 | grad 0.06 | 1.68 it/s | ETA 5.13h
292
+ step 29000/60000 | epoch 2 | loss 0.0147 | grad 0.05 | 1.68 it/s | ETA 5.11h
293
+ step 29100/60000 | epoch 2 | loss 0.0139 | grad 0.12 | 1.68 it/s | ETA 5.10h
294
+ step 29200/60000 | epoch 2 | loss 0.0137 | grad 0.09 | 1.68 it/s | ETA 5.08h
295
+ step 29300/60000 | epoch 2 | loss 0.0133 | grad 0.09 | 1.69 it/s | ETA 5.06h
296
+ step 29400/60000 | epoch 2 | loss 0.0140 | grad 0.04 | 1.69 it/s | ETA 5.04h
297
+ step 29500/60000 | epoch 2 | loss 0.0134 | grad 0.06 | 1.69 it/s | ETA 5.02h
298
+ step 29600/60000 | epoch 2 | loss 0.0133 | grad 0.04 | 1.69 it/s | ETA 5.01h
299
+ step 29700/60000 | epoch 2 | loss 0.0131 | grad 0.05 | 1.69 it/s | ETA 4.99h
300
+ step 29800/60000 | epoch 2 | loss 0.0140 | grad 0.08 | 1.69 it/s | ETA 4.97h
301
+ step 29900/60000 | epoch 2 | loss 0.0154 | grad 0.08 | 1.69 it/s | ETA 4.95h
302
+ step 30000/60000 | epoch 2 | loss 0.0144 | grad 0.10 | 1.69 it/s | ETA 4.94h
303
+ step 30100/60000 | epoch 2 | loss 0.0142 | grad 0.11 | 1.69 it/s | ETA 4.92h
304
+ step 30200/60000 | epoch 2 | loss 0.0137 | grad 0.07 | 1.69 it/s | ETA 4.90h
305
+ step 30300/60000 | epoch 2 | loss 0.0134 | grad 0.04 | 1.69 it/s | ETA 4.89h
306
+ step 30400/60000 | epoch 2 | loss 0.0144 | grad 0.06 | 1.69 it/s | ETA 4.87h
307
+ step 30500/60000 | epoch 2 | loss 0.0152 | grad 0.03 | 1.69 it/s | ETA 4.85h
308
+ step 30600/60000 | epoch 2 | loss 0.0147 | grad 0.09 | 1.69 it/s | ETA 4.83h
309
+ step 30700/60000 | epoch 2 | loss 0.0151 | grad 0.03 | 1.69 it/s | ETA 4.82h
310
+ step 30800/60000 | epoch 2 | loss 0.0145 | grad 0.04 | 1.69 it/s | ETA 4.80h
311
+ step 30900/60000 | epoch 2 | loss 0.0150 | grad 0.11 | 1.69 it/s | ETA 4.78h
312
+ step 31000/60000 | epoch 2 | loss 0.0137 | grad 0.10 | 1.69 it/s | ETA 4.76h
313
+ step 31100/60000 | epoch 2 | loss 0.0132 | grad 0.04 | 1.69 it/s | ETA 4.74h
314
+ step 31200/60000 | epoch 2 | loss 0.0149 | grad 0.06 | 1.69 it/s | ETA 4.73h
315
+ step 31300/60000 | epoch 2 | loss 0.0136 | grad 0.06 | 1.69 it/s | ETA 4.71h
316
+ step 31400/60000 | epoch 2 | loss 0.0133 | grad 0.06 | 1.69 it/s | ETA 4.69h
317
+ step 31500/60000 | epoch 2 | loss 0.0152 | grad 0.15 | 1.69 it/s | ETA 4.68h
318
+ step 31600/60000 | epoch 2 | loss 0.0142 | grad 0.08 | 1.69 it/s | ETA 4.66h
319
+ step 31700/60000 | epoch 2 | loss 0.0132 | grad 0.06 | 1.69 it/s | ETA 4.64h
320
+ step 31800/60000 | epoch 2 | loss 0.0142 | grad 0.10 | 1.69 it/s | ETA 4.62h
321
+ step 31900/60000 | epoch 2 | loss 0.0150 | grad 0.08 | 1.69 it/s | ETA 4.61h
322
+ step 32000/60000 | epoch 2 | loss 0.0130 | grad 0.02 | 1.70 it/s | ETA 4.59h
323
+ step 32100/60000 | epoch 2 | loss 0.0149 | grad 0.05 | 1.70 it/s | ETA 4.57h
324
+ step 32200/60000 | epoch 2 | loss 0.0125 | grad 0.10 | 1.70 it/s | ETA 4.55h
325
+ step 32300/60000 | epoch 2 | loss 0.0138 | grad 0.07 | 1.70 it/s | ETA 4.54h
326
+ step 32400/60000 | epoch 2 | loss 0.0140 | grad 0.05 | 1.70 it/s | ETA 4.52h
327
+ step 32500/60000 | epoch 2 | loss 0.0168 | grad 0.06 | 1.70 it/s | ETA 4.50h
328
+ step 32600/60000 | epoch 2 | loss 0.0147 | grad 0.08 | 1.70 it/s | ETA 4.48h
329
+ step 32700/60000 | epoch 2 | loss 0.0143 | grad 0.06 | 1.70 it/s | ETA 4.47h
330
+ step 32800/60000 | epoch 2 | loss 0.0143 | grad 0.05 | 1.70 it/s | ETA 4.45h
331
+ step 32900/60000 | epoch 2 | loss 0.0132 | grad 0.06 | 1.70 it/s | ETA 4.43h
332
+ step 33000/60000 | epoch 2 | loss 0.0140 | grad 0.03 | 1.70 it/s | ETA 4.41h
333
+ step 33100/60000 | epoch 2 | loss 0.0143 | grad 0.13 | 1.70 it/s | ETA 4.40h
334
+ step 33200/60000 | epoch 2 | loss 0.0155 | grad 0.04 | 1.70 it/s | ETA 4.38h
335
+ step 33300/60000 | epoch 2 | loss 0.0147 | grad 0.07 | 1.70 it/s | ETA 4.37h
336
+ step 33400/60000 | epoch 2 | loss 0.0128 | grad 0.08 | 1.70 it/s | ETA 4.35h
337
+ step 33500/60000 | epoch 2 | loss 0.0125 | grad 0.12 | 1.70 it/s | ETA 4.33h
338
+ step 33600/60000 | epoch 2 | loss 0.0131 | grad 0.07 | 1.70 it/s | ETA 4.31h
339
+ step 33700/60000 | epoch 2 | loss 0.0142 | grad 0.05 | 1.70 it/s | ETA 4.30h
340
+ step 33800/60000 | epoch 2 | loss 0.0136 | grad 0.08 | 1.70 it/s | ETA 4.28h
341
+ step 33900/60000 | epoch 2 | loss 0.0131 | grad 0.11 | 1.70 it/s | ETA 4.26h
342
+ step 34000/60000 | epoch 2 | loss 0.0135 | grad 0.05 | 1.70 it/s | ETA 4.24h
343
+ step 34100/60000 | epoch 2 | loss 0.0137 | grad 0.09 | 1.70 it/s | ETA 4.23h
344
+ step 34200/60000 | epoch 2 | loss 0.0120 | grad 0.05 | 1.70 it/s | ETA 4.21h
345
+ step 34300/60000 | epoch 2 | loss 0.0142 | grad 0.04 | 1.70 it/s | ETA 4.19h
346
+ step 34400/60000 | epoch 2 | loss 0.0137 | grad 0.06 | 1.70 it/s | ETA 4.18h
347
+ step 34500/60000 | epoch 2 | loss 0.0137 | grad 0.11 | 1.70 it/s | ETA 4.16h
348
+ step 34600/60000 | epoch 2 | loss 0.0141 | grad 0.02 | 1.70 it/s | ETA 4.14h
349
+ step 34700/60000 | epoch 2 | loss 0.0145 | grad 0.10 | 1.70 it/s | ETA 4.13h
350
+ step 34800/60000 | epoch 2 | loss 0.0152 | grad 0.08 | 1.70 it/s | ETA 4.11h
351
+ step 34900/60000 | epoch 2 | loss 0.0133 | grad 0.05 | 1.70 it/s | ETA 4.09h
352
+ step 35000/60000 | epoch 2 | loss 0.0137 | grad 0.09 | 1.70 it/s | ETA 4.07h
353
+ step 35100/60000 | epoch 2 | loss 0.0143 | grad 0.09 | 1.70 it/s | ETA 4.06h
354
+ step 35200/60000 | epoch 2 | loss 0.0136 | grad 0.05 | 1.71 it/s | ETA 4.04h
355
+ step 35300/60000 | epoch 2 | loss 0.0129 | grad 0.06 | 1.71 it/s | ETA 4.02h
356
+ step 35400/60000 | epoch 2 | loss 0.0141 | grad 0.11 | 1.71 it/s | ETA 4.01h
357
+ step 35500/60000 | epoch 2 | loss 0.0127 | grad 0.08 | 1.71 it/s | ETA 3.99h
358
+ step 35600/60000 | epoch 2 | loss 0.0132 | grad 0.05 | 1.71 it/s | ETA 3.97h
359
+ step 35700/60000 | epoch 2 | loss 0.0148 | grad 0.04 | 1.71 it/s | ETA 3.95h
360
+ step 35800/60000 | epoch 2 | loss 0.0132 | grad 0.08 | 1.71 it/s | ETA 3.94h
361
+ step 35900/60000 | epoch 2 | loss 0.0144 | grad 0.08 | 1.71 it/s | ETA 3.92h
362
+ step 36000/60000 | epoch 2 | loss 0.0127 | grad 0.03 | 1.71 it/s | ETA 3.90h
363
+ step 36100/60000 | epoch 3 | loss 0.0140 | grad 0.08 | 1.71 it/s | ETA 3.89h
364
+ step 36200/60000 | epoch 3 | loss 0.0142 | grad 0.04 | 1.71 it/s | ETA 3.87h
365
+ step 36300/60000 | epoch 3 | loss 0.0125 | grad 0.07 | 1.71 it/s | ETA 3.86h
366
+ step 36400/60000 | epoch 3 | loss 0.0134 | grad 0.06 | 1.71 it/s | ETA 3.84h
367
+ step 36500/60000 | epoch 3 | loss 0.0138 | grad 0.06 | 1.71 it/s | ETA 3.82h
368
+ step 36600/60000 | epoch 3 | loss 0.0144 | grad 0.05 | 1.71 it/s | ETA 3.80h
369
+ step 36700/60000 | epoch 3 | loss 0.0143 | grad 0.03 | 1.71 it/s | ETA 3.79h
370
+ step 36800/60000 | epoch 3 | loss 0.0146 | grad 0.09 | 1.71 it/s | ETA 3.77h
371
+ step 36900/60000 | epoch 3 | loss 0.0148 | grad 0.04 | 1.71 it/s | ETA 3.75h
372
+ step 37000/60000 | epoch 3 | loss 0.0138 | grad 0.02 | 1.71 it/s | ETA 3.74h
373
+ step 37100/60000 | epoch 3 | loss 0.0133 | grad 0.06 | 1.71 it/s | ETA 3.72h
374
+ step 37200/60000 | epoch 3 | loss 0.0138 | grad 0.04 | 1.71 it/s | ETA 3.70h
375
+ step 37300/60000 | epoch 3 | loss 0.0133 | grad 0.10 | 1.71 it/s | ETA 3.69h
376
+ step 37400/60000 | epoch 3 | loss 0.0145 | grad 0.08 | 1.71 it/s | ETA 3.67h
377
+ step 37500/60000 | epoch 3 | loss 0.0135 | grad 0.05 | 1.71 it/s | ETA 3.65h
378
+ step 37600/60000 | epoch 3 | loss 0.0127 | grad 0.07 | 1.71 it/s | ETA 3.64h
379
+ step 37700/60000 | epoch 3 | loss 0.0138 | grad 0.10 | 1.71 it/s | ETA 3.62h
380
+ step 37800/60000 | epoch 3 | loss 0.0145 | grad 0.09 | 1.71 it/s | ETA 3.60h
381
+ step 37900/60000 | epoch 3 | loss 0.0134 | grad 0.05 | 1.71 it/s | ETA 3.59h
382
+ step 38000/60000 | epoch 3 | loss 0.0130 | grad 0.11 | 1.71 it/s | ETA 3.57h
383
+ step 38100/60000 | epoch 3 | loss 0.0128 | grad 0.06 | 1.71 it/s | ETA 3.55h
384
+ step 38200/60000 | epoch 3 | loss 0.0137 | grad 0.04 | 1.71 it/s | ETA 3.54h
385
+ step 38300/60000 | epoch 3 | loss 0.0137 | grad 0.08 | 1.71 it/s | ETA 3.52h
386
+ step 38400/60000 | epoch 3 | loss 0.0140 | grad 0.06 | 1.71 it/s | ETA 3.50h
387
+ step 38500/60000 | epoch 3 | loss 0.0130 | grad 0.05 | 1.71 it/s | ETA 3.48h
388
+ step 38600/60000 | epoch 3 | loss 0.0145 | grad 0.06 | 1.71 it/s | ETA 3.47h
389
+ step 38700/60000 | epoch 3 | loss 0.0148 | grad 0.05 | 1.71 it/s | ETA 3.45h
390
+ step 38800/60000 | epoch 3 | loss 0.0140 | grad 0.05 | 1.71 it/s | ETA 3.43h
391
+ step 38900/60000 | epoch 3 | loss 0.0133 | grad 0.11 | 1.71 it/s | ETA 3.42h
392
+ step 39000/60000 | epoch 3 | loss 0.0133 | grad 0.08 | 1.72 it/s | ETA 3.40h
393
+ step 39100/60000 | epoch 3 | loss 0.0143 | grad 0.02 | 1.71 it/s | ETA 3.39h
394
+ step 39200/60000 | epoch 3 | loss 0.0149 | grad 0.08 | 1.71 it/s | ETA 3.37h
395
+ step 39300/60000 | epoch 3 | loss 0.0131 | grad 0.11 | 1.72 it/s | ETA 3.35h
396
+ step 39400/60000 | epoch 3 | loss 0.0148 | grad 0.03 | 1.72 it/s | ETA 3.34h
397
+ step 39500/60000 | epoch 3 | loss 0.0125 | grad 0.07 | 1.72 it/s | ETA 3.32h
398
+ step 39600/60000 | epoch 3 | loss 0.0146 | grad 0.09 | 1.72 it/s | ETA 3.30h
399
+ step 39700/60000 | epoch 3 | loss 0.0137 | grad 0.11 | 1.72 it/s | ETA 3.29h
400
+ step 39800/60000 | epoch 3 | loss 0.0154 | grad 0.12 | 1.72 it/s | ETA 3.27h
401
+ step 39900/60000 | epoch 3 | loss 0.0140 | grad 0.06 | 1.72 it/s | ETA 3.25h
402
+ step 40000/60000 | epoch 3 | loss 0.0141 | grad 0.07 | 1.72 it/s | ETA 3.24h
403
+ step 40100/60000 | epoch 3 | loss 0.0133 | grad 0.11 | 1.72 it/s | ETA 3.22h
404
+ step 40200/60000 | epoch 3 | loss 0.0132 | grad 0.05 | 1.72 it/s | ETA 3.20h
405
+ step 40300/60000 | epoch 3 | loss 0.0131 | grad 0.08 | 1.72 it/s | ETA 3.19h
406
+ step 40400/60000 | epoch 3 | loss 0.0140 | grad 0.06 | 1.72 it/s | ETA 3.17h
407
+ step 40500/60000 | epoch 3 | loss 0.0150 | grad 0.08 | 1.72 it/s | ETA 3.15h
408
+ step 40600/60000 | epoch 3 | loss 0.0127 | grad 0.08 | 1.72 it/s | ETA 3.14h
409
+ step 40700/60000 | epoch 3 | loss 0.0122 | grad 0.06 | 1.72 it/s | ETA 3.12h
410
+ step 40800/60000 | epoch 3 | loss 0.0135 | grad 0.09 | 1.72 it/s | ETA 3.10h
411
+ step 40900/60000 | epoch 3 | loss 0.0151 | grad 0.06 | 1.72 it/s | ETA 3.09h
412
+ step 41000/60000 | epoch 3 | loss 0.0140 | grad 0.08 | 1.72 it/s | ETA 3.07h
413
+ step 41100/60000 | epoch 3 | loss 0.0131 | grad 0.12 | 1.72 it/s | ETA 3.05h
414
+ step 41200/60000 | epoch 3 | loss 0.0129 | grad 0.12 | 1.72 it/s | ETA 3.04h
415
+ step 41300/60000 | epoch 3 | loss 0.0118 | grad 0.07 | 1.72 it/s | ETA 3.02h
416
+ step 41400/60000 | epoch 3 | loss 0.0127 | grad 0.10 | 1.72 it/s | ETA 3.00h
417
+ step 41500/60000 | epoch 3 | loss 0.0139 | grad 0.03 | 1.72 it/s | ETA 2.99h
418
+ step 41600/60000 | epoch 3 | loss 0.0149 | grad 0.07 | 1.72 it/s | ETA 2.97h
419
+ step 41700/60000 | epoch 3 | loss 0.0141 | grad 0.06 | 1.72 it/s | ETA 2.95h
420
+ step 41800/60000 | epoch 3 | loss 0.0143 | grad 0.06 | 1.72 it/s | ETA 2.94h
421
+ step 41900/60000 | epoch 3 | loss 0.0139 | grad 0.04 | 1.72 it/s | ETA 2.92h
422
+ step 42000/60000 | epoch 3 | loss 0.0148 | grad 0.04 | 1.72 it/s | ETA 2.90h
423
+ step 42100/60000 | epoch 3 | loss 0.0122 | grad 0.05 | 1.72 it/s | ETA 2.89h
424
+ step 42200/60000 | epoch 3 | loss 0.0122 | grad 0.05 | 1.72 it/s | ETA 2.87h
425
+ step 42300/60000 | epoch 3 | loss 0.0130 | grad 0.04 | 1.72 it/s | ETA 2.86h
426
+ step 42400/60000 | epoch 3 | loss 0.0140 | grad 0.08 | 1.72 it/s | ETA 2.84h
427
+ step 42500/60000 | epoch 3 | loss 0.0139 | grad 0.09 | 1.72 it/s | ETA 2.82h
428
+ step 42600/60000 | epoch 3 | loss 0.0129 | grad 0.03 | 1.72 it/s | ETA 2.81h
429
+ step 42700/60000 | epoch 3 | loss 0.0123 | grad 0.06 | 1.72 it/s | ETA 2.79h
430
+ step 42800/60000 | epoch 3 | loss 0.0139 | grad 0.08 | 1.72 it/s | ETA 2.77h
431
+ step 42900/60000 | epoch 3 | loss 0.0141 | grad 0.10 | 1.72 it/s | ETA 2.76h
432
+ step 43000/60000 | epoch 3 | loss 0.0138 | grad 0.05 | 1.72 it/s | ETA 2.74h
433
+ step 43100/60000 | epoch 3 | loss 0.0144 | grad 0.07 | 1.72 it/s | ETA 2.72h
434
+ step 43200/60000 | epoch 3 | loss 0.0136 | grad 0.06 | 1.72 it/s | ETA 2.71h
435
+ step 43300/60000 | epoch 3 | loss 0.0140 | grad 0.08 | 1.72 it/s | ETA 2.69h
436
+ step 43400/60000 | epoch 3 | loss 0.0140 | grad 0.05 | 1.72 it/s | ETA 2.67h
437
+ step 43500/60000 | epoch 3 | loss 0.0129 | grad 0.06 | 1.72 it/s | ETA 2.66h
438
+ step 43600/60000 | epoch 3 | loss 0.0147 | grad 0.06 | 1.72 it/s | ETA 2.64h
439
+ step 43700/60000 | epoch 3 | loss 0.0132 | grad 0.05 | 1.72 it/s | ETA 2.63h
440
+ step 43800/60000 | epoch 3 | loss 0.0138 | grad 0.08 | 1.72 it/s | ETA 2.61h
441
+ step 43900/60000 | epoch 3 | loss 0.0148 | grad 0.11 | 1.72 it/s | ETA 2.59h
442
+ step 44000/60000 | epoch 3 | loss 0.0132 | grad 0.05 | 1.73 it/s | ETA 2.58h
443
+ step 44100/60000 | epoch 3 | loss 0.0140 | grad 0.09 | 1.73 it/s | ETA 2.56h
444
+ step 44200/60000 | epoch 3 | loss 0.0145 | grad 0.10 | 1.73 it/s | ETA 2.54h
445
+ step 44300/60000 | epoch 3 | loss 0.0141 | grad 0.05 | 1.73 it/s | ETA 2.53h
446
+ step 44400/60000 | epoch 3 | loss 0.0133 | grad 0.05 | 1.73 it/s | ETA 2.51h
447
+ step 44500/60000 | epoch 3 | loss 0.0128 | grad 0.04 | 1.73 it/s | ETA 2.49h
448
+ step 44600/60000 | epoch 3 | loss 0.0122 | grad 0.08 | 1.73 it/s | ETA 2.48h
449
+ step 44700/60000 | epoch 3 | loss 0.0141 | grad 0.06 | 1.73 it/s | ETA 2.46h
450
+ step 44800/60000 | epoch 3 | loss 0.0131 | grad 0.06 | 1.73 it/s | ETA 2.45h
451
+ step 44900/60000 | epoch 3 | loss 0.0135 | grad 0.11 | 1.73 it/s | ETA 2.43h
452
+ step 45000/60000 | epoch 3 | loss 0.0127 | grad 0.07 | 1.73 it/s | ETA 2.41h
453
+ step 45100/60000 | epoch 3 | loss 0.0141 | grad 0.07 | 1.73 it/s | ETA 2.40h
454
+ step 45200/60000 | epoch 3 | loss 0.0148 | grad 0.12 | 1.73 it/s | ETA 2.38h
455
+ step 45300/60000 | epoch 3 | loss 0.0129 | grad 0.08 | 1.73 it/s | ETA 2.36h
456
+ step 45400/60000 | epoch 3 | loss 0.0133 | grad 0.11 | 1.73 it/s | ETA 2.35h
457
+ step 45500/60000 | epoch 3 | loss 0.0132 | grad 0.06 | 1.73 it/s | ETA 2.33h
458
+ step 45600/60000 | epoch 3 | loss 0.0134 | grad 0.04 | 1.73 it/s | ETA 2.32h
459
+ step 45700/60000 | epoch 3 | loss 0.0125 | grad 0.05 | 1.73 it/s | ETA 2.30h
460
+ step 45800/60000 | epoch 3 | loss 0.0133 | grad 0.08 | 1.73 it/s | ETA 2.28h
461
+ step 45900/60000 | epoch 3 | loss 0.0125 | grad 0.08 | 1.73 it/s | ETA 2.27h
462
+ step 46000/60000 | epoch 3 | loss 0.0124 | grad 0.05 | 1.73 it/s | ETA 2.25h
463
+ step 46100/60000 | epoch 3 | loss 0.0138 | grad 0.08 | 1.73 it/s | ETA 2.23h
464
+ step 46200/60000 | epoch 3 | loss 0.0137 | grad 0.07 | 1.73 it/s | ETA 2.22h
465
+ step 46300/60000 | epoch 3 | loss 0.0130 | grad 0.08 | 1.73 it/s | ETA 2.20h
466
+ step 46400/60000 | epoch 3 | loss 0.0131 | grad 0.08 | 1.73 it/s | ETA 2.18h
467
+ step 46500/60000 | epoch 3 | loss 0.0122 | grad 0.04 | 1.73 it/s | ETA 2.17h
468
+ step 46600/60000 | epoch 3 | loss 0.0143 | grad 0.09 | 1.73 it/s | ETA 2.15h
469
+ step 46700/60000 | epoch 3 | loss 0.0134 | grad 0.05 | 1.73 it/s | ETA 2.14h
470
+ step 46800/60000 | epoch 3 | loss 0.0149 | grad 0.05 | 1.73 it/s | ETA 2.12h
471
+ step 46900/60000 | epoch 3 | loss 0.0139 | grad 0.11 | 1.73 it/s | ETA 2.10h
472
+ step 47000/60000 | epoch 3 | loss 0.0134 | grad 0.05 | 1.73 it/s | ETA 2.09h
473
+ step 47100/60000 | epoch 3 | loss 0.0129 | grad 0.02 | 1.73 it/s | ETA 2.07h
474
+ step 47200/60000 | epoch 3 | loss 0.0132 | grad 0.09 | 1.73 it/s | ETA 2.05h
475
+ step 47300/60000 | epoch 3 | loss 0.0140 | grad 0.06 | 1.73 it/s | ETA 2.04h
476
+ step 47400/60000 | epoch 3 | loss 0.0138 | grad 0.04 | 1.73 it/s | ETA 2.02h
477
+ step 47500/60000 | epoch 3 | loss 0.0137 | grad 0.09 | 1.73 it/s | ETA 2.01h
478
+ step 47600/60000 | epoch 3 | loss 0.0149 | grad 0.02 | 1.73 it/s | ETA 1.99h
479
+ step 47700/60000 | epoch 3 | loss 0.0131 | grad 0.06 | 1.73 it/s | ETA 1.97h
480
+ step 47800/60000 | epoch 3 | loss 0.0134 | grad 0.08 | 1.73 it/s | ETA 1.96h
481
+ step 47900/60000 | epoch 3 | loss 0.0135 | grad 0.02 | 1.73 it/s | ETA 1.94h
482
+ step 48000/60000 | epoch 3 | loss 0.0126 | grad 0.05 | 1.73 it/s | ETA 1.92h
483
+ step 48100/60000 | epoch 3 | loss 0.0136 | grad 0.08 | 1.73 it/s | ETA 1.91h
484
+ step 48200/60000 | epoch 4 | loss 0.0137 | grad 0.05 | 1.73 it/s | ETA 1.89h
485
+ step 48300/60000 | epoch 4 | loss 0.0148 | grad 0.10 | 1.73 it/s | ETA 1.88h
486
+ step 48400/60000 | epoch 4 | loss 0.0141 | grad 0.09 | 1.73 it/s | ETA 1.86h
487
+ step 48500/60000 | epoch 4 | loss 0.0129 | grad 0.04 | 1.73 it/s | ETA 1.84h
488
+ step 48600/60000 | epoch 4 | loss 0.0125 | grad 0.04 | 1.73 it/s | ETA 1.83h
489
+ step 48700/60000 | epoch 4 | loss 0.0140 | grad 0.06 | 1.73 it/s | ETA 1.81h
490
+ step 48800/60000 | epoch 4 | loss 0.0145 | grad 0.04 | 1.73 it/s | ETA 1.80h
491
+ step 48900/60000 | epoch 4 | loss 0.0122 | grad 0.03 | 1.73 it/s | ETA 1.78h
492
+ step 49000/60000 | epoch 4 | loss 0.0131 | grad 0.08 | 1.73 it/s | ETA 1.76h
493
+ step 49100/60000 | epoch 4 | loss 0.0147 | grad 0.04 | 1.73 it/s | ETA 1.75h
494
+ step 49200/60000 | epoch 4 | loss 0.0133 | grad 0.09 | 1.73 it/s | ETA 1.73h
495
+ step 49300/60000 | epoch 4 | loss 0.0132 | grad 0.05 | 1.73 it/s | ETA 1.71h
496
+ step 49400/60000 | epoch 4 | loss 0.0137 | grad 0.04 | 1.73 it/s | ETA 1.70h
497
+ step 49500/60000 | epoch 4 | loss 0.0123 | grad 0.05 | 1.73 it/s | ETA 1.68h
498
+ step 49600/60000 | epoch 4 | loss 0.0132 | grad 0.08 | 1.73 it/s | ETA 1.67h
499
+ step 49700/60000 | epoch 4 | loss 0.0135 | grad 0.05 | 1.73 it/s | ETA 1.65h
500
+ step 49800/60000 | epoch 4 | loss 0.0143 | grad 0.03 | 1.73 it/s | ETA 1.63h
501
+ step 49900/60000 | epoch 4 | loss 0.0116 | grad 0.04 | 1.73 it/s | ETA 1.62h
502
+ step 50000/60000 | epoch 4 | loss 0.0138 | grad 0.09 | 1.74 it/s | ETA 1.60h
503
+ step 50100/60000 | epoch 4 | loss 0.0151 | grad 0.06 | 1.74 it/s | ETA 1.58h
504
+ step 50200/60000 | epoch 4 | loss 0.0153 | grad 0.04 | 1.74 it/s | ETA 1.57h
505
+ step 50300/60000 | epoch 4 | loss 0.0114 | grad 0.03 | 1.74 it/s | ETA 1.55h
506
+ step 50400/60000 | epoch 4 | loss 0.0128 | grad 0.08 | 1.74 it/s | ETA 1.54h
507
+ step 50500/60000 | epoch 4 | loss 0.0149 | grad 0.09 | 1.74 it/s | ETA 1.52h
508
+ step 50600/60000 | epoch 4 | loss 0.0141 | grad 0.07 | 1.74 it/s | ETA 1.50h
509
+ step 50700/60000 | epoch 4 | loss 0.0142 | grad 0.03 | 1.74 it/s | ETA 1.49h
510
+ step 50800/60000 | epoch 4 | loss 0.0141 | grad 0.05 | 1.74 it/s | ETA 1.47h
511
+ step 50900/60000 | epoch 4 | loss 0.0128 | grad 0.07 | 1.74 it/s | ETA 1.46h
512
+ step 51000/60000 | epoch 4 | loss 0.0136 | grad 0.08 | 1.74 it/s | ETA 1.44h
513
+ step 51100/60000 | epoch 4 | loss 0.0145 | grad 0.03 | 1.74 it/s | ETA 1.42h
514
+ step 51200/60000 | epoch 4 | loss 0.0128 | grad 0.08 | 1.74 it/s | ETA 1.41h
515
+ step 51300/60000 | epoch 4 | loss 0.0139 | grad 0.03 | 1.74 it/s | ETA 1.39h
516
+ step 51400/60000 | epoch 4 | loss 0.0131 | grad 0.09 | 1.74 it/s | ETA 1.38h
517
+ step 51500/60000 | epoch 4 | loss 0.0138 | grad 0.03 | 1.74 it/s | ETA 1.36h
518
+ step 51600/60000 | epoch 4 | loss 0.0125 | grad 0.04 | 1.74 it/s | ETA 1.34h
519
+ step 51700/60000 | epoch 4 | loss 0.0115 | grad 0.06 | 1.74 it/s | ETA 1.33h
520
+ step 51800/60000 | epoch 4 | loss 0.0118 | grad 0.05 | 1.74 it/s | ETA 1.31h
521
+ step 51900/60000 | epoch 4 | loss 0.0132 | grad 0.05 | 1.74 it/s | ETA 1.29h
522
+ step 52000/60000 | epoch 4 | loss 0.0128 | grad 0.09 | 1.74 it/s | ETA 1.28h
523
+ step 52100/60000 | epoch 4 | loss 0.0144 | grad 0.09 | 1.74 it/s | ETA 1.26h
524
+ step 52200/60000 | epoch 4 | loss 0.0135 | grad 0.10 | 1.74 it/s | ETA 1.25h
525
+ step 52300/60000 | epoch 4 | loss 0.0127 | grad 0.05 | 1.74 it/s | ETA 1.23h
526
+ step 52400/60000 | epoch 4 | loss 0.0132 | grad 0.08 | 1.74 it/s | ETA 1.21h
527
+ step 52500/60000 | epoch 4 | loss 0.0140 | grad 0.05 | 1.74 it/s | ETA 1.20h
528
+ step 52600/60000 | epoch 4 | loss 0.0136 | grad 0.08 | 1.74 it/s | ETA 1.18h
529
+ step 52700/60000 | epoch 4 | loss 0.0138 | grad 0.05 | 1.74 it/s | ETA 1.17h
530
+ step 52800/60000 | epoch 4 | loss 0.0134 | grad 0.07 | 1.74 it/s | ETA 1.15h
531
+ step 52900/60000 | epoch 4 | loss 0.0139 | grad 0.02 | 1.74 it/s | ETA 1.13h
532
+ step 53000/60000 | epoch 4 | loss 0.0129 | grad 0.04 | 1.74 it/s | ETA 1.12h
533
+ step 53100/60000 | epoch 4 | loss 0.0132 | grad 0.08 | 1.74 it/s | ETA 1.10h
534
+ step 53200/60000 | epoch 4 | loss 0.0130 | grad 0.09 | 1.74 it/s | ETA 1.09h
535
+ step 53300/60000 | epoch 4 | loss 0.0121 | grad 0.05 | 1.74 it/s | ETA 1.07h
536
+ step 53400/60000 | epoch 4 | loss 0.0126 | grad 0.10 | 1.74 it/s | ETA 1.05h
537
+ step 53500/60000 | epoch 4 | loss 0.0135 | grad 0.07 | 1.74 it/s | ETA 1.04h
538
+ step 53600/60000 | epoch 4 | loss 0.0124 | grad 0.09 | 1.74 it/s | ETA 1.02h
539
+ step 53700/60000 | epoch 4 | loss 0.0129 | grad 0.02 | 1.74 it/s | ETA 1.01h
540
+ step 53800/60000 | epoch 4 | loss 0.0131 | grad 0.09 | 1.74 it/s | ETA 0.99h
541
+ step 53900/60000 | epoch 4 | loss 0.0126 | grad 0.02 | 1.74 it/s | ETA 0.97h
542
+ step 54000/60000 | epoch 4 | loss 0.0149 | grad 0.02 | 1.74 it/s | ETA 0.96h
543
+ step 54100/60000 | epoch 4 | loss 0.0129 | grad 0.04 | 1.74 it/s | ETA 0.94h
544
+ step 54200/60000 | epoch 4 | loss 0.0155 | grad 0.02 | 1.74 it/s | ETA 0.93h
545
+ step 54300/60000 | epoch 4 | loss 0.0131 | grad 0.07 | 1.74 it/s | ETA 0.91h
546
+ step 54400/60000 | epoch 4 | loss 0.0128 | grad 0.07 | 1.74 it/s | ETA 0.89h
547
+ step 54500/60000 | epoch 4 | loss 0.0127 | grad 0.07 | 1.74 it/s | ETA 0.88h
548
+ step 54600/60000 | epoch 4 | loss 0.0133 | grad 0.08 | 1.74 it/s | ETA 0.86h
549
+ step 54700/60000 | epoch 4 | loss 0.0131 | grad 0.04 | 1.74 it/s | ETA 0.85h
550
+ step 54800/60000 | epoch 4 | loss 0.0127 | grad 0.07 | 1.74 it/s | ETA 0.83h
551
+ step 54900/60000 | epoch 4 | loss 0.0139 | grad 0.05 | 1.74 it/s | ETA 0.81h
552
+ step 55000/60000 | epoch 4 | loss 0.0123 | grad 0.03 | 1.74 it/s | ETA 0.80h
553
+ step 55100/60000 | epoch 4 | loss 0.0126 | grad 0.05 | 1.74 it/s | ETA 0.78h
554
+ step 55200/60000 | epoch 4 | loss 0.0135 | grad 0.03 | 1.74 it/s | ETA 0.77h
555
+ step 55300/60000 | epoch 4 | loss 0.0158 | grad 0.09 | 1.74 it/s | ETA 0.75h
556
+ step 55400/60000 | epoch 4 | loss 0.0139 | grad 0.08 | 1.74 it/s | ETA 0.73h
557
+ step 55500/60000 | epoch 4 | loss 0.0131 | grad 0.06 | 1.74 it/s | ETA 0.72h
558
+ step 55600/60000 | epoch 4 | loss 0.0140 | grad 0.06 | 1.74 it/s | ETA 0.70h
559
+ step 55700/60000 | epoch 4 | loss 0.0116 | grad 0.03 | 1.74 it/s | ETA 0.69h
560
+ step 55800/60000 | epoch 4 | loss 0.0134 | grad 0.05 | 1.74 it/s | ETA 0.67h
561
+ step 55900/60000 | epoch 4 | loss 0.0144 | grad 0.08 | 1.74 it/s | ETA 0.65h
562
+ step 56000/60000 | epoch 4 | loss 0.0130 | grad 0.05 | 1.74 it/s | ETA 0.64h
563
+ step 56100/60000 | epoch 4 | loss 0.0128 | grad 0.09 | 1.74 it/s | ETA 0.62h
564
+ step 56200/60000 | epoch 4 | loss 0.0139 | grad 0.04 | 1.74 it/s | ETA 0.61h
565
+ step 56300/60000 | epoch 4 | loss 0.0127 | grad 0.07 | 1.74 it/s | ETA 0.59h
566
+ step 56400/60000 | epoch 4 | loss 0.0129 | grad 0.11 | 1.74 it/s | ETA 0.57h
567
+ step 56500/60000 | epoch 4 | loss 0.0136 | grad 0.08 | 1.74 it/s | ETA 0.56h
568
+ step 56600/60000 | epoch 4 | loss 0.0149 | grad 0.03 | 1.74 it/s | ETA 0.54h
569
+ step 56700/60000 | epoch 4 | loss 0.0130 | grad 0.07 | 1.74 it/s | ETA 0.53h
570
+ step 56800/60000 | epoch 4 | loss 0.0132 | grad 0.07 | 1.74 it/s | ETA 0.51h
571
+ step 56900/60000 | epoch 4 | loss 0.0135 | grad 0.05 | 1.74 it/s | ETA 0.49h
572
+ step 57000/60000 | epoch 4 | loss 0.0144 | grad 0.02 | 1.74 it/s | ETA 0.48h
573
+ step 57100/60000 | epoch 4 | loss 0.0134 | grad 0.05 | 1.74 it/s | ETA 0.46h
574
+ step 57200/60000 | epoch 4 | loss 0.0135 | grad 0.06 | 1.74 it/s | ETA 0.45h
575
+ step 57300/60000 | epoch 4 | loss 0.0134 | grad 0.11 | 1.74 it/s | ETA 0.43h
576
+ step 57400/60000 | epoch 4 | loss 0.0130 | grad 0.05 | 1.74 it/s | ETA 0.41h
577
+ step 57500/60000 | epoch 4 | loss 0.0142 | grad 0.04 | 1.74 it/s | ETA 0.40h
578
+ step 57600/60000 | epoch 4 | loss 0.0128 | grad 0.08 | 1.74 it/s | ETA 0.38h
579
+ step 57700/60000 | epoch 4 | loss 0.0139 | grad 0.10 | 1.74 it/s | ETA 0.37h
580
+ step 57800/60000 | epoch 4 | loss 0.0137 | grad 0.03 | 1.74 it/s | ETA 0.35h
581
+ step 57900/60000 | epoch 4 | loss 0.0135 | grad 0.02 | 1.74 it/s | ETA 0.33h
582
+ step 58000/60000 | epoch 4 | loss 0.0127 | grad 0.03 | 1.74 it/s | ETA 0.32h
583
+ step 58100/60000 | epoch 4 | loss 0.0128 | grad 0.06 | 1.75 it/s | ETA 0.30h
584
+ step 58200/60000 | epoch 4 | loss 0.0141 | grad 0.05 | 1.75 it/s | ETA 0.29h
585
+ step 58300/60000 | epoch 4 | loss 0.0125 | grad 0.10 | 1.75 it/s | ETA 0.27h
586
+ step 58400/60000 | epoch 4 | loss 0.0121 | grad 0.06 | 1.75 it/s | ETA 0.25h
587
+ step 58500/60000 | epoch 4 | loss 0.0137 | grad 0.09 | 1.75 it/s | ETA 0.24h
588
+ step 58600/60000 | epoch 4 | loss 0.0134 | grad 0.06 | 1.75 it/s | ETA 0.22h
589
+ step 58700/60000 | epoch 4 | loss 0.0136 | grad 0.03 | 1.75 it/s | ETA 0.21h
590
+ step 58800/60000 | epoch 4 | loss 0.0136 | grad 0.05 | 1.75 it/s | ETA 0.19h
591
+ step 58900/60000 | epoch 4 | loss 0.0140 | grad 0.06 | 1.75 it/s | ETA 0.17h
592
+ step 59000/60000 | epoch 4 | loss 0.0133 | grad 0.08 | 1.75 it/s | ETA 0.16h
593
+ step 59100/60000 | epoch 4 | loss 0.0138 | grad 0.03 | 1.75 it/s | ETA 0.14h
594
+ step 59200/60000 | epoch 4 | loss 0.0128 | grad 0.08 | 1.75 it/s | ETA 0.13h
595
+ step 59300/60000 | epoch 4 | loss 0.0138 | grad 0.05 | 1.75 it/s | ETA 0.11h
596
+ step 59400/60000 | epoch 4 | loss 0.0155 | grad 0.05 | 1.75 it/s | ETA 0.10h
597
+ step 59500/60000 | epoch 4 | loss 0.0120 | grad 0.07 | 1.75 it/s | ETA 0.08h
598
+ step 59600/60000 | epoch 4 | loss 0.0146 | grad 0.05 | 1.75 it/s | ETA 0.06h
599
+ step 59700/60000 | epoch 4 | loss 0.0126 | grad 0.07 | 1.75 it/s | ETA 0.05h
600
+ step 59800/60000 | epoch 4 | loss 0.0134 | grad 0.07 | 1.75 it/s | ETA 0.03h
601
+ step 59900/60000 | epoch 4 | loss 0.0124 | grad 0.03 | 1.75 it/s | ETA 0.02h
602
+ step 60000/60000 | epoch 4 | loss 0.0131 | grad 0.05 | 1.75 it/s | ETA 0.00h
603
+ done: 9.54h | final pipeline at /media/joseph/Media/diffusion128/runs/celeba128/final
training/train.py ADDED
@@ -0,0 +1,269 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """
3
+ Pretrain a small unconditional DDPM diffusion model at 128x128 from scratch
4
+ on a single GPU (RTX 3060-friendly: fp16 AMP, ~50M-param UNet).
5
+
6
+ Default dataset: tglcourse/CelebA-faces-cropped-128 (~202k SFW 128x128 face crops).
7
+ Alternative: huggan/flowers-102-categories
8
+
9
+ Training stops at min(--max_train_steps, --max_hours wall clock), so it is
10
+ safe to leave running overnight.
11
+
12
+ Usage:
13
+ python train.py --output_dir runs/celeba128
14
+
15
+ Sample from the finished run:
16
+ from diffusers import DiffusionPipeline
17
+ pipe = DiffusionPipeline.from_pretrained("runs/celeba128/final").to("cuda")
18
+ pipe(batch_size=8).images[0].save("sample.png")
19
+ """
20
+
21
+ import argparse
22
+ import copy
23
+ import math
24
+ import time
25
+ from pathlib import Path
26
+
27
+ import torch
28
+ import torch.nn.functional as F
29
+ from torch.utils.data import DataLoader
30
+ from torchvision import transforms
31
+ from torchvision.utils import make_grid, save_image
32
+
33
+ from datasets import load_dataset
34
+ from diffusers import DDIMScheduler, DDPMPipeline, DDPMScheduler, UNet2DModel
35
+
36
+
37
+ def parse_args():
38
+ p = argparse.ArgumentParser()
39
+ p.add_argument("--dataset_name", default="tglcourse/CelebA-faces-cropped-128")
40
+ p.add_argument("--split", default="train")
41
+ p.add_argument("--image_column", default="image")
42
+ p.add_argument("--resolution", type=int, default=128)
43
+ p.add_argument("--output_dir", default="runs/celeba128")
44
+ p.add_argument("--train_batch_size", type=int, default=16)
45
+ p.add_argument("--gradient_accumulation_steps", type=int, default=1)
46
+ p.add_argument("--max_train_steps", type=int, default=60_000)
47
+ p.add_argument("--max_hours", type=float, default=13.5,
48
+ help="hard wall-clock budget; stops at steps OR hours, whichever first")
49
+ p.add_argument("--learning_rate", type=float, default=1e-4)
50
+ p.add_argument("--warmup_steps", type=int, default=500)
51
+ p.add_argument("--ema_decay", type=float, default=0.9999)
52
+ p.add_argument("--num_train_timesteps", type=int, default=1000)
53
+ p.add_argument("--seed", type=int, default=42)
54
+ p.add_argument("--dataloader_num_workers", type=int, default=4)
55
+ p.add_argument("--log_every", type=int, default=100)
56
+ p.add_argument("--sample_every", type=int, default=3000)
57
+ p.add_argument("--num_sample_images", type=int, default=16)
58
+ p.add_argument("--ckpt_every", type=int, default=20_000)
59
+ p.add_argument("--keep_ckpts", type=int, default=2)
60
+ p.add_argument("--resume_from", default=None)
61
+ p.add_argument("--channels", type=int, nargs="+", default=[128, 128, 256, 256, 512])
62
+ p.add_argument("--layers_per_block", type=int, default=2)
63
+ p.add_argument("--no_tensorboard", action="store_true")
64
+ return p.parse_args()
65
+
66
+
67
+ def build_unet(resolution, channels, layers_per_block):
68
+ n = len(channels)
69
+ attn_idx = n - 2
70
+ down = ["DownBlock2D"] * n
71
+ up = ["UpBlock2D"] * n
72
+ down[attn_idx] = "AttnDownBlock2D"
73
+ up[n - 1 - attn_idx] = "AttnUpBlock2D"
74
+ return UNet2DModel(
75
+ sample_size=resolution,
76
+ in_channels=3,
77
+ out_channels=3,
78
+ layers_per_block=layers_per_block,
79
+ block_out_channels=tuple(channels),
80
+ down_block_types=tuple(down),
81
+ up_block_types=tuple(up),
82
+ )
83
+
84
+
85
+ def build_dataset(args):
86
+ ds = load_dataset(args.dataset_name, split=args.split)
87
+ tf = transforms.Compose([
88
+ transforms.Resize(args.resolution, interpolation=transforms.InterpolationMode.BILINEAR),
89
+ transforms.CenterCrop(args.resolution),
90
+ transforms.RandomHorizontalFlip(),
91
+ transforms.ToTensor(),
92
+ transforms.Normalize([0.5] * 3, [0.5] * 3),
93
+ ])
94
+
95
+ def apply(examples):
96
+ return {"images": [tf(img.convert("RGB")) for img in examples[args.image_column]]}
97
+
98
+ ds.set_transform(apply)
99
+ return ds
100
+
101
+
102
+ @torch.no_grad()
103
+ def ema_update(ema_model, model, decay):
104
+ for pe, pm in zip(ema_model.parameters(), model.parameters()):
105
+ pe.lerp_(pm.data, 1.0 - decay)
106
+
107
+
108
+ @torch.no_grad()
109
+ def generate_samples(ema_model, args, device, global_step):
110
+ ema_model.eval()
111
+ ddim = DDIMScheduler(num_train_timesteps=args.num_train_timesteps, beta_schedule="linear")
112
+ ddim.set_timesteps(50)
113
+ g = torch.Generator(device=device).manual_seed(args.seed)
114
+ x = torch.randn(args.num_sample_images, 3, args.resolution, args.resolution,
115
+ generator=g, device=device, dtype=torch.float16)
116
+ for t in ddim.timesteps:
117
+ tt = t.expand(x.shape[0]).to(device)
118
+ with torch.autocast("cuda", dtype=torch.float16):
119
+ pred = ema_model(x, tt).sample
120
+ x = ddim.step(pred, t, x).prev_sample
121
+ x = (x.float().clamp(-1, 1) + 1.0) / 2.0
122
+ out = Path(args.output_dir) / "samples"
123
+ out.mkdir(parents=True, exist_ok=True)
124
+ save_image(make_grid(x, nrow=int(math.sqrt(x.shape[0]))), out / f"step_{global_step:07d}.png")
125
+ ema_model.train()
126
+
127
+
128
+ def save_checkpoint(path, step, model, ema_model, optimizer, scaler):
129
+ torch.save({
130
+ "step": step,
131
+ "model": model.state_dict(),
132
+ "ema": ema_model.state_dict(),
133
+ "optimizer": optimizer.state_dict(),
134
+ "scaler": scaler.state_dict(),
135
+ }, path)
136
+
137
+
138
+ def prune_checkpoints(ckpt_dir, keep):
139
+ ckpts = sorted(ckpt_dir.glob("step_*.pt"))
140
+ for old in ckpts[:-keep]:
141
+ old.unlink()
142
+
143
+
144
+ def main():
145
+ args = parse_args()
146
+ out = Path(args.output_dir)
147
+ ckpt_dir = out / "checkpoints"
148
+ ckpt_dir.mkdir(parents=True, exist_ok=True)
149
+
150
+ torch.manual_seed(args.seed)
151
+ device = "cuda"
152
+ torch.backends.cuda.matmul.allow_tf32 = True
153
+ torch.backends.cudnn.allow_tf32 = True
154
+ torch.backends.cudnn.benchmark = True
155
+
156
+ writer = None
157
+ if not args.no_tensorboard:
158
+ try:
159
+ from torch.utils.tensorboard import SummaryWriter
160
+ writer = SummaryWriter(out / "tb")
161
+ except ImportError:
162
+ pass
163
+
164
+ ds = build_dataset(args)
165
+ loader = DataLoader(ds, batch_size=args.train_batch_size, shuffle=True,
166
+ num_workers=args.dataloader_num_workers, pin_memory=True,
167
+ drop_last=True)
168
+
169
+ model = build_unet(args.resolution, args.channels, args.layers_per_block).to(device)
170
+ ema_model = copy.deepcopy(model).eval()
171
+ for p in ema_model.parameters():
172
+ p.requires_grad_(False)
173
+ n_params = sum(p.numel() for p in model.parameters())
174
+ print(f"model params: {n_params / 1e6:.1f}M | dataset rows: {len(ds)} | "
175
+ f"batch {args.train_batch_size} x accum {args.gradient_accumulation_steps}", flush=True)
176
+
177
+ T = args.num_train_timesteps
178
+ noise_sched = DDPMScheduler(num_train_timesteps=T, beta_schedule="linear",
179
+ prediction_type="epsilon")
180
+ optimizer = torch.optim.AdamW(model.parameters(), lr=args.learning_rate)
181
+ scaler = torch.amp.GradScaler("cuda")
182
+
183
+ start_step = 0
184
+ if args.resume_from:
185
+ st = torch.load(args.resume_from, map_location=device)
186
+ model.load_state_dict(st["model"])
187
+ ema_model.load_state_dict(st["ema"])
188
+ optimizer.load_state_dict(st["optimizer"])
189
+ scaler.load_state_dict(st["scaler"])
190
+ start_step = st["step"]
191
+ print(f"resumed from {args.resume_from} at step {start_step}", flush=True)
192
+
193
+ lr_sched = torch.optim.lr_scheduler.LambdaLR(
194
+ optimizer, lambda s: min(1.0, (s + 1) / max(1, args.warmup_steps)),
195
+ last_epoch=start_step - 1)
196
+
197
+ accum = args.gradient_accumulation_steps
198
+ model.train()
199
+ optimizer.zero_grad(set_to_none=True)
200
+ data_iter = iter(loader)
201
+ epoch = 0
202
+ t0 = time.time()
203
+ budget_s = args.max_hours * 3600
204
+ running = 0.0
205
+
206
+ for step in range(start_step, args.max_train_steps):
207
+ if time.time() - t0 >= budget_s:
208
+ print(f"wall-clock budget of {args.max_hours}h reached at step {step}", flush=True)
209
+ break
210
+ try:
211
+ batch = next(data_iter)
212
+ except StopIteration:
213
+ epoch += 1
214
+ data_iter = iter(loader)
215
+ batch = next(data_iter)
216
+
217
+ x0 = batch["images"].to(device, non_blocking=True)
218
+ noise = torch.randn_like(x0)
219
+ timesteps = torch.randint(0, T, (x0.shape[0],), device=device, dtype=torch.long)
220
+ noisy = noise_sched.add_noise(x0, noise, timesteps)
221
+
222
+ with torch.autocast("cuda", dtype=torch.float16):
223
+ pred = model(noisy, timesteps).sample
224
+ loss = F.mse_loss(pred.float(), noise)
225
+ scaler.scale(loss / accum).backward()
226
+
227
+ if (step + 1) % accum == 0:
228
+ scaler.unscale_(optimizer)
229
+ grad_norm = torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0)
230
+ scaler.step(optimizer)
231
+ scaler.update()
232
+ optimizer.zero_grad(set_to_none=True)
233
+ lr_sched.step()
234
+ ema_update(ema_model, model, args.ema_decay)
235
+ running += loss.item()
236
+
237
+ if writer and (step + 1) % args.log_every == 0:
238
+ writer.add_scalar("train/loss", running / args.log_every, step + 1)
239
+ writer.add_scalar("train/lr", lr_sched.get_last_lr()[0], step + 1)
240
+
241
+ if (step + 1) % args.log_every == 0:
242
+ el = time.time() - t0
243
+ sps = (step + 1 - start_step) / max(el, 1e-6)
244
+ eta = min((args.max_train_steps - (step + 1)) / max(sps, 1e-6), budget_s - el)
245
+ print(f"step {step + 1}/{args.max_train_steps} | epoch {epoch} | "
246
+ f"loss {running / args.log_every:.4f} | grad {grad_norm:.2f} | "
247
+ f"{sps:.2f} it/s | ETA {max(eta, 0) / 3600:.2f}h", flush=True)
248
+ running = 0.0
249
+
250
+ if (step + 1) % args.sample_every == 0:
251
+ generate_samples(ema_model, args, device, step + 1)
252
+
253
+ if (step + 1) % args.ckpt_every == 0:
254
+ save_checkpoint(ckpt_dir / f"step_{step + 1}.pt", step + 1,
255
+ model, ema_model, optimizer, scaler)
256
+ prune_checkpoints(ckpt_dir, args.keep_ckpts)
257
+
258
+ save_checkpoint(ckpt_dir / "last.pt", step + 1, model, ema_model, optimizer, scaler)
259
+ generate_samples(ema_model, args, device, step + 1)
260
+ pipe = DDPMPipeline(unet=ema_model,
261
+ scheduler=DDPMScheduler(num_train_timesteps=T, beta_schedule="linear"))
262
+ pipe.save_pretrained(out / "final")
263
+ if writer:
264
+ writer.close()
265
+ print(f"done: {(time.time() - t0) / 3600:.2f}h | final pipeline at {out / 'final'}", flush=True)
266
+
267
+
268
+ if __name__ == "__main__":
269
+ main()
unet/config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_class_name": "UNet2DModel",
3
+ "_diffusers_version": "0.39.0",
4
+ "act_fn": "silu",
5
+ "add_attention": true,
6
+ "attention_head_dim": 8,
7
+ "attn_norm_num_groups": null,
8
+ "block_out_channels": [
9
+ 128,
10
+ 128,
11
+ 256,
12
+ 256,
13
+ 512
14
+ ],
15
+ "center_input_sample": false,
16
+ "class_embed_type": null,
17
+ "down_block_types": [
18
+ "DownBlock2D",
19
+ "DownBlock2D",
20
+ "DownBlock2D",
21
+ "AttnDownBlock2D",
22
+ "DownBlock2D"
23
+ ],
24
+ "downsample_padding": 1,
25
+ "downsample_type": "conv",
26
+ "dropout": 0.0,
27
+ "flip_sin_to_cos": true,
28
+ "freq_shift": 0,
29
+ "in_channels": 3,
30
+ "layers_per_block": 2,
31
+ "mid_block_scale_factor": 1,
32
+ "mid_block_type": "UNetMidBlock2D",
33
+ "norm_eps": 1e-05,
34
+ "norm_num_groups": 32,
35
+ "num_class_embeds": null,
36
+ "num_train_timesteps": null,
37
+ "out_channels": 3,
38
+ "resnet_time_scale_shift": "default",
39
+ "sample_size": 128,
40
+ "time_embedding_dim": null,
41
+ "time_embedding_type": "positional",
42
+ "up_block_types": [
43
+ "UpBlock2D",
44
+ "AttnUpBlock2D",
45
+ "UpBlock2D",
46
+ "UpBlock2D",
47
+ "UpBlock2D"
48
+ ],
49
+ "upsample_type": "conv"
50
+ }
unet/diffusion_pytorch_model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3230ecffd2276430652df93f7ab970846a3537f6b54e1c117487e628093665c5
3
+ size 285788892