File size: 16,851 Bytes
d917852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
================================================================================
FLOW MATCH RELAY β€” FULL ANALYSIS TOOLKIT
  Device: cuda
================================================================================
Loading weights: 100%
 169/169 [00:00<00:00, 4115.48it/s, Materializing param=unet.time_emb.3.weight]
  Params: 6,746,403 (relay: 76,384, 1.1%)
  Relay modules: 2

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 1: Relay Diagnostics β€” Drift, Gates, Anchor Geometry
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  unet.mid_block1.relay:
    Patches: 16, Anchors/patch: 16, Patch dim: 16
    Drift (rad):  mean=0.096787  std=0.031425  min=0.025191  max=0.204950
    Drift (deg):  mean=5.55Β°  max=11.74Β°
    Gates:        mean=0.0594  std=0.0017  min=0.0560  max=0.0619
    Patch 0: anchor_cos mean=0.0443 max=0.6491 min=-0.5109
    Patch 1: anchor_cos mean=0.0329 max=0.6991 min=-0.6696
    Patch 2: anchor_cos mean=-0.0137 max=0.5337 min=-0.6256
    Patch 3: anchor_cos mean=0.0025 max=0.5802 min=-0.5198
    Near 0.29154: 0.0% of anchors within Β±0.05
    Per-patch mean drift:
      Patch  0: 0.083389 rad (4.78Β°)
      Patch  1: 0.105304 rad (6.03Β°)
      Patch  2: 0.084447 rad (4.84Β°)
      Patch  3: 0.115432 rad (6.61Β°)
      Patch  4: 0.103072 rad (5.91Β°)
      Patch  5: 0.053514 rad (3.07Β°)
      Patch  6: 0.116086 rad (6.65Β°)
      Patch  7: 0.074704 rad (4.28Β°)
      Patch  8: 0.119158 rad (6.83Β°)
      Patch  9: 0.134659 rad (7.72Β°)
      Patch 10: 0.112943 rad (6.47Β°)
      Patch 11: 0.076762 rad (4.40Β°)
      Patch 12: 0.114448 rad (6.56Β°)
      Patch 13: 0.109745 rad (6.29Β°)
      Patch 14: 0.056048 rad (3.21Β°)
      Patch 15: 0.088878 rad (5.09Β°)

  unet.mid_block2.relay:
    Patches: 16, Anchors/patch: 16, Patch dim: 16
    Drift (rad):  mean=0.116423  std=0.031319  min=0.045233  max=0.246318
    Drift (deg):  mean=6.67Β°  max=14.11Β°
    Gates:        mean=0.0658  std=0.0019  min=0.0627  max=0.0702
    Patch 0: anchor_cos mean=-0.0104 max=0.5409 min=-0.5740
    Patch 1: anchor_cos mean=0.0241 max=0.5879 min=-0.5389
    Patch 2: anchor_cos mean=0.0198 max=0.6510 min=-0.5917
    Patch 3: anchor_cos mean=0.0060 max=0.5366 min=-0.7307
    Near 0.29154: 0.4% of anchors within Β±0.05
    Per-patch mean drift:
      Patch  0: 0.119493 rad (6.85Β°)
      Patch  1: 0.139048 rad (7.97Β°)
      Patch  2: 0.096759 rad (5.54Β°)
      Patch  3: 0.159487 rad (9.14Β°)
      Patch  4: 0.123855 rad (7.10Β°)
      Patch  5: 0.094995 rad (5.44Β°)
      Patch  6: 0.129639 rad (7.43Β°)
      Patch  7: 0.077257 rad (4.43Β°)
      Patch  8: 0.127187 rad (7.29Β°)
      Patch  9: 0.114844 rad (6.58Β°)
      Patch 10: 0.118358 rad (6.78Β°)
      Patch 11: 0.097721 rad (5.60Β°)
      Patch 12: 0.128776 rad (7.38Β°)
      Patch 13: 0.127976 rad (7.33Β°)
      Patch 14: 0.086075 rad (4.93Β°)
      Patch 15: 0.121296 rad (6.95Β°)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 2: Bottleneck Feature Geometry β€” CV at the relay point
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  CV of bottleneck features at different timesteps:
       t                                   module       CV    eff_d     norm
    0.00                    unet.mid_block1.relay   0.5503     34.5    51.61
    0.00                          unet.mid_block1   0.5316     34.5    51.61
    0.00                            unet.mid_attn   0.4850     38.8    51.91
    0.00                    unet.mid_block2.relay   0.5030     40.8    63.07
    0.00                          unet.mid_block2   0.4623     40.8    63.07
    0.25                    unet.mid_block1.relay   0.4621     43.1    52.02
    0.25                          unet.mid_block1   0.4761     43.1    52.02
    0.25                            unet.mid_attn   0.4429     47.2    52.35
    0.25                    unet.mid_block2.relay   0.4353     48.7    63.47
    0.25                          unet.mid_block2   0.4243     48.7    63.47
    0.50                    unet.mid_block1.relay   0.4567     41.3    51.88
    0.50                          unet.mid_block1   0.4775     41.3    51.88
    0.50                            unet.mid_attn   0.4195     45.0    52.22
    0.50                    unet.mid_block2.relay   0.4303     46.3    63.28
    0.50                          unet.mid_block2   0.4266     46.3    63.28
    0.75                    unet.mid_block1.relay   0.4972     35.2    51.85
    0.75                          unet.mid_block1   0.5265     35.2    51.85
    0.75                            unet.mid_attn   0.4821     39.5    52.07
    0.75                    unet.mid_block2.relay   0.4743     40.7    63.12
    0.75                          unet.mid_block2   0.4939     40.7    63.12
    1.00                    unet.mid_block1.relay   0.5709     24.0    58.44
    1.00                          unet.mid_block1   0.5983     24.0    58.44
    1.00                            unet.mid_attn   0.5804     24.8    58.74
    1.00                    unet.mid_block2.relay   0.6099     25.0    70.53
    1.00                          unet.mid_block2   0.6065     25.0    70.53

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 3: Per-Class Anchor Utilization
  Which anchors activate for each class?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Nearest anchor distribution per class (Patch 0):
       class     0     1     2     3     4     5     6     7     8     9    10    11    12    13    14    15
       plane   0%    0%    0%    0%    0%    0%    0%   22%β–ˆ   0%    0%    0%    0%    0%    0%   77%β–ˆ   0% 
        auto   0%    0%    0%    0%    0%    0%    0%   20%β–ˆ   0%    0%    0%    0%    0%    0%   80%β–ˆ   0% 
        bird   0%    0%    1%    0%    0%    0%    0%   42%β–ˆ   0%    0%    0%    0%    0%    0%   57%β–ˆ   0% 
         cat   0%    0%    0%    0%    0%    0%    0%   40%β–ˆ   0%    0%    0%    0%    0%    0%   60%β–ˆ   0% 
        deer   0%    0%    1%    0%    0%    0%    0%   58%β–ˆ   0%    0%    0%    0%    0%    0%   41%β–ˆ   0% 
         dog   0%    0%    0%    0%    0%    0%    0%   39%β–ˆ   0%    0%    0%    0%    0%    0%   61%β–ˆ   0% 
        frog   0%    0%    0%    0%    0%    0%    0%   58%β–ˆ   0%    0%    0%    0%    0%    0%   42%β–ˆ   0% 
       horse   0%    0%    0%    0%    0%    0%    0%   57%β–ˆ   0%    0%    0%    0%    0%    0%   43%β–ˆ   0% 
        ship   0%    0%    0%    0%    0%    0%    0%    2%    0%    0%    0%    0%    0%    0%   98%β–ˆ   0% 
       truck   0%    0%    0%    0%    0%    0%    0%   54%β–ˆ   0%    0%    0%    0%    0%    0%   46%β–ˆ   0% 

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 4: Gate Dynamics β€” do relay gates respond to timestep?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Note: gates are learned parameters, not t-dependent.
  Measuring relay output magnitude at different t instead.

       t   relay_Ξ”_norm    relay_Ξ”_cos   input_norm  output_norm
    0.00       116.3409     0.01136649       321.42       423.60
    0.10       116.6277     0.01213849       323.16       424.56
    0.25       116.7582     0.01237500       329.56       430.23
    0.50       117.6399     0.01344323       331.23       431.26
    0.75       118.0994     0.01383245       334.28       433.97
    0.90       118.1683     0.01333457       350.58       449.37
    1.00       119.9183     0.01262599       384.39       482.87

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 5: Generation Quality β€” Per-Class Diversity
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
       class  intra_cos  intra_std       CV     norm
       plane     0.8748     0.0821   0.6407    33.17
        auto     0.8073     0.0672   0.3739    27.07
        bird     0.8779     0.0694   0.6898    27.62
         cat     0.7880     0.0993   0.5233    26.13
        deer     0.8695     0.0630   0.5286    26.79
         dog     0.8332     0.0703   0.4365    27.46
        frog     0.8332     0.0711   0.5007    25.48
       horse     0.8313     0.0810   0.4687    29.01
        ship     0.8920     0.0519   0.5069    32.44
       truck     0.8311     0.0585   0.3973    29.58

  βœ“ Saved per-class grids to analysis/

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 6: Velocity Field β€” how does v_pred behave across t?
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
       t     v_norm      v_std   vΒ·target    v_cos_t
    0.05      53.05     0.9593     0.8501     0.3426
    0.10      55.90     1.0099     0.8958     0.2447
    0.25      58.23     1.0513     0.9352     0.1561
    0.50      58.96     1.0641     0.9486     0.1258
    0.75      58.85     1.0615     0.9411     0.1444
    0.90      57.49     1.0360     0.9244     0.1876
    0.95      56.50     1.0187     0.9126     0.2168

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 7: Ablation β€” Relay ON vs OFF during generation
  Disable relay gates, measure generation difference
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Relay ON  β€” mean pixel: 0.4528  std: 0.2227
  Relay OFF β€” mean pixel: 0.4524  std: 0.2232
  Pixel diff:    0.002449
  Cosine sim:    0.999977
  Max pixel Ξ”:   0.074433
  βœ“ Saved analysis/relay_ablation.png (top=ON, bottom=OFF)

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 8: Anchor Constellation Structure
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  unet.mid_block1.relay:
    Home↔Current cos: mean=0.994831  min=0.979071
    Patch 0 anchor spread: mean_cos=0.0443  max_cos=0.6491  min_cos=-0.5109
    Patch 1 anchor spread: mean_cos=0.0329  max_cos=0.6991  min_cos=-0.6696
    Patch 2 anchor spread: mean_cos=-0.0137  max_cos=0.5337  min_cos=-0.6256
    Patch 3 anchor spread: mean_cos=0.0025  max_cos=0.5802  min_cos=-0.5198
    Patch 0 anchor eff_dim: 11.3 / 16
    Patch 1 anchor eff_dim: 11.9 / 16
    Patch 2 anchor eff_dim: 11.7 / 16
    Patch 3 anchor eff_dim: 11.5 / 16

  unet.mid_block2.relay:
    Home↔Current cos: mean=0.992746  min=0.969817
    Patch 0 anchor spread: mean_cos=-0.0104  max_cos=0.5409  min_cos=-0.5740
    Patch 1 anchor spread: mean_cos=0.0241  max_cos=0.5879  min_cos=-0.5389
    Patch 2 anchor spread: mean_cos=0.0198  max_cos=0.6510  min_cos=-0.5917
    Patch 3 anchor spread: mean_cos=0.0060  max_cos=0.5366  min_cos=-0.7307
    Patch 0 anchor eff_dim: 11.8 / 16
    Patch 1 anchor eff_dim: 11.9 / 16
    Patch 2 anchor eff_dim: 12.0 / 16
    Patch 3 anchor eff_dim: 11.4 / 16

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 9: Sampling Trajectory β€” CV through ODE steps
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    step      t     x_norm      x_std   CV_pixel
       0   1.00      54.32     0.9801     0.0110
       1   0.98      53.21     0.9602     0.0111
       5   0.90      48.88     0.8819     0.0123
      10   0.80      43.61     0.7869     0.0112
      20   0.60      33.95     0.6123     0.0241
      30   0.40      26.37     0.4764     0.0707
      40   0.20      22.88     0.4184     0.1773
      49   0.02      24.85     0.4587     0.2497

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
TEST 10: Inter-Class vs Intra-Class Separation
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Inter-class cosine similarity matrix:
            plan  auto  bird   cat  deer   dog  frog  hors  ship  truc
     plane   1.0  0.99  0.99  0.98  0.98  0.97  0.98  0.99  1.00  0.98
      auto  0.99   1.0  0.99  0.98  0.98  0.97  0.98  0.99  0.99  0.99
      bird  0.99  0.99   1.0  0.99  0.99  0.99  0.99  1.00  0.99  0.98
       cat  0.98  0.98  0.99   1.0  0.99  1.00  0.99  0.99  0.97  0.96
      deer  0.98  0.98  0.99  0.99   1.0  0.99  1.00  0.99  0.97  0.96
       dog  0.97  0.97  0.99  1.00  0.99   1.0  0.99  0.98  0.96  0.95
      frog  0.98  0.98  0.99  0.99  1.00  0.99   1.0  0.99  0.97  0.97
     horse  0.99  0.99  1.00  0.99  0.99  0.98  0.99   1.0  0.98  0.98
      ship  1.00  0.99  0.99  0.97  0.97  0.96  0.97  0.98   1.0  0.99
     truck  0.98  0.99  0.98  0.96  0.96  0.95  0.97  0.98  0.99   1.0

  Intra-class cos: 0.8438 Β± 0.0318
  Inter-class cos: 0.8305 Β± 0.0230
  Separation ratio: 1.02Γ—

================================================================================
ANALYSIS COMPLETE
================================================================================

  Files saved to analysis/:
    - class_*.png:           per-class generated samples
    - all_classes.png:       4 samples per class, 10 columns
    - relay_ablation.png:    relay ON (top) vs OFF (bottom)

  Key metrics to look for:
    1. Anchor drift β†’ did any converge near 0.29154?
    2. Gate values β†’ did they learn to open from init (0.047)?
    3. Per-class anchor utilization β†’ class-specific routing?
    4. Relay ablation β†’ does turning off the relay change generation?
    5. Intra/inter-class ratio β†’ > 1.0 means classes are separable
    6. Velocity cosine β†’ higher = better flow matching
    7. CV through ODE β†’ how does geometry evolve during generation?

================================================================================