wop commited on
Commit
6187293
Β·
verified Β·
1 Parent(s): 2b2a279

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +143 -160
README.md CHANGED
@@ -2,173 +2,156 @@
2
  license: mit
3
  pipeline_tag: text-to-image
4
  ---
5
- <div style="background: linear-gradient(135deg, #252525, #1a1a1a); padding: 2rem; border-radius: 12px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.3); margin-bottom: 20px;">
6
- <h1 style="color: #33b0d8; margin-bottom: 0.5rem; font-size: 2.5rem;">
7
- PixelModel πŸ–ΌοΈ
8
- </h1>
9
- <p style="color: #cccccc; font-size: 1.1rem; margin-top: 0;">
10
- A neural network where the weights <strong>are</strong> the image.
11
- </p>
12
- </div>
13
-
14
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
15
- <h2 style="color: #ffffff; margin-top: 0;">πŸ§ͺ Dataset vs Outputs</h2>
16
- <p style="color:#cccccc;">
17
- Ground truth dataset images compared with generated outputs.
18
- </p>
19
-
20
- <table style="width: 100%; border-collapse: collapse; color: #cccccc; text-align: center;">
21
- <tr>
22
- <th style="padding: 10px; color:#33b0d8;">Red</th>
23
- <th style="padding: 10px; color:#33b0d8;">Green</th>
24
- <th style="padding: 10px; color:#33b0d8;">Blue</th>
25
- </tr>
26
- <tr>
27
- <td style="padding: 10px;">
28
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
29
- <img src="dataset/red.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
30
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
31
- <img src="out_red.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
32
- </td>
33
- <td style="padding: 10px;">
34
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
35
- <img src="dataset/green.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
36
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
37
- <img src="out_green.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
38
- </td>
39
- <td style="padding: 10px;">
40
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
41
- <img src="dataset/blue.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
42
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
43
- <img src="out_blue.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
44
- </td>
45
- </tr>
46
- <tr>
47
- <th style="padding: 10px; color:#33b0d8;">White</th>
48
- <th style="padding: 10px; color:#33b0d8;">Yellow</th>
49
- <th style="padding: 10px; color:#33b0d8;">Dark</th>
50
- </tr>
51
- <tr>
52
- <td style="padding: 10px;">
53
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
54
- <img src="dataset/white.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
55
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
56
- <img src="out_white.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
57
- </td>
58
- <td style="padding: 10px;">
59
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
60
- <img src="dataset/yellow.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
61
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
62
- <img src="out_yellow.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
63
- </td>
64
- <td style="padding: 10px;">
65
- <div style="font-size: 0.8rem; color:#888;">dataset</div>
66
- <img src="dataset/dark.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
67
- <div style="font-size: 0.8rem; color:#888;">Model output</div>
68
- <img src="out_dark.png" style="width: 110px; image-rendering: pixelated; border-radius: 6px;" />
69
- </td>
70
- </tr>
71
-
72
- </table>
73
- </div>
74
-
75
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
76
- <h2 style="color: #ffffff; margin-top: 0;">What is this?</h2>
77
- <p style="color: #cccccc;">
78
- <code>model.png</code> is not a picture of anything. It <em>is</em> the model.
79
- Every pixel’s RGB values encode neural network weights:
80
- </p>
81
-
82
- <ul style="color: #cccccc; line-height: 1.6;">
83
- <li><strong>R channel</strong> Model output weight magnitude</li>
84
- <li><strong>B channel</strong> Model output weight sign (β‰₯128 = positive)</li>
85
- <li><strong>G channel</strong> Model output bias values</li>
86
- </ul>
87
-
88
- <p style="color: #cccccc;">
89
- At inference time, pixels are parsed into 3 weight matrices (a tiny MLP).
90
- The prompt is embedded into a vector, then a forward pass generates a 32Γ—32 image.
91
- </p>
92
-
93
- <p style="color: #cccccc;">
94
- Training directly optimizes pixel values via gradient descent until the PNG itself becomes the model.
95
- </p>
96
- </div>
97
-
98
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
99
- <h2 style="color: #ffffff; margin-top: 0;">πŸ“ Files</h2>
100
-
101
- <pre style="background:#1a1a1a; padding: 1rem; border-radius: 8px; color:#cccccc; overflow-x:auto;">
102
- model.png ← THE MODEL (64Γ—3200 px, ~284 KB)
103
  main.py ← inference
