Views
No views yet
npm install @cp500/infon-sheaf-gnn onnxruntime-web1import { SheafGNNModel } from '@cp500/infon-sheaf-gnn';
2
3const model = await SheafGNNModel.fromHub('cp500/infon-sheaf-gnn');
4const r = await model.scoreChain([
5 { kind: 'connective', polarity: 1, confidence: 0.92,
6 touchesSource: true, connectsPrev: true },
7 { kind: 'connective', polarity: 1, confidence: 0.85,
8 touchesTarget: true, isLast: true, connectsPrev: true },
9]);
10console.log(r.verdict); // 'SUPPORTS'
11console.log(r.totalDiscrepancy); // small (clean chain)js/ for
self-contained installs.connective,
terminal, reportive), not by predicate slug — which is what
makes the model transferable across relation vocabularies.chain → encode 10-d edge features → StalkEncoder → Linear(10, 64)
|
┌── 3 × SheafMessageLayer (64) ──┐
│ • per-kind restriction maps │
│ • forward + backward messages │
│ • H¹ discrepancy per edge │
└─────────────┬──────────────────┘
▼
ChainVerdictHead (3)| Metric | Value |
|---|---|
| Best val accuracy | 0.998 |
| Per-kind: clean | 0.995 |
| Per-kind: retracted | 1.000 |
| Per-kind: anomaly | 1.000 |
| Per-kind: disconnected | 1.000 |
| Per-kind: cyclic | 1.000 |
| File | Size | Purpose |
|---|---|---|
onnx/sheaf_gnn.onnx | ~627 KB | FP32 graph |
onnx/sheaf_gnn.fp16.onnx | ~370 KB | FP16 graph (default for browser) |
gnn.pt | small | PyTorch state dict + config |
meta.json | tiny | JS client contract |
relation_kinds.json | tiny | predicate→kind lookup mirror |
js/ | ~30 KB | source of @cp500/infon-sheaf-gnn |