Spaces:
Running
Running
initial deployment: cortex-conv ships pre-trained at 96.8% MNIST
Browse filesA 34,106-weight convolutional neural network trained with Equilibrium Propagation
(no backprop) on FitzHugh-Nagumo-inspired neurons. Boots pre-trained at 96.8%
test accuracy on MNIST. Toggle to Fashion-MNIST to watch the same network train
from scratch in your browser on WebGPU.
Companion to Kendall 2026 (arXiv:2605.21568). Much smaller variant: 34K params
vs paper's 1,457,674; ~3.2% test error vs paper's 2.8%; runs in browser instead
of Python.
See PAPER_COMPANION.md for the full write-up.
- .gitattributes +7 -35
- DEPLOY.md +58 -0
- PAPER_COMPANION.md +0 -0
- README.md +0 -0
- fashion/fashion_pack_28_60k.json +3 -0
- index.html +0 -0
- mnist/mnist_pack_28_60k.json +3 -0
- tests/eqprop_lib.js +0 -0
- tests/gpu_lib_conv_full.js +0 -0
- tests/gpu_lib_conv_multi.js +0 -0
- tests/gpu_lib_deep.js +0 -0
- weights/cortex_conv_mnist_R28.json +3 -0
.gitattributes
CHANGED
|
@@ -1,35 +1,7 @@
|
|
| 1 |
-
|
| 2 |
-
*.
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
*
|
| 7 |
-
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
-
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 1 |
+
# Large data packs and weights via Git LFS — required on HuggingFace Spaces for files > ~10 MB.
|
| 2 |
+
*.json filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
# Keep README + tests human-readable in the web UI (not LFS-ed).
|
| 4 |
+
README.md -filter -diff -merge text
|
| 5 |
+
index.html -filter -diff -merge text
|
| 6 |
+
tests/* -filter -diff -merge text
|
| 7 |
+
PAPER_COMPANION.md -filter -diff -merge text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEPLOY.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deploying this directory as a HuggingFace Space
|
| 2 |
+
|
| 3 |
+
This directory is a self-contained static HuggingFace Space ready to push. Total bundle size is ~124 MB (the bulk is the two 60K data packs at 61 MB each); the index.html + scripts + weights together are under 3 MB.
|
| 4 |
+
|
| 5 |
+
## One-time setup
|
| 6 |
+
|
| 7 |
+
You need: a HuggingFace account, the `huggingface_hub` Python CLI, and an HF write token.
|
| 8 |
+
|
| 9 |
+
```bash
|
| 10 |
+
pip install -U huggingface_hub
|
| 11 |
+
huggingface-cli login # paste your token from https://huggingface.co/settings/tokens
|
| 12 |
+
```
|
| 13 |
+
|
| 14 |
+
Install Git LFS once (required for the 60 MB data packs):
|
| 15 |
+
|
| 16 |
+
```bash
|
| 17 |
+
brew install git-lfs # macOS; apt-get install git-lfs on Linux
|
| 18 |
+
git lfs install
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
## Create the space and push
|
| 22 |
+
|
| 23 |
+
```bash
|
| 24 |
+
# 1. Create an empty static space named cortex-conv on huggingface.co/spaces/<your-username>/cortex-conv
|
| 25 |
+
huggingface-cli repo create cortex-conv --type space --space-sdk static
|
| 26 |
+
|
| 27 |
+
# 2. Clone the empty space repo somewhere
|
| 28 |
+
git clone https://huggingface.co/spaces/<your-username>/cortex-conv ~/cortex-conv-space
|
| 29 |
+
|
| 30 |
+
# 3. Mirror this directory into the clone
|
| 31 |
+
rsync -a --delete --exclude=.git /Users/exobit/developer/fnm-gpu/hf_space/ ~/cortex-conv-space/
|
| 32 |
+
|
| 33 |
+
# 4. Push (the .gitattributes file already routes the JSON packs to LFS)
|
| 34 |
+
cd ~/cortex-conv-space
|
| 35 |
+
git lfs track "*.json"
|
| 36 |
+
git add .gitattributes README.md index.html PAPER_COMPANION.md tests/ weights/ mnist/ fashion/
|
| 37 |
+
git commit -m "initial: cortex-conv ships pre-trained at 96.8% MNIST"
|
| 38 |
+
git push
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
The Space will build automatically (a static space is just a file server, no build step). Open `https://huggingface.co/spaces/<your-username>/cortex-conv` and the page should load at 96.8% MNIST test accuracy within ~3 seconds on first visit.
|
| 42 |
+
|
| 43 |
+
## Verifying the deployed space
|
| 44 |
+
|
| 45 |
+
Visit the Space URL with a Chrome/Edge/Safari browser that supports WebGPU. Within 3 seconds you should see:
|
| 46 |
+
|
| 47 |
+
- Test accuracy: **96.8%**
|
| 48 |
+
- Status label: `idle (cortex-conv · webgpu+pretrained · 34,106 params)`
|
| 49 |
+
- Equation header: `CORTEX-CONV (2-conv 16,16, γ=0.1, banked V1 mask, drive-clamp · 34,106 params) · CORTEX NEURON · ADAGO · MNIST`
|
| 50 |
+
|
| 51 |
+
If WebGPU is unavailable in the visitor's browser, the page falls back to a CPU-only path with the embedded 6K MNIST and runs much slower.
|
| 52 |
+
|
| 53 |
+
## Notes
|
| 54 |
+
|
| 55 |
+
- HuggingFace Spaces by default serve from CDN with proper MIME types for `.json` and `.js` — no extra config needed.
|
| 56 |
+
- The `sdk: static` line in `README.md` frontmatter is what tells HF this is a static site (not a Gradio or Streamlit app).
|
| 57 |
+
- Updates: after editing files in `/Users/exobit/developer/fnm-gpu/hf_space/`, repeat the `rsync` + `git add` + `git commit` + `git push` steps. HuggingFace re-deploys automatically on every push.
|
| 58 |
+
- To regenerate the bundled weights snapshot after architecture changes, run `tools/train_cortex_dump.cjs` from the project root (not from `hf_space/`), then copy the resulting `weights/cortex_conv_mnist_R28.json` into `hf_space/weights/`.
|
PAPER_COMPANION.md
ADDED
|
Binary file (12.3 kB). View file
|
|
|
README.md
CHANGED
|
Binary files a/README.md and b/README.md differ
|
|
|
fashion/fashion_pack_28_60k.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c5fb58ccc88be6d0f36c49170cecc7b4d17bf0ba45ae7ec2d5df84895944bb2
|
| 3 |
+
size 63846739
|
index.html
CHANGED
|
Binary files a/index.html and b/index.html differ
|
|
|
mnist/mnist_pack_28_60k.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:07ba3802fa3bedde724c219fafb4e7af6ad4924e68468e0b0e4c3ef56be90522
|
| 3 |
+
size 63846739
|
tests/eqprop_lib.js
ADDED
|
Binary file (7.8 kB). View file
|
|
|
tests/gpu_lib_conv_full.js
ADDED
|
Binary file (34 kB). View file
|
|
|
tests/gpu_lib_conv_multi.js
ADDED
|
Binary file (57.9 kB). View file
|
|
|
tests/gpu_lib_deep.js
ADDED
|
Binary file (44.2 kB). View file
|
|
|
weights/cortex_conv_mnist_R28.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:721b7fe15f85ad307be698f10b7ea8e1ed093d5a1f84461151dda7994e1ff7fc
|
| 3 |
+
size 719874
|