SabaPivot's picture
download
raw
1.87 kB
"""Boundary audit: how far out on the real line does our construction reach?
The paper's Theorem 1 domain is [-M_sigma, M_sigma] with M_sigma = 2^(emax-2) = 2^125
(float32). Our independent construction has its own overflow budget; we measure it."""
import json, os, sys
import numpy as np
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from construct import Construction, ACT_NAMES
OUT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..", "outputs")
SEED = 20260725
rows = []
for name in ACT_NAMES:
best = None
for hp in range(-23, 126, 8):
Z = (2 * np.arange(-4, 5)).reshape(-1, 1)
try:
C = Construction(name, np.float32, hp=hp, Z=Z, d=1, mode="thm31", n_extra=4)
C.draw_targets(seed=SEED + 21)
net = C.build()
bad = 0
for i in range(C.m):
v, g = net.value_and_grad(C.X[i], C.hstar[i])
bad += int(v[0] != C.fstar[i]) + int(g[0] != C.gstar[i, 0])
if bad == 0:
best = dict(hp=hp, x_absmax=float(np.max(np.abs(C.X))),
log2_x_absmax=float(np.log2(float(np.max(np.abs(C.X))))))
else:
rows.append(dict(activation=name, hp=hp, status=f"{bad} mismatches"))
break
except Exception as e:
rows.append(dict(activation=name, hp=hp,
status=f"{type(e).__name__}: {str(e)[:60]}"))
break
rows.append(dict(activation=name, largest_verified=best,
paper_domain_log2=125,
note="points x = k*2^hp, |k| <= 8, 9 points, L=9, float32"))
print(name, best, rows[-2].get("status"))
with open(os.path.join(OUT, "claim1_wide_domain.json"), "w") as f:
json.dump(rows, f, indent=1, default=float)
print("wrote claim1_wide_domain.json")

Xet Storage Details

Size:
1.87 kB
·
Xet hash:
cc41b3093acdcb480c99c9abfc5cb7285ad670b4fe620f5507fed6ae7bb0649e

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.