Commit a6a7060
committed
flowmatch: fix backprop ordering in MLP sgd_step
Compute d_h = W2^T * d_out before updating W2, not after.
The previous ordering used already-updated weights for the
layer 1 gradient, producing slightly wrong updates.1 parent 25cbed6 commit a6a7060
1 file changed
+4
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
154 | 158 | | |
155 | 159 | | |
156 | 160 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| |||
0 commit comments