Delete index.html
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>NEB chain model · TESS eclipse classifier</title><link rel="icon" type="image/png" href="logo-mark.png"><style> @font-face { font-family: 'JetBrains Mono Variable'; src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2'); font-weight: 100 800; font-display: swap; } @font-face { font-family: 'Inter Variable'; src: url(fonts/inter-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; } /* the palette and window of neuralenginebyte.org (neb-web/src/styles.css) */ :root { --bg: #0a0a0a; --panel: #121212; --panel2: #171717; --line: #262626; --line2: #343434; --fg: #ffffff; --mid: #bcbcbc; --dim: #808080; --faint: #444444; --g: #87ff87; --c: #69d6ff; --r: #ff6b7a; --font: 'JetBrains Mono Variable', 'JetBrains Mono', 'Cascadia Mono', ui-monospace, Consolas, monospace; --sans: 'Inter Variable', 'Inter', system-ui, 'Segoe UI', sans-serif; } * { box-sizing: border-box; margin: 0; padding: 0; } body { min-height: 100dvh; background: radial-gradient(900px 520px at 10% -8%, rgba(135, 255, 135, 0.075), transparent 62%), radial-gradient(800px 520px at 100% 112%, rgba(105, 214, 255, 0.05), transparent 62%), var(--bg); background-attachment: fixed; color: var(--mid); font: 400 14px/1.55 var(--font); -webkit-font-smoothing: antialiased; } ::selection { background: var(--g); color: #04100a; } a { color: var(--c); text-decoration: none; } button, input { font: inherit; color: inherit; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.stage { min-height: 100dvh; padding: clamp(8px, 2vw, 24px); display: flex; } .window { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(135, 255, 135, 0.035), 0 30px 90px rgba(0, 0, 0, 0.65), 0 0 120px rgba(135, 255, 135, 0.035); } .window::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.012) 0 1px, transparent 1px 3px); } .titlebar { display: flex; align-items: center; gap: 14px; padding: 0 12px; height: 44px; background: var(--panel2); border-bottom: 1px solid var(--line); } .titlebar img { height: 26px; width: 26px; } .tab { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 6px; font-size: 12.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2); white-space: nowrap; } .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--g); box-shadow: 0 0 8px var(--g); animation: pulse 2.4s ease-in-out infinite; } .titlebar .site { margin-left: auto; font-size: 12px; color: var(--dim); } .titlebar .site:hover { color: var(--fg); } .status { display: flex; gap: 18px; align-items: center; min-height: 28px; padding: 4px 14px; border-top: 1px solid var(--line); background: var(--panel2); color: var(--dim); font-size: 11.5px; flex-wrap: wrap; } .status .sp { flex: 1; }
.body { flex: 1; padding: 26px 28px 30px; max-width: 980px; width: 100%; margin: 0 auto; } .eyebrow { margin-bottom: 10px; font: 500 10.5px var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--g); } h1 { margin-bottom: 10px; font: 600 20px/1.25 var(--sans); letter-spacing: -0.012em; color: var(--fg); } .lead { font: 400 13.5px/1.62 var(--sans); max-width: 70ch; } .note { margin-top: 8px; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; } .star { margin-top: 6px; font-size: 12.5px; color: var(--mid); overflow-wrap: anywhere; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px 0 14px; } .btn { padding: 6px 12px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel2); color: var(--mid); font-size: 12.5px; cursor: pointer; transition: color 0.15s, border-color 0.15s; } .btn:hover { color: var(--fg); border-color: var(--g); } .field { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dim); } .field input { width: 90px; padding: 6px 10px; border-radius: 6px; border: 1px solid var(--line2); background: var(--bg); color: var(--fg); }
.views { display: grid; grid-template-columns: 3fr 1fr; gap: 12px; } @media (max-width: 640px) { .views { grid-template-columns: 1fr; } .body { padding: 20px 16px; } } .pane { border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; } .pane-title { display: flex; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--fg); } .pane-title span { margin-left: auto; color: var(--dim); font-size: 11px; } svg { display: block; width: 100%; height: 150px; }
.answer { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2); } .answer .big { font-size: 15px; color: var(--fg); } .answer b { color: var(--g); font-weight: 600; } .ok { color: var(--g); } .no { color: var(--r); } .answer .sums { margin-top: 4px; font-size: 12px; color: var(--dim); }
.score { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; } .score h2 { font: 500 10.5px var(--font); letter-spacing: 0.16em; text-transform: uppercase; color: var(--g); margin-bottom: 10px; } .grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; } .stat { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; } .stat .v { font-size: 18px; color: var(--fg); } .stat .k { font-size: 11.5px; color: var(--dim); } .limits { margin-top: 14px; font: 400 12.5px/1.6 var(--sans); color: var(--dim); max-width: 75ch; }</style></head><body><div class="stage"> <div class="window"> <header class="titlebar"> <img src="logo-mark.png" alt="NEB"> <p class="tab"><span class="dot"></span>model · tess</p> <a class="site" href="https://neuralenginebyte.org" target="_blank" rel="noopener noreferrer">neuralenginebyte.org ↗</a> </header>
<main class="body"> <p class="eyebrow">Chain model</p> <h1>TESS eclipse classifier</h1> <p class="lead">A small convolutional network in 4-bit integers, trained by the miners of the NEB proof-of-work chain: each mining attempt is one training step. It reads a folded light curve of a TESS signal and answers <b class="ok">eclipse</b> or junk. Everything runs in your browser.</p> <p class="note" id="meta">Loading the weights…</p>
<div class="controls"> <button class="btn" id="eclipse">Random eclipse</button> <button class="btn" id="junk">Random junk</button> <label class="field">signal <input id="idx" type="number" min="0" value="0"></label> <button class="btn" id="go">Show</button> </div>
<div class="views"> <section class="pane"><p class="pane-title">Global view <span>whole folded orbit · 583 bins</span></p> <svg id="global" viewBox="0 0 583 100" preserveAspectRatio="none"></svg></section> <section class="pane"><p class="pane-title">Local view <span>201 bins</span></p> <svg id="local" viewBox="0 0 201 100" preserveAspectRatio="none"></svg></section> </div> <p class="note">Real TESS data: the light curve of the star below, folded on the period the catalog found. Brightness drops downward, in 8 steps of depth (0 to 7), as the chain sees it.</p>
<div class="answer"> <p class="big" id="verdict"></p> <p class="star" id="star"></p> <p class="sums" id="sums"></p> </div>
<section class="score"> <h2>Held-out test signals</h2> <div class="grid" id="stats"><div class="stat"><p class="v">…</p><p class="k">scoring</p></div></div> <p class="limits">These signals were kept out of the chain: the model never trained on them. The labels come from the Astronet-Triage-v2 catalog (Tey et al. 2023, CC BY 4.0), where people classified each signal. An answer of the model is a hint for a human, not a planet confirmation. The model changes with every block; this page uses the one snapshot named above.</p> </section> </main>
<footer class="status"> <span id="status-block">block …</span> <span class="sp"></span> <span>integer forward pass, checked bit for bit against the node's C code</span> </footer> </div></div><script type="module">import { unpackWeights, predict, readDataset } from "./neb-model.js";
const $ = (id) => document.getElementById(id);const [meta, packed, data, stars] = await Promise.all([ fetch("meta.json").then((r) => r.json()), fetch("slot1.bin").then((r) => r.arrayBuffer()), fetch("tess-test-q8.bin").then((r) => r.arrayBuffer()), fetch("signals.json").then((r) => r.json()),]);const w = unpackWeights(new Uint8Array(packed));const rows = readDataset(new Uint8Array(data));const s = meta.slots["1"];$("meta").textContent = `Weights of block ${meta.height}. Weights hash ${s.weightshash}.`;$("status-block").textContent = `block ${meta.height} · ${rows.length.toLocaleString("en-US")} test signals`;$("idx").max = rows.length - 1;
function plot(svg, values) { const pts = Array.from(values, (v, i) => `${i},${8 + (v / 7) * 84}`).join(" "); svg.innerHTML = `<polyline points="${pts}" fill="none" stroke="#87ff87" stroke-width="1.4" vector-effect="non-scaling-stroke"/>`;}
function show(i) { const r = rows[i]; $("idx").value = i; plot($("global"), r.x.subarray(0, 583)); plot($("local"), r.x.subarray(583, 784)); const p = predict(w, r.x); const name = (c) => (c ? "eclipse" : "junk"); const right = p.label === r.label; $("verdict").innerHTML = `Signal ${i}: the model says <b>${name(p.label)}</b>. The catalog says ${name(r.label)}. <span class="${right ? "ok" : "no"}">${right ? "✓ match" : "✗ miss"}</span>`; const st = stars[i]; $("star").innerHTML = st ? `Star <a href="https://exofop.ipac.caltech.edu/tess/target.php?id=${st.tic}" target="_blank" rel="noopener noreferrer">TIC ${st.tic}</a> · period ${st.period} d · transit ${st.duration_h} h · depth ${st.depth_ppm} ppm${st.tmag ? ` · Tmag ${st.tmag} (catalog)` : ""} · TESS year ${st.year}` : ""; $("sums").textContent = `raw output sums · junk ${p.sums[0]} · eclipse ${p.sums[1]}`;}
function pick(label) { const ids = rows.flatMap((r, i) => (r.label === label ? [i] : [])); show(ids[Math.floor(Math.random() * ids.length)]);}$("eclipse").onclick = () => pick(1);$("junk").onclick = () => pick(0);$("go").onclick = () => show(Math.max(0, Math.min(rows.length - 1, Number($("idx").value) || 0)));pick(1);
let right = 0, found = 0, eclipses = 0, said = 0;for (const r of rows) { const p = predict(w, r.x).label; right += p === r.label; eclipses += r.label; found += p & r.label; said += p;}const pct = (a, b) => `${(100 * a / b).toFixed(1)}%`;const stat = (v, k) => `<div class="stat"><p class="v">${v}</p><p class="k">${k}</p></div>`;$("stats").innerHTML = stat(`${found} / ${eclipses}`, "eclipses found") + stat(pct(found, said), `of the ${said} "eclipse" answers are eclipses`) + stat(pct(right, rows.length), "right answers") + stat(pct(rows.length - eclipses, rows.length), 'if it always said "junk"');</script></body></html>index.htmlDeleted-200