benjamin-paine commited on
Commit
c5bf555
1 Parent(s): 72b29c8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +122 -3
README.md CHANGED
@@ -1,3 +1,122 @@
1
- ---
2
- license: unlicense
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: unlicense
3
+ datasets:
4
+ - ylecun/mnist
5
+ - zalando-datasets/fashion_mnist
6
+ - uoft-cs/cifar10
7
+ - uoft-cs/cifar100
8
+ ---
9
+
10
+ <div align="center">
11
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/64429aaf7feb866811b12f73/8kvCLpvl9uihViFbWLNLl.png" width="512" />
12
+ <h1><ins>Y</ins>et <ins>A</ins>nother <ins>R</ins>e-implementation <ins>R</ins>epository</h1>
13
+ <h3>AI/ML models and experiments, reimplemented for my own understanding.</h3>
14
+ </div>
15
+
16
+ # Overview
17
+
18
+ I'm a career software engineer with a computer science background, but do not work with AI/ML in my daily duties. This repository aims to take concepts, models, and code from papers and around the web, and re-implement them using the techniques and best practices I've picked up over the years, and hopefully learn some things in the process. If you're like me and learned to code long before you learned about ML, this repo could help you, too.
19
+
20
+ **Here on Huggingface, this repository holds the results of the experiments, not the code. To see the code, please go to [my GitHub](https://github.com/painebenjamin/yarr).**
21
+
22
+ # Implemented Models
23
+
24
+ | Model | Purpose | Paper |
25
+ | ----- | ------- | ----- |
26
+ | [Rectified Flow](#rectified-flow) | Image Synthesis | [Scaling Rectified Flow Transformers for High-Resolution Image Synthesis, Esser et al. (2024)](https://arxiv.org/pdf/2403.03206) |
27
+
28
+ # Prerequisites
29
+
30
+ Assuming python and CUDA are installed, you can ensure necessary packages are available via `pip install -r requirements.txt`
31
+
32
+ # Rectified Flow
33
+
34
+ ## 1-Channel
35
+
36
+ ### MNIST
37
+
38
+ <div align="center">
39
+ <img src="https://github.com/user-attachments/assets/1d6c5e94-299e-41d8-8cc5-6bc4718f3dbd" />
40
+ <img src="https://github.com/user-attachments/assets/108c1b2a-35ed-4cfe-af02-4c0eb5765915" /><br />
41
+ Trained for 100 epochs in ~45 minutes.
42
+ </div>
43
+
44
+ ### Fashion MNIST
45
+
46
+ <div align="center">
47
+ <img src="https://github.com/user-attachments/assets/088e0ed2-5fda-4014-8b14-5be3aa0eac1d" />
48
+ <img src="https://github.com/user-attachments/assets/08c6a60e-ee2f-4642-84ec-5fb8d0efc72a" /><br />
49
+ Trained for 100 epochs in ~45 minutes.
50
+ </div>
51
+
52
+ ## 3-Channel
53
+
54
+ ### CIFAR-10
55
+
56
+ <div align="center">
57
+ <img src="https://github.com/user-attachments/assets/e8d5341a-f63e-4a13-a95b-0d9ef64d4dac" />
58
+ <img src="https://github.com/user-attachments/assets/82b4225f-8b8c-4889-8ab8-5a882211d99a" /><br />
59
+ Trained for 100 epochs in ~3 hours.
60
+ </div>
61
+
62
+ ### CIFAR-100
63
+
64
+ <div align="center">
65
+ <img src="https://github.com/user-attachments/assets/7fafee17-2202-4763-82fd-c5cff4b69515" />
66
+ <img src="https://github.com/user-attachments/assets/499631dc-b8b8-4ce7-985c-31f41d258c0e" /><br />
67
+ Trained for 250 epochs in ~7.5 hours.
68
+ </div>
69
+
70
+ ### Training Commands
71
+
72
+ #### Basic Usage
73
+
74
+ *This should be run from the root of the repository.*
75
+
76
+ ```sh
77
+ python -m yarr.trainers.rectified_flow
78
+ ```
79
+
80
+ #### Options
81
+
82
+ *Note: [Weights and Biases](https://wandb.ai/) is a freemium service for monitoring AI/ML training runs, using it will allow you to see details and samples throughout training. Use `--wandb-entity` to pass your team name to use it.*
83
+
84
+ ```
85
+ Usage: python -m yarr.trainers.rectified_flow [OPTIONS]
86
+
87
+ Train a Rectified Flow model on either MNIST, Fashion-MNIST, CIFAR-10, or CIFAR-100.
88
+
89
+ Options:
90
+ -lr, --learning-rate FLOAT Learning rate for the optimizer. [default: 0.001]
91
+ -e, --num-epochs INTEGER Number of epochs to train the model. [default: 100]
92
+ -w, --num-workers INTEGER Number of workers for the data loader. [default: 4]
93
+ -b, --batch-size INTEGER Batch size for training. [default: 250]
94
+ --wandb-entity TEXT Weights and Biases entity.
95
+ --resume Resume training from the latest checkpoint.
96
+ --fashion-mnist Use Fashion MNIST dataset instead of MNIST.
97
+ --cifar-10 Use CIFAR-10 dataset instead of MNIST.
98
+ --cifar-100 Use CIFAR-100 dataset instead of MNIST.
99
+ --help Show this message and exit.
100
+ ```
101
+
102
+ # License
103
+
104
+ All models in this repository are released into the public domain with no guarantees or warranty under [the unlicense.](https://github.com/painebenjamin/yarr/tree/main?tab=Unlicense-1-ov-file#readme)
105
+
106
+ # Contributions
107
+
108
+ While this repository is primarily for my own use and likely won't be useful as a library, I would welcome any recommendations others may have on other experiments to conduct or ways my implementations can be improved.
109
+
110
+ # Citations and Acknowledgments
111
+
112
+ [Simo Ryu (cloneofsimo), minRF](https://github.com/cloneofsimo/minRF) for the inspiration and reference implementation.
113
+
114
+ ```
115
+ @misc{ryu2024minrf,
116
+ author = {Simo Ryu},
117
+ title = {minRF: Minimal Implementation of Scalable Rectified Flow Transformers},
118
+ year = 2024,
119
+ publisher = {Github},
120
+ url = {https://github.com/cloneofsimo/minRF},
121
+ }
122
+ ```