Upload 6 files
Browse filesFiles changed (6)
- README.md+99
- SHA256SUMSAdded+2
- kepler-v2.binAdded+3
- meta.jsonAdded+17
- neb-model.jsAdded+95
- tess.binAdded+3
123---license: apache-2.0---123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102---license: apache-2.0tags:- astronomy- exoplanets- tess- kepler- light-curves- integer-quantizationdatasets:- NeuralEngineByte/neb-tess-test---# NEB chain models: Kepler and TESS signal classifiersTwo small convolutional networks with 4-bit integer weights. The miners of the NEB proof-of-work chain train them: eachmining attempt is one training step on 16 samples, and the chain keeps the result. These files are a snapshot of bothmodels at one block.| file | chain slot | data it trains on | answers || --- | --- | --- | --- || `tess.bin` | 1, `tess` | TESS signals from the QLP light curves | 1 eclipse, 0 junk || `kepler-v2.bin` | 0, `kepler-v2` | Kepler DR24 transit signals | 1 planet candidate, 0 false positive |Snapshot: block 15,899 (block id `9ca17d22c80b4c8c5e22eff093f22240a49de76f4e8b72c31d3f51f8389c5ddb`). `meta.json` holdsthe weights hash of each model. Any NEB node returns the same values with the RPC call `getmodel [slot]`.## Try itThe Space `NeuralEngineByte/neb-tess-classifier` runs the TESS model in the browser on held-out test signals.## ArchitectureKEP1, from `spec/nebhash-v2.md` (section 3.1) in the NEB repository. The input is 784 values from 0 to 7: a global viewof the folded light curve (583 values) and a local view around the event (201 values). Each value is the depth of thedip below the median.| layer | input | operation | output || --- | --- | --- | --- || 1 | global view, 1 x 583 | conv1d, 8 filters, kernel 5; max pool 4 | 8 x 145 || 2 | 8 x 145 | conv1d, 16 filters, kernel 5; max pool 4 | 16 x 36 || 3 | local view, 1 x 201 | conv1d, 8 filters, kernel 5; max pool 4 | 8 x 50 || 4 | 8 x 50 | conv1d, 16 filters, kernel 5; max pool 4 | 16 x 12 || 5 | layers 2 and 4, 768 | linear | 32 || 6 | 32 | linear | 2 |26,000 weights from -8 to 7, no bias. Every layer sums in int32, applies a rounding right shift, then clips to -8..7.There is no floating point, so every correct implementation gives the same bits on any hardware.## Weight format13,000 bytes per model. Each byte holds two signed 4-bit weights, low nibble first, in layer order and row-major orderinside each tensor. The weights hash is `BLAKE3("neb-model-weights" || packed weights)`.`neb-model.js` unpacks the weights and runs the forward pass. The class is the first maximum of the two raw output sums.## Results on held-out TESS signals1,860 TESS signals that the chain never trained on (dataset `NeuralEngineByte/neb-tess-test`): 250 eclipses and 1,610 junk.TESS model, block 15,899:| measure | value || --- | --- || eclipses found | 217 of 250 (86.8%) || "eclipse" answers that are eclipses | 217 of 267 (81.3%) || right answers | 1,777 of 1,860 (95.5%) || always answering "junk" | 1,610 of 1,860 (86.6%) |The JavaScript forward pass and the C reference of the NEB repository (`neb2_model_predict` in `pow/ref/nebhash2.c`)give the same answer on all 1,860 signals, for both models.The Kepler model has no held-out score here.## Limits- The weights change with every block. The numbers above hold for block 15,899 only.- The TESS labels come from people who looked at the signals (Astronet-Triage-v2). Signals that the authors marked as acontact binary, a single transit or unsure are not in the data.- The test signals were processed the same way as the training signals. The score says nothing about light curvesprepared another way.- The TESS model learned on stars brighter than T = 13.6. Two tests on fainter stars, with TGLC light curves(Han & Brandt 2023). A flipped light curve holds no eclipse, so it serves as the control.- 100 known planets from T = 13.5 to 15.6 (TOI disposition CP or KP in the NASA Exoplanet Archive), up to threesectors each between sectors 1 and 55: 244 light curves hold at least two transits. At the catalog period, themodel called 90 of them an eclipse. The share follows how clearly the transit stands out of the noise: 70 of 80with an in-transit signal-to-noise ratio of 10 or more, 17 of 54 between 5 and 10, 3 of 110 below 5. On the 261flipped light curves, it called 9 an eclipse (weights of block 15,899).- 1,977 stars of sector 40 (median T = 15.2), blind search: the model called 319 dips of the flipped light curves aneclipse, against 56 in the real ones (`science/tess-faint` in the NEB repository, weights of block 11,457).A transit that stands out of the noise gets the right answer on a faint star. In a blind search of faint stars, themodel does not sort.- An answer is a hint for a human. It does not confirm a planet.## Data- TESS: Astronet-Triage-v2, Tey et al. 2023, AJ 165, 95, CC BY 4.0, https://zenodo.org/records/7411579.- Kepler: the Q1-Q17 DR24 TCE table of the NASA Exoplanet Archive.## CodeThe chain, the specification and the reference code: https://github.com/SilasEigen/neb (Apache-2.0).
1227e4064c42d499675c8808f34a7b340bc34ca0f827371bfeecf11f9ac28d2785 *kepler-v2.bin4454d7734c15b80b431ab22306b9f7ab8b57e1872d7a15da3317b9d303448008 *tess.bin123version https://git-lfs.github.com/spec/v1oid sha256:27e4064c42d499675c8808f34a7b340bc34ca0f827371bfeecf11f9ac28d2785size 130001234567891011121314151617{ "rpc": "https://neuralenginebyte.org/rpc", "height": 15899, "blockhash": "9ca17d22c80b4c8c5e22eff093f22240a49de76f4e8b72c31d3f51f8389c5ddb", "slots": { "0": { "dataset": "kepler-v2", "bytes": 13000, "weightshash": "4dc1df94cce95e19cd5bb5ab8cfea67f0214962a632dedb3851f2a05986aafa7" }, "1": { "dataset": "tess", "bytes": 13000, "weightshash": "5cec929781cc12c8bc203ca37575ab37dd969ede9f45b124ff9e4d855b8a8556" } }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495// Forward pass of the KEP1 network of the NEB chain (spec/nebhash-v2.md, sections 3.1 and 4.1), integer only.// A port of neb2_model_predict in pow/ref/nebhash2.c: same layers, same rounding, same first-maximum rules.// Works in a browser and in Node. Input: 784 values in 0..7 (global view 583, then local view 201). Output: 0 or 1.
const KEP1 = [ // kind, cin, cout, k, pad, pool, shift, in_len, in_off, sources, w_off { conv: true, cin: 1, cout: 8, k: 5, pad: 2, pool: 4, s: 2, n: 583, off: 0, src: [], w: 0 }, { conv: true, cin: 8, cout: 16, k: 5, pad: 2, pool: 4, s: 4, n: 145, src: [0], w: 40 }, { conv: true, cin: 1, cout: 8, k: 5, pad: 2, pool: 4, s: 3, n: 201, off: 583, src: [], w: 680 }, { conv: true, cin: 8, cout: 16, k: 5, pad: 2, pool: 4, s: 4, n: 50, src: [2], w: 720 }, { conv: false, cin: 768, cout: 32, s: 5, src: [1, 3], w: 1360 }, { conv: false, cin: 32, cout: 2, s: 4, src: [4], w: 25936 },];
// Packed weights (13,000 bytes): two signed 4-bit weights per byte, low nibble first.export function unpackWeights(packed) { const w = new Int8Array(packed.length * 2); for (let j = 0; j < packed.length; j++) { const lo = packed[j] & 15, hi = packed[j] >> 4; w[2 * j] = lo >= 8 ? lo - 16 : lo; w[2 * j + 1] = hi >= 8 ? hi - 16 : hi; } return w;}
const rshift = (x, n) => (n === 0 ? x : (x + (1 << (n - 1))) >> n);const clip = (v) => (v < -8 ? -8 : v > 7 ? 7 : v);
// Returns { label, sums }: the class (first maximum of the raw output sums) and those two sums.export function predict(w, x) { const outs = []; let lastIn = null; for (let i = 0; i < KEP1.length; i++) { const L = KEP1[i]; let input; if (L.src.length === 0) input = Int8Array.from(x.slice(L.off, L.off + L.cin * L.n)); else { input = new Int8Array(L.src.reduce((t, s) => t + outs[s].length, 0)); let at = 0; for (const s of L.src) { input.set(outs[s], at); at += outs[s].length; } } lastIn = input; if (!L.conv) { const out = new Int8Array(L.cout); for (let o = 0; o < L.cout; o++) { let z = 0; const base = L.w + o * L.cin; for (let j = 0; j < L.cin; j++) z += w[base + j] * input[j]; out[o] = clip(rshift(z, L.s)); } outs.push(out); continue; } const n = L.n, cl = n, a = new Int8Array(L.cout * cl); // stride 1 and padding 2 with kernel 5 keep the length for (let o = 0; o < L.cout; o++) for (let p = 0; p < cl; p++) { let z = 0; for (let c = 0; c < L.cin; c++) { const wb = L.w + (o * L.cin + c) * L.k, rb = c * n; for (let t = 0; t < L.k; t++) { const q = p + t - L.pad; if (q >= 0 && q < n) z += w[wb + t] * input[rb + q]; } } a[o * cl + p] = clip(rshift(z, L.s)); } const ol = Math.floor(cl / L.pool), out = new Int8Array(L.cout * ol); for (let o = 0; o < L.cout; o++) for (let j = 0; j < ol; j++) { let best = o * cl + j * L.pool; for (let t = 1; t < L.pool; t++) if (a[o * cl + j * L.pool + t] > a[best]) best = o * cl + j * L.pool + t; out[o * ol + j] = a[best]; } outs.push(out); } const L = KEP1[KEP1.length - 1], sums = []; for (let o = 0; o < L.cout; o++) { let z = 0; for (let j = 0; j < L.cin; j++) z += w[L.w + o * L.cin + j] * lastIn[j]; sums.push(z); } return { label: sums[1] > sums[0] ? 1 : 0, sums };}
// A dataset file NMD1: "NMD1", count (u32 little-endian), then records of 784 values and a label.export function readDataset(bytes) { const head = String.fromCharCode(...bytes.slice(0, 4)); if (head !== "NMD1") throw new Error("not an NMD1 dataset"); const n = bytes[4] | (bytes[5] << 8) | (bytes[6] << 16) | (bytes[7] << 24); const rows = []; for (let i = 0; i < n; i++) { const at = 8 + i * 785; rows.push({ x: bytes.subarray(at, at + 784), label: bytes[at + 784] }); } return rows;}123version https://git-lfs.github.com/spec/v1oid sha256:4454d7734c15b80b431ab22306b9f7ab8b57e1872d7a15da3317b9d303448008size 13000README.md+99
SHA256SUMSAdded+2
kepler-v2.binAdded+3
meta.jsonAdded+17
neb-model.jsAdded+95
tess.binAdded+3