104
  train.py ← training
105
- model.py ← architecture (pixels Model output weights Model output forward pass)
106
  dataset/ ← training data
107
  cat.png
108
  cat.txt ← prompt: "a cat"
109
- ...
110
- </pre>
111
- </div>
112
-
113
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
114
- <h2 style="color: #ffffff; margin-top: 0;">βš™οΈ Usage</h2>
115
-
116
- <h3 style="color:#33b0d8;">Train</h3>
117
- <pre style="background:#1a1a1a; padding: 1rem; border-radius: 8px; color:#cccccc;">
118
  python train.py
119
- python train.py --epochs 500 --lr 0.05
120
- </pre>
121
-
122
- <h3 style="color:#33b0d8;">Generate</h3>
123
- <pre style="background:#1a1a1a; padding: 1rem; border-radius: 8px; color:#cccccc;">
124
  python main.py "red"
125
- python main.py "a cat" --out cat_out.png --scale 8
126
- </pre>
127
-
128
- <p style="color:#cccccc;">
129
- <code>--scale 8</code> upscales 32Γ—32 Model output 256Γ—256 using nearest-neighbour interpolation to preserve pixel structure.
130
- </p>
131
- </div>
132
-
133
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
134
- <h2 style="color: #ffffff; margin-top: 0;">🧠 Architecture</h2>
135
-
136
- <pre style="background:#1a1a1a; padding: 1rem; border-radius: 8px; color:#cccccc;">
137
  prompt string
138
- Model output char-level embedding Model output 32-dim vector
139
- Model output W1 (64Γ—32) Model output tanh
140
- Model output W2 (64Γ—64) Model output tanh
141
- Model output W3 (3072Γ—64) Model output sigmoid
142
- Model output reshape Model output 32Γ—32Γ—3 image
143
- </pre>
144
-
145
- <p style="color:#cccccc;">
146
- All weights live inside <code>model.png</code>. Opening the PNG is literally opening the neural network.
147
- </p>
148
- </div>
149
-
150
- <div style="background-color: #252525; padding: 1.5rem; border-radius: 12px; margin-bottom: 20px;">
151
- <h2 style="color: #ffffff; margin-top: 0;">πŸ“Š Dataset Tips</h2>
152
-
153
- <ul style="color:#cccccc; line-height:1.6;">
154
- <li>6–20 image-prompt pairs is enough</li>
155
- <li>Simple targets converge fastest (solid colors, gradients, shapes)</li>
156
- <li>200–500 epochs typically sufficient</li>
157
- <li>Loss below 0.001 is good for simple datasets</li>
158
- <li>Model capacity is fixed (~600K implicit parameters)</li>
159
- </ul>
160
- </div>
161
-
162
- <div style="background: linear-gradient(135deg, #1f1f1f, #101010); padding: 2rem; border-radius: 12px; text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.4);">
163
- <h2 style="color: #ffffff;">Why?</h2>
164
- <p style="color: #cccccc;">
165
- It’s a toy. It’s not useful. But it’s cool that it works.
166
- </p>
167
- </div>
168
 
169
- <div style="background: linear-gradient(135deg, #1f1f1f, #101010); padding: 2rem; border-radius: 12px; text-align: center; margin-top: 20px;">
170
- <h2 style="color: #ffffff;">Seton Labs</h2>
171
- <p style="color: #cccccc;">
172
- Coordinate, evaluate, upgrade
173
- </p>
174
  </div>
 
2
  license: mit
3
  pipeline_tag: text-to-image
4
  ---
5
+ <div style="font-family: system-ui, sans-serif; background: #0f0f0f; color: #eaeaea; padding: 2rem; border-radius: 16px; max-width: 860px; margin: auto;">
6
+
7
+ <!-- HERO -->
8
+ <div style="background: #161616; border: 1px solid #222; padding: 2rem; border-radius: 14px; text-align: center; margin-bottom: 1.5rem;">
9
+ <h1 style="color: #33b0d8; font-size: 2rem; margin: 0 0 0.5rem;">PixelModel πŸ–ΌοΈ</h1>
10
+ <p style="color: #aaa; font-size: 0.95rem; margin: 0;">
11
+ A neural network where the weights <strong style="color: #ddd;">are</strong> the image.
12
+ </p>
13
+ </div>
14
+
15
+ <!-- DATASET VS OUTPUTS -->
16
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
17
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.5rem;">πŸ§ͺ Dataset vs Outputs</h2>
18
+ <p style="color: #aaa; font-size: 0.875rem; margin: 0 0 1rem;">Ground truth dataset images compared with generated outputs.</p>
19
+ <table style="width: 100%; border-collapse: collapse; text-align: center;">
20
+ <tr>
21
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">Red</th>
22
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">Green</th>
23
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">Blue</th>
24
+ </tr>
25
+ <tr>
26
+ <td style="padding: 8px;">
27
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
28
+ <img src="dataset/red.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
29
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
30
+ <img src="out_red.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
31
+ </td>
32
+ <td style="padding: 8px;">
33
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
34
+ <img src="dataset/green.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
35
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
36
+ <img src="out_green.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
37
+ </td>
38
+ <td style="padding: 8px;">
39
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
40
+ <img src="dataset/blue.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
41
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
42
+ <img src="out_blue.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">White</th>
47
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">Yellow</th>
48
+ <th style="padding: 8px; color: #33b0d8; font-size: 0.85rem;">Dark</th>
49
+ </tr>
50
+ <tr>
51
+ <td style="padding: 8px;">
52
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
53
+ <img src="dataset/white.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
54
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
55
+ <img src="out_white.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
56
+ </td>
57
+ <td style="padding: 8px;">
58
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
59
+ <img src="dataset/yellow.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
60
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
61
+ <img src="out_yellow.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
62
+ </td>
63
+ <td style="padding: 8px;">
64
+ <div style="font-size: 0.75rem; color: #555; margin-bottom: 4px;">dataset</div>
65
+ <img src="dataset/dark.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
66
+ <div style="font-size: 0.75rem; color: #555; margin: 4px 0;">output</div>
67
+ <img src="out_dark.png" style="width: 100px; image-rendering: pixelated; border-radius: 6px; display: block; margin: auto;" />
68
+ </td>
69
+ </tr>
70
+ </table>
71
+ </div>
72
+
73
+ <!-- WHAT IS THIS -->
74
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
75
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.6rem;">What is this?</h2>
76
+ <p style="color: #aaa; font-size: 0.875rem; line-height: 1.7; margin: 0 0 0.75rem;">
77
+ <code style="background: #1e1e1e; padding: 2px 6px; border-radius: 4px;">model.png</code> is not a picture of anything β€” it <em>is</em> the model.
78
+ Every pixel's RGB values encode neural network weights:
79
+ </p>
80
+ <ul style="color: #aaa; font-size: 0.875rem; line-height: 1.7; margin: 0 0 0.75rem; padding-left: 1.1rem;">
81
+ <li><strong style="color: #ddd;">R channel</strong> β€” weight magnitude</li>
82
+ <li><strong style="color: #ddd;">B channel</strong> β€” weight sign (β‰₯128 = positive)</li>
83
+ <li><strong style="color: #ddd;">G channel</strong> β€” bias values</li>
84
+ </ul>
85
+ <p style="color: #aaa; font-size: 0.875rem; line-height: 1.7; margin: 0;">
86
+ At inference, pixels are parsed into 3 weight matrices forming a tiny MLP.
87
+ The prompt is embedded into a vector, then a forward pass generates a 32Γ—32 image.
88
+ Training directly optimizes pixel values via gradient descent until the PNG itself becomes the model.
89
+ </p>
90
+ </div>
91
+
92
+ <!-- FILES -->
93
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
94
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.75rem;">πŸ“ Files</h2>
95
+ <pre style="background: #111; border: 1px solid #1e1e1e; padding: 1rem; border-radius: 8px; color: #aaa; font-size: 0.8rem; overflow-x: auto; margin: 0;">
96
+ model.png ← THE MODEL (64Γ—3200 px)
 
 
 
 
 
 
97
  main.py ← inference
98
  train.py ← training
99
+ model.py ← architecture
100
  dataset/ ← training data
101
  cat.png
102
  cat.txt ← prompt: "a cat"
103
+ ...</pre>
104
+ </div>
105
+
106
+ <!-- USAGE -->
107
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
108
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.75rem;">βš™οΈ Usage</h2>
109
+ <p style="color: #33b0d8; font-size: 0.8rem; font-weight: 600; margin: 0 0 0.3rem;">Train</p>
110
+ <pre style="background: #111; border: 1px solid #1e1e1e; padding: 0.9rem; border-radius: 8px; color: #aaa; font-size: 0.8rem; margin: 0 0 1rem;">
 
111
  python train.py
112
+ python train.py --epochs 500 --lr 0.05</pre>
113
+ <p style="color: #33b0d8; font-size: 0.8rem; font-weight: 600; margin: 0 0 0.3rem;">Generate</p>
114
+ <pre style="background: #111; border: 1px solid #1e1e1e; padding: 0.9rem; border-radius: 8px; color: #aaa; font-size: 0.8rem; margin: 0 0 0.75rem;">
 
 
115
  python main.py "red"
116
+ python main.py "a cat" --out cat_out.png --scale 8</pre>
117
+ <p style="color: #aaa; font-size: 0.8rem; margin: 0;">
118
+ <code style="background: #1e1e1e; padding: 2px 6px; border-radius: 4px;">--scale 8</code> upscales 32Γ—32 β†’ 256Γ—256 using nearest-neighbour interpolation.
119
+ </p>
120
+ </div>
121
+
122
+ <!-- ARCHITECTURE -->
123
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
124
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.75rem;">🧠 Architecture</h2>
125
+ <pre style="background: #111; border: 1px solid #1e1e1e; padding: 1rem; border-radius: 8px; color: #aaa; font-size: 0.8rem; overflow-x: auto; margin: 0 0 0.75rem;">
 
 
126
  prompt string
127
+ β†’ char-level embedding β†’ 32-dim vector
128
+ β†’ W1 (64Γ—32) β†’ tanh
129
+ β†’ W2 (64Γ—64) β†’ tanh
130
+ β†’ W3 (3072Γ—64) β†’ sigmoid
131
+ β†’ reshape β†’ 32Γ—32Γ—3 image</pre>
132
+ <p style="color: #aaa; font-size: 0.875rem; margin: 0;">
133
+ All weights live inside <code style="background: #1e1e1e; padding: 2px 6px; border-radius: 4px;">model.png</code>. Opening the PNG is literally opening the neural network.
134
+ </p>
135
+ </div>
136
+
137
+ <!-- DATASET TIPS -->
138
+ <div style="background: #161616; border: 1px solid #222; padding: 1.4rem; border-radius: 12px; margin-bottom: 1.5rem;">
139
+ <h2 style="color: #fff; font-size: 1rem; margin: 0 0 0.6rem;">πŸ“Š Dataset Tips</h2>
140
+ <ul style="color: #aaa; font-size: 0.875rem; line-height: 1.7; margin: 0; padding-left: 1.1rem;">
141
+ <li>6–20 image-prompt pairs is enough</li>
142
+ <li>Simple targets converge fastest (solid colors, gradients, shapes)</li>
143
+ <li>200–500 epochs typically sufficient</li>
144
+ <li>Loss below 0.001 is good for simple datasets</li>
145
+ <li>Model capacity is fixed (~600K implicit parameters)</li>
146
+ </ul>
147
+ </div>
148
+
149
+ <!-- FOOTER -->
150
+ <div style="background: #161616; border: 1px solid #222; padding: 1.2rem; border-radius: 12px; text-align: center;">
151
+ <p style="color: #aaa; font-size: 0.875rem; margin: 0 0 0.25rem;">
152
+ It's a toy. It's not useful. But it's cool that it works.
153
+ </p>
154
+ <p style="color: #444; font-size: 0.8rem; margin: 0;">Seton Labs Β· Coordinate Β· Evaluate Β· Upgrade</p>
155
+ </div>
 
156
 
 
 
 
 
 
157
  </div>