AbstractPhil commited on
Commit
7ceb6a0
·
verified ·
1 Parent(s): 9cd65b2

exp009 shipped (2 seeds + reference rejudge): role reweighting directionally consistent but negligible - instrument + supervision upgrades queued (exp010/exp011)

Browse files
README.md CHANGED
@@ -75,6 +75,7 @@ resolution) so gaps live in a narrow band — the paired design is load-bearing.
75
  | exp003_sigma_registers | register probe: **sigma is the ONLY live axis** — caption/type/cond all compress to ≤0; ordering prereg MISS with design consequences | **shipped (candidate, s0)** |
76
  | exp004_anima_relay | relays on the 2B DiT via diffusion-pipe (bf16 per dtype law) | staged |
77
  | exp005_sdxl_tree4a | the SDXL capacity battery (guidepost/scaffold/skeleton) | designed |
 
78
  | exp008_multiband | band-ASSIGNED experts: **mechanism certifies — 3/3 surgical band lesions (50-200x), HIGH-noise band expert wins its band (label-corrected); uniform objective doesn't pay (roles enter exp009)** | **shipped (candidate, s0; s1 running)** |
79
  | exp006_sd15core_relay | CORE EPRED certification: **relay beats frozen (−2.5%) and matched LoRA 2-for-2; grounding gained (+0.036) where LoRA traded it; gates GROW on the core** | **shipped (candidate, s0)** |
80
  | exp007_amoe_lora | AMoE v1 vs monolith falsifier: **falsifier fires — uniform pressure ⇒ flat usage, dispatch pays nothing (Tree-1b law on diffusion); machinery green; next = structural band assignment** | **shipped (candidate, s0)** |
 
75
  | exp003_sigma_registers | register probe: **sigma is the ONLY live axis** — caption/type/cond all compress to ≤0; ordering prereg MISS with design consequences | **shipped (candidate, s0)** |
76
  | exp004_anima_relay | relays on the 2B DiT via diffusion-pipe (bf16 per dtype law) | staged |
77
  | exp005_sdxl_tree4a | the SDXL capacity battery (guidepost/scaffold/skeleton) | designed |
78
+ | exp009_bandroles | role objectives: **directional hit 4/4 but noise-adjacent — frequency reweighting too collinear; needs qualitatively different supervision + generation-side gauges (exp010)** | **shipped (2 seeds + rejudge)** |
79
  | exp008_multiband | band-ASSIGNED experts: **mechanism certifies — 3/3 surgical band lesions (50-200x), HIGH-noise band expert wins its band (label-corrected); uniform objective doesn't pay (roles enter exp009)** | **shipped (candidate, s0; s1 running)** |
80
  | exp006_sd15core_relay | CORE EPRED certification: **relay beats frozen (−2.5%) and matched LoRA 2-for-2; grounding gained (+0.036) where LoRA traded it; gates GROW on the core** | **shipped (candidate, s0)** |
81
  | exp007_amoe_lora | AMoE v1 vs monolith falsifier: **falsifier fires — uniform pressure ⇒ flat usage, dispatch pays nothing (Tree-1b law on diffusion); machinery green; next = structural band assignment** | **shipped (candidate, s0)** |
exp009_bandroles/README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # exp009_bandroles — role objectives on the multiband mechanism (2 seeds + rejudge)
2
+
3
+ **Question.** Does role-differentiated training pressure (the stage's band-role
4
+ map as loss weighting) buy what the uniform objective couldn't (exp008,
5
+ 2-seed)? Roles as implemented: LOW-noise band +λ·HP-residual MSE (fine
6
+ detail), HIGH-noise band +λ·LP-residual MSE (coarse structure), MID standard;
7
+ λ=0.5; same crossfade windows route the pressure.
8
+
9
+ **Instrument note (confessed).** As first run, the reference arms lacked the
10
+ role gauges (P1 unmeasurable) — `dexp009_rejudge.py` post-hoc gauges the
11
+ exp008 checkpoints and frozen row under identical math (amendment pattern;
12
+ originals preserved).
13
+
14
+ **Results** (both seeds; gauges: lower is better):
15
+
16
+ | arm | HP gauge (LOW band) s0/s1 | LP gauge (HIGH band) s0/s1 | common val s0/s1 |
17
+ |---|---|---|---|
18
+ | frozen | 0.220686 | 0.001755 | 0.124788 |
19
+ | uniform mb3 (exp008) | 0.215756 / 0.215718 | 0.001640 / 0.001643 | 0.122004 / 0.121970 |
20
+ | **roles mb3** | **0.215649 / 0.215629** | **0.001638 / 0.001640** | 0.121994 / 0.121984 |
21
+ | monolith r48 | **0.215291 / 0.215304** | 0.001644 / 0.001645 | 0.121736 / 0.121745 |
22
+
23
+ | prereg | outcome |
24
+ |---|---|
25
+ | P1 role gauges move vs uniform | **DIRECTIONAL HIT 4/4** (both gauges, both seeds) — but margins 0.05–0.2%, noise-adjacent; monolith still wins the HP gauge outright |
26
+ | P2 common gauge undegraded | HIT (identical to uniform within 5th decimal) |
27
+ | P3 toggle bit-exact | HIT both seeds |
28
+ | P4 lesions surgical | HIT both seeds (asymmetries match exp008) |
29
+
30
+ **Verdict (2-seed, honest).** Frequency-reweighted role pressure produces a
31
+ CONSISTENT but ECONOMICALLY NEGLIGIBLE movement — HP/LP weighting of the same
32
+ epsilon target is nearly collinear with the base objective and does not
33
+ constitute a genuinely different task. Two consequences for the stage:
34
+ 1. Role differentiation needs QUALITATIVELY different supervision per band
35
+ (segmentation-mask blobbing for HIGH, diversity pressure, semantic
36
+ targets) — the exp011+ territory and the AMOE docket.
37
+ 2. The eps-MSE gauge family may be the limiting INSTRUMENT: what band experts
38
+ do at generation time is not necessarily visible in per-step eps error.
39
+ exp010 (step-gated controller + generation-side band-lesion battery,
40
+ judged in image space) is the instrument upgrade and runs next.
41
+
42
+ **Cost.** ~2.6 GPU-h/seed + 0.02h rejudge. Checkpoints: `roles_s{0,1}.pt`.
exp009_bandroles/dexp009_bandroles.py ADDED
@@ -0,0 +1,227 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """dexp009_bandroles.py — exp009: BAND-ROLE OBJECTIVES on the certified
2
+ multiband mechanism (stage plan phase 2; gated on exp008 P4 — HIT 3/3).
3
+
4
+ Phil's role map becomes TRAINING PRESSURE (the exp008 verdict: specialists
5
+ exist, but a uniform objective doesn't pay — the roles must):
6
+ LOW (fidelity/detail): + lambda * MSE on the HIGH-PASS residual
7
+ (HP = x − avgpool3(x)) — finer-detail pressure.
8
+ MID (continuity): standard eps MSE (unchanged).
9
+ HIGH (diversity/blob): + lambda * MSE on the LOW-PASS residual
10
+ (LP = avgpool7(x)) — coarse-structure pressure.
11
+ Per-sample loss = sum_b w_b(s01) * loss_b — the same crossfade windows route
12
+ role pressure to the right expert. JUDGING stays on the COMMON gauge
13
+ (plain eps MSE, per band) for comparability with exp008's uniform-objective
14
+ multiband (the control) + monolith; role-aligned gauges (HP-MSE on LOW,
15
+ LP-MSE on HIGH) reported alongside.
16
+
17
+ Prereg: P1 role-trained beats uniform-trained multiband in band0 on the LP
18
+ gauge AND band2 on the HP gauge (role pressure moves role-aligned quality);
19
+ P2 common-gauge own-band val not degraded >0.5% vs uniform multiband;
20
+ P3 toggle bit-exact; P4 lesions stay surgical. 1-seed candidate first.
21
+
22
+ Pod: bash pod2/run_exp009.sh [DEXP9_SEED=0 DEXP9_LAMBDA=0.5]
23
+ """
24
+ from __future__ import annotations
25
+
26
+ import json
27
+ import os
28
+ import sys
29
+ import time
30
+
31
+ sys.path[:0] = ["pod2", "."]
32
+
33
+ import torch
34
+ import torch.nn.functional as F
35
+
36
+ from pod_ledger import ledger_run, note, burn_down
37
+ from d1_substrate import MEM_FRACTION
38
+ from dexp006_sd15core_relay import make_schedule, add_noise
39
+ from dexp008_multiband import (MultibandDelta, band_weights, band_of, attach,
40
+ load_unet, BAND_EDGES, N_BANDS, RANK,
41
+ N_TRAIN, N_VAL)
42
+
43
+ BATCH = int(os.environ.get("DEXP9_BATCH", "16"))
44
+ STEPS = int(os.environ.get("DEXP9_STEPS", "3000"))
45
+ SEED = int(os.environ.get("DEXP9_SEED", "0"))
46
+ LAM = float(os.environ.get("DEXP9_LAMBDA", "0.5"))
47
+ LR, CFG_DROPOUT = 1e-3, 0.1
48
+ DATA_DIR = ("/workspace/data/dexp009" if os.path.isdir("/workspace")
49
+ else os.path.join(os.environ.get("GEOLIP_DATA", "./data"),
50
+ "dexp009"))
51
+ DEXP6_DIR = ("/workspace/data/dexp006" if os.path.isdir("/workspace")
52
+ else os.path.join(os.environ.get("GEOLIP_DATA", "./data"),
53
+ "dexp006"))
54
+ DEXP8_DIR = ("/workspace/data/dexp008" if os.path.isdir("/workspace")
55
+ else os.path.join(os.environ.get("GEOLIP_DATA", "./data"),
56
+ "dexp008"))
57
+ CKPT_DIR = ("/workspace/ckpts2/dexp009" if os.path.isdir("/workspace")
58
+ else DATA_DIR)
59
+
60
+
61
+ def hp(x):
62
+ """High-pass: x − avgpool3(x) (finer-detail component)."""
63
+ return x - F.avg_pool2d(x, 3, stride=1, padding=1)
64
+
65
+
66
+ def lp(x):
67
+ """Low-pass: avgpool7 (coarse structure)."""
68
+ return F.avg_pool2d(x, 7, stride=1, padding=3)
69
+
70
+
71
+ def role_losses(pred, target):
72
+ """Per-sample (B,) losses for each band role."""
73
+ base = ((pred - target) ** 2).mean(dim=(1, 2, 3))
74
+ low = base + LAM * ((hp(pred) - hp(target)) ** 2).mean(dim=(1, 2, 3))
75
+ high = base + LAM * ((lp(pred) - lp(target)) ** 2).mean(dim=(1, 2, 3))
76
+ return low, base, high # LOW, MID, HIGH roles
77
+
78
+
79
+ def run(device="cuda"):
80
+ torch.cuda.set_per_process_memory_fraction(MEM_FRACTION, 0)
81
+ os.makedirs(CKPT_DIR, exist_ok=True)
82
+ os.makedirs(DATA_DIR, exist_ok=True)
83
+ acp = make_schedule(device)
84
+ cache = torch.load(os.path.join(DEXP6_DIR, "cache.pt"),
85
+ map_location="cpu", weights_only=True)
86
+
87
+ def set_w(wraps, s01):
88
+ w = band_weights(s01)
89
+ for wr in wraps:
90
+ wr.w_bands = w
91
+ return w
92
+
93
+ def loss_of(unet, wraps, lat, ehs, gen):
94
+ bsz = lat.shape[0]
95
+ drop = torch.rand(bsz, generator=gen, device=device) < CFG_DROPOUT
96
+ ehs = ehs.clone()
97
+ ehs[drop] = 0
98
+ t = torch.randint(0, 1000, (bsz,), generator=gen, device=device)
99
+ w = set_w(wraps, t.float() / 1000.0) # (B, 3)
100
+ noise = torch.randn(lat.shape, generator=gen, device=device)
101
+ pred = unet(add_noise(lat, noise, t, acp), t, ehs,
102
+ return_dict=False)[0]
103
+ l_low, l_mid, l_high = role_losses(pred, noise)
104
+ return (w[:, 0] * l_low + w[:, 1] * l_mid + w[:, 2] * l_high).mean()
105
+
106
+ @torch.no_grad()
107
+ def val(unet, wraps):
108
+ """Common gauge (plain eps MSE per band) + role-aligned gauges."""
109
+ tot = []
110
+ per_band = {0: [], 1: [], 2: []}
111
+ role_g = {"high_band_lp": [], "low_band_hp": []}
112
+ for i in range(0, N_VAL, 32):
113
+ lat = cache["val_lat"][i:i + 32].to(device)
114
+ ehs = cache["val_ehs"][i:i + 32].to(device)
115
+ noise = cache["val_noise"][i:i + 32].to(device)
116
+ t = cache["val_t"][i:i + 32].to(device)
117
+ set_w(wraps, t.float() / 1000.0)
118
+ pred = unet(add_noise(lat, noise, t, acp), t, ehs,
119
+ return_dict=False)[0]
120
+ mse = ((pred - noise) ** 2).mean(dim=(1, 2, 3))
121
+ lp_mse = ((lp(pred) - lp(noise)) ** 2).mean(dim=(1, 2, 3))
122
+ hp_mse = ((hp(pred) - hp(noise)) ** 2).mean(dim=(1, 2, 3))
123
+ tot += mse.tolist()
124
+ for j, tv in enumerate((t.float() / 1000.0).tolist()):
125
+ b = band_of(tv)
126
+ per_band[b].append(mse[j].item())
127
+ if b == 2: # HIGH-noise rows
128
+ role_g["high_band_lp"].append(lp_mse[j].item())
129
+ if b == 0: # LOW-noise rows
130
+ role_g["low_band_hp"].append(hp_mse[j].item())
131
+ return (sum(tot) / len(tot),
132
+ {f"band{b}": round(sum(v) / max(len(v), 1), 6)
133
+ for b, v in per_band.items()},
134
+ {"high_band_lp_gauge": round(sum(role_g["high_band_lp"])
135
+ / max(len(role_g["high_band_lp"]), 1), 6),
136
+ "low_band_hp_gauge": round(sum(role_g["low_band_hp"])
137
+ / max(len(role_g["low_band_hp"]), 1), 6)})
138
+
139
+ # Band ordering (band_of): band0 = LOW noise (s01<=.35, late steps,
140
+ # fidelity role, +HP) | band1 = MID | band2 = HIGH noise (early steps,
141
+ # diversity/blob role, +LP).
142
+
143
+ results = {"config": {"lambda": LAM, "rank": RANK, "steps": STEPS,
144
+ "batch": BATCH, "seed": SEED,
145
+ "edges": BAND_EDGES,
146
+ "roles": "band0 LOW +HP | band1 MID std | "
147
+ "band2 HIGH +LP"}}
148
+
149
+ with ledger_run(f"dexp009 roles s{SEED}", budget_h=2.5) as h:
150
+ unet = load_unet(device)
151
+ mods, wraps = attach(unet, lambda d: MultibandDelta(d))
152
+ for m in mods:
153
+ m.assert_zero_init()
154
+ n_params = sum(p.numel() for p in mods.parameters())
155
+ opt = torch.optim.Adam(mods.parameters(), lr=LR, weight_decay=0.0)
156
+ gen = torch.Generator(device=device).manual_seed(SEED + 42)
157
+ idx = torch.Generator().manual_seed(SEED + 7)
158
+ torch.cuda.reset_peak_memory_stats()
159
+ t0 = time.time()
160
+ for step in range(1, STEPS + 1):
161
+ sel = torch.randint(0, N_TRAIN, (BATCH,), generator=idx)
162
+ loss = loss_of(unet, wraps, cache["lat"][sel].to(device),
163
+ cache["ehs"][sel].to(device), gen)
164
+ loss.backward()
165
+ opt.step()
166
+ opt.zero_grad(set_to_none=True)
167
+ if step == 50 or step % 500 == 0:
168
+ print(f"[roles] step {step}: loss {loss.item():.4f} | "
169
+ f"{(time.time() - t0) / step:.2f}s/step | peak "
170
+ f"{torch.cuda.max_memory_allocated() / 2**30:.1f}GB",
171
+ flush=True)
172
+ v, pb, rg = val(unet, wraps)
173
+ for m in mods:
174
+ m.enabled = False
175
+ v_off, _, _ = val(unet, wraps)
176
+ for m in mods:
177
+ m.enabled = True
178
+ # lesions (P4 carry-over)
179
+ lesions = {}
180
+ for b in range(N_BANDS):
181
+ for m in mods:
182
+ m.band_enabled[b] = False
183
+ _, pb_les, _ = val(unet, wraps)
184
+ lesions[f"lesion_band{b}"] = pb_les
185
+ for m in mods:
186
+ m.band_enabled[b] = True
187
+ torch.save({"mods": [m.state_dict() for m in mods]},
188
+ os.path.join(CKPT_DIR, f"roles_s{SEED}.pt"))
189
+ results["roles"] = {"n_params": n_params, "val": v, "per_band": pb,
190
+ "role_gauges": rg, "val_toggled_off": v_off,
191
+ "lesions": lesions}
192
+ del unet, mods
193
+ torch.cuda.empty_cache()
194
+ h["verdict"] = f"val {v:.5f} rg {rg}"
195
+
196
+ # compare against exp008's uniform-objective multiband (the control)
197
+ ref_f = os.path.join(DEXP8_DIR, "results.json")
198
+ if os.path.exists(ref_f):
199
+ ref = json.load(open(ref_f))
200
+ results["reference_uniform_mb3"] = {
201
+ "val": ref["multiband3"]["val"],
202
+ "per_band": ref["multiband3"]["per_band"]}
203
+ results["reference_frozen"] = ref["frozen"]
204
+ with open(os.path.join(DATA_DIR, "results.json" if SEED == 0
205
+ else f"results_s{SEED}.json"), "w") as f:
206
+ json.dump(results, f, indent=2)
207
+ note(f"dexp009: {json.dumps(results['roles']['role_gauges'])}")
208
+ print(json.dumps({k: v for k, v in results.items()
209
+ if k != "config"}, indent=2)[:2000])
210
+ burn_down()
211
+ return results
212
+
213
+
214
+ def smoke():
215
+ x = torch.randn(2, 4, 16, 16)
216
+ assert hp(x).shape == x.shape and lp(x).shape == x.shape
217
+ assert torch.allclose(hp(x) + F.avg_pool2d(x, 3, 1, 1), x, atol=1e-6)
218
+ l, m_, h_ = role_losses(x, torch.zeros_like(x))
219
+ assert l.shape == (2,) and (l >= m_).all() and (h_ >= m_).all()
220
+ print("dexp009 smoke PASSED (hp/lp filters + role losses; GPU is pod work)")
221
+
222
+
223
+ if __name__ == "__main__":
224
+ if "--run" in sys.argv:
225
+ run()
226
+ else:
227
+ smoke()
exp009_bandroles/dexp009_rejudge.py ADDED
@@ -0,0 +1,126 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """dexp009_rejudge.py — amendment: role gauges for the REFERENCE arms.
2
+
3
+ Instrument gap (confessed): the exp009 bed computed HP/LP role gauges only on
4
+ the roles arm; the uniform-multiband reference (exp008 ckpt) and frozen row
5
+ never got them, leaving prereg P1 unmeasurable as-run. This rejudge loads
6
+ the exp008 checkpoints and computes the identical gauges — amendment rows,
7
+ originals preserved (the runner-1 rejudge pattern).
8
+
9
+ Pod: python3 pod2/dexp009_rejudge.py --run [--seed 0]
10
+ """
11
+ from __future__ import annotations
12
+
13
+ import json
14
+ import os
15
+ import sys
16
+
17
+ sys.path[:0] = ["pod2", "."]
18
+
19
+ import torch
20
+
21
+ from pod_ledger import ledger_run, note
22
+ from d1_substrate import MEM_FRACTION
23
+ from dexp006_sd15core_relay import make_schedule
24
+ from dexp008_multiband import MultibandDelta, MonoDelta, attach, load_unet
25
+ import dexp009_bandroles as bed9
26
+
27
+ DEXP8_CKPT = ("/workspace/ckpts2/dexp008" if os.path.isdir("/workspace")
28
+ else "./data/dexp008")
29
+ DATA_DIR = bed9.DATA_DIR
30
+
31
+
32
+ def run(device="cuda", seed=0):
33
+ torch.cuda.set_per_process_memory_fraction(MEM_FRACTION, 0)
34
+ acp = make_schedule(device)
35
+ bed9_cache = torch.load(os.path.join(bed9.DEXP6_DIR, "cache.pt"),
36
+ map_location="cpu", weights_only=True)
37
+ # reuse bed9's val by injecting its module-level cache reference
38
+ out = {}
39
+
40
+ def gauge(mods_loader, label):
41
+ unet = load_unet(device)
42
+ wraps = []
43
+ if mods_loader is not None:
44
+ mods, wraps = attach(unet, mods_loader["mk"])
45
+ sds = mods_loader["sds"]
46
+ for m, sd in zip(mods, sds):
47
+ m.load_state_dict(sd, strict=True)
48
+ # bind bed9.val's closure requirements
49
+ v, pb, rg = _val(unet, wraps, bed9_cache, acp, device)
50
+ out[label] = {"val": round(v, 6), "per_band": pb, "role_gauges": rg}
51
+ print(f"[rejudge] {label}: {rg} (val {v:.6f})", flush=True)
52
+ del unet
53
+ torch.cuda.empty_cache()
54
+
55
+ with ledger_run(f"dexp009 rejudge refs s{seed}", budget_h=0.3) as h:
56
+ gauge(None, "frozen")
57
+ ck = torch.load(os.path.join(DEXP8_CKPT, f"mb3_s{seed}.pt"),
58
+ map_location="cpu", weights_only=True)
59
+ gauge({"mk": lambda d: MultibandDelta(d), "sds": ck["mods"]},
60
+ "uniform_mb3")
61
+ ck = torch.load(os.path.join(DEXP8_CKPT, f"mono48_s{seed}.pt"),
62
+ map_location="cpu", weights_only=True)
63
+ gauge({"mk": lambda d: MonoDelta(d), "sds": ck["mods"]},
64
+ "monolith")
65
+ h["verdict"] = "refs gauged"
66
+
67
+ path = os.path.join(DATA_DIR, f"rejudge_refs_s{seed}.json")
68
+ with open(path, "w") as f:
69
+ json.dump(out, f, indent=2)
70
+ note(f"dexp009 rejudge: {json.dumps({k: v['role_gauges'] for k, v in out.items()})}")
71
+ return out
72
+
73
+
74
+ def _val(unet, wraps, cache, acp, device):
75
+ """exp009's val, standalone (identical math)."""
76
+ import torch.nn.functional as F
77
+ from dexp008_multiband import band_weights, band_of
78
+ from dexp009_bandroles import hp, lp
79
+ from dexp006_sd15core_relay import add_noise
80
+ N_VAL = bed9.N_VAL
81
+ tot, per_band = [], {0: [], 1: [], 2: []}
82
+ role_g = {"high_band_lp": [], "low_band_hp": []}
83
+ with torch.no_grad():
84
+ for i in range(0, N_VAL, 32):
85
+ lat = cache["val_lat"][i:i + 32].to(device)
86
+ ehs = cache["val_ehs"][i:i + 32].to(device)
87
+ noise = cache["val_noise"][i:i + 32].to(device)
88
+ t = cache["val_t"][i:i + 32].to(device)
89
+ w = band_weights(t.float() / 1000.0)
90
+ for wr in wraps:
91
+ wr.w_bands = w
92
+ pred = unet(add_noise(lat, noise, t, acp), t, ehs,
93
+ return_dict=False)[0]
94
+ mse = ((pred - noise) ** 2).mean(dim=(1, 2, 3))
95
+ lpm = ((lp(pred) - lp(noise)) ** 2).mean(dim=(1, 2, 3))
96
+ hpm = ((hp(pred) - hp(noise)) ** 2).mean(dim=(1, 2, 3))
97
+ tot += mse.tolist()
98
+ for j, tv in enumerate((t.float() / 1000.0).tolist()):
99
+ b = band_of(tv)
100
+ per_band[b].append(mse[j].item())
101
+ if b == 2:
102
+ role_g["high_band_lp"].append(lpm[j].item())
103
+ if b == 0:
104
+ role_g["low_band_hp"].append(hpm[j].item())
105
+ return (sum(tot) / len(tot),
106
+ {f"band{b}": round(sum(v) / max(len(v), 1), 6)
107
+ for b, v in per_band.items()},
108
+ {"high_band_lp_gauge": round(sum(role_g["high_band_lp"])
109
+ / max(len(role_g["high_band_lp"]), 1), 6),
110
+ "low_band_hp_gauge": round(sum(role_g["low_band_hp"])
111
+ / max(len(role_g["low_band_hp"]), 1), 6)})
112
+
113
+
114
+ def smoke():
115
+ assert callable(_val) and os.path.basename(DEXP8_CKPT)
116
+ print("dexp009_rejudge smoke PASSED (parse; GPU run is pod work)")
117
+
118
+
119
+ if __name__ == "__main__":
120
+ if "--run" in sys.argv:
121
+ seed = 0
122
+ if "--seed" in sys.argv:
123
+ seed = int(sys.argv[sys.argv.index("--seed") + 1])
124
+ run(seed=seed)
125
+ else:
126
+ smoke()
exp009_bandroles/rejudge_refs_s0.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "frozen": {
3
+ "val": 0.124788,
4
+ "per_band": {
5
+ "band0": 0.256406,
6
+ "band1": 0.064227,
7
+ "band2": 0.008726
8
+ },
9
+ "role_gauges": {
10
+ "high_band_lp_gauge": 0.001755,
11
+ "low_band_hp_gauge": 0.220686
12
+ }
13
+ },
14
+ "uniform_mb3": {
15
+ "val": 0.122004,
16
+ "per_band": {
17
+ "band0": 0.250432,
18
+ "band1": 0.063046,
19
+ "band2": 0.008534
20
+ },
21
+ "role_gauges": {
22
+ "high_band_lp_gauge": 0.00164,
23
+ "low_band_hp_gauge": 0.215756
24
+ }
25
+ },
26
+ "monolith": {
27
+ "val": 0.121736,
28
+ "per_band": {
29
+ "band0": 0.249881,
30
+ "band1": 0.062896,
31
+ "band2": 0.008539
32
+ },
33
+ "role_gauges": {
34
+ "high_band_lp_gauge": 0.001644,
35
+ "low_band_hp_gauge": 0.215291
36
+ }
37
+ }
38
+ }
exp009_bandroles/rejudge_refs_s1.json ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "frozen": {
3
+ "val": 0.124788,
4
+ "per_band": {
5
+ "band0": 0.256406,
6
+ "band1": 0.064227,
7
+ "band2": 0.008726
8
+ },
9
+ "role_gauges": {
10
+ "high_band_lp_gauge": 0.001755,
11
+ "low_band_hp_gauge": 0.220686
12
+ }
13
+ },
14
+ "uniform_mb3": {
15
+ "val": 0.12197,
16
+ "per_band": {
17
+ "band0": 0.250386,
18
+ "band1": 0.062999,
19
+ "band2": 0.008543
20
+ },
21
+ "role_gauges": {
22
+ "high_band_lp_gauge": 0.001643,
23
+ "low_band_hp_gauge": 0.215718
24
+ }
25
+ },
26
+ "monolith": {
27
+ "val": 0.121745,
28
+ "per_band": {
29
+ "band0": 0.249925,
30
+ "band1": 0.062876,
31
+ "band2": 0.008538
32
+ },
33
+ "role_gauges": {
34
+ "high_band_lp_gauge": 0.001645,
35
+ "low_band_hp_gauge": 0.215304
36
+ }
37
+ }
38
+ }
exp009_bandroles/results.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "lambda": 0.5,
4
+ "rank": 16,
5
+ "steps": 3000,
6
+ "batch": 16,
7
+ "seed": 0,
8
+ "edges": [
9
+ 0.35,
10
+ 0.75
11
+ ],
12
+ "roles": "band0 LOW +HP | band1 MID std | band2 HIGH +LP"
13
+ },
14
+ "roles": {
15
+ "n_params": 1235568,
16
+ "val": 0.12199406854688277,
17
+ "per_band": {
18
+ "band0": 0.250405,
19
+ "band1": 0.063047,
20
+ "band2": 0.008536
21
+ },
22
+ "role_gauges": {
23
+ "high_band_lp_gauge": 0.001638,
24
+ "low_band_hp_gauge": 0.215649
25
+ },
26
+ "val_toggled_off": 0.1247876692286809,
27
+ "lesions": {
28
+ "lesion_band0": {
29
+ "band0": 0.25634,
30
+ "band1": 0.063105,
31
+ "band2": 0.008536
32
+ },
33
+ "lesion_band1": {
34
+ "band0": 0.250423,
35
+ "band1": 0.064084,
36
+ "band2": 0.008546
37
+ },
38
+ "lesion_band2": {
39
+ "band0": 0.250405,
40
+ "band1": 0.063054,
41
+ "band2": 0.008691
42
+ }
43
+ }
44
+ },
45
+ "reference_uniform_mb3": {
46
+ "val": 0.12200367445166194,
47
+ "per_band": {
48
+ "band0": 0.250432,
49
+ "band1": 0.063046,
50
+ "band2": 0.008534
51
+ }
52
+ },
53
+ "reference_frozen": {
54
+ "val": 0.1247876692286809,
55
+ "per_band": {
56
+ "band0": 0.256406,
57
+ "band1": 0.064227,
58
+ "band2": 0.008726
59
+ },
60
+ "band_n": {
61
+ "band0_n": 98,
62
+ "band1_n": 98,
63
+ "band2_n": 60
64
+ }
65
+ }
66
+ }
exp009_bandroles/results_s1.json ADDED
@@ -0,0 +1,66 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "config": {
3
+ "lambda": 0.5,
4
+ "rank": 16,
5
+ "steps": 3000,
6
+ "batch": 16,
7
+ "seed": 1,
8
+ "edges": [
9
+ 0.35,
10
+ 0.75
11
+ ],
12
+ "roles": "band0 LOW +HP | band1 MID std | band2 HIGH +LP"
13
+ },
14
+ "roles": {
15
+ "n_params": 1235568,
16
+ "val": 0.12197124349131627,
17
+ "per_band": {
18
+ "band0": 0.250387,
19
+ "band1": 0.063004,
20
+ "band2": 0.008538
21
+ },
22
+ "role_gauges": {
23
+ "high_band_lp_gauge": 0.00164,
24
+ "low_band_hp_gauge": 0.215629
25
+ },
26
+ "val_toggled_off": 0.1247876692286809,
27
+ "lesions": {
28
+ "lesion_band0": {
29
+ "band0": 0.256343,
30
+ "band1": 0.063064,
31
+ "band2": 0.008538
32
+ },
33
+ "lesion_band1": {
34
+ "band0": 0.250401,
35
+ "band1": 0.064081,
36
+ "band2": 0.008548
37
+ },
38
+ "lesion_band2": {
39
+ "band0": 0.250387,
40
+ "band1": 0.063011,
41
+ "band2": 0.008691
42
+ }
43
+ }
44
+ },
45
+ "reference_uniform_mb3": {
46
+ "val": 0.12200367445166194,
47
+ "per_band": {
48
+ "band0": 0.250432,
49
+ "band1": 0.063046,
50
+ "band2": 0.008534
51
+ }
52
+ },
53
+ "reference_frozen": {
54
+ "val": 0.1247876692286809,
55
+ "per_band": {
56
+ "band0": 0.256406,
57
+ "band1": 0.064227,
58
+ "band2": 0.008726
59
+ },
60
+ "band_n": {
61
+ "band0_n": 98,
62
+ "band1_n": 98,
63
+ "band2_n": 60
64
+ }
65
+ }
66
+ }
exp009_bandroles/roles_s0.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a6d7e4aa71cc797fec438edf8e5794139c1658bf817409d2d91f9cab9fc33155
3
+ size 4994597