Update README.md
Browse files
README.md
CHANGED
|
@@ -1,8 +1,90 @@
|
|
|
|
|
| 1 |
language: en
|
| 2 |
license: mit
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
language: en
|
| 3 |
license: mit
|
| 4 |
+
library_name: pytorch
|
| 5 |
+
tags:
|
| 6 |
+
- vae
|
| 7 |
+
- predictive-coding
|
| 8 |
+
- neuroscience
|
| 9 |
+
- gabor-splatting
|
| 10 |
+
- computer-vision
|
| 11 |
+
- biology
|
| 12 |
+
datasets:
|
| 13 |
+
- nielsr/flowers-102
|
| 14 |
+
---
|
| 15 |
+
|
| 16 |
+
# Neuro Splat — an artificial visual cortex (Gabor wave-packet VAE)
|
| 17 |
+
|
| 18 |
+
**PerceptionLab / Antti Luode, with Claude (Opus 4.8), in dialogue with Gemini. Helsinki, June 2026.**
|
| 19 |
+
|
| 20 |
+
> Do not hype. Do not lie. Just show.
|
| 21 |
+
|
| 22 |
+
*An image is not a million pixels. It is a smooth map and a scatter of small bright wave-packets dropped where the detail lives.*
|
| 23 |
+
|
| 24 |
+
---
|
| 25 |
+
|
| 26 |
+
## What this model is
|
| 27 |
+
|
| 28 |
+
This repo holds the weights (`model.pt`) for a **VAE whose decoder is a differentiable Gabor wave-packet splatter**. It is not a pixel-generating image model; it is a biologically-motivated representation experiment — an architecture that reproduces the *shape* of how V1 is thought to code images (localized Gabor atoms), used to test predictive coding and phase locking.
|
| 29 |
+
|
| 30 |
+
- **Encoder** (CNN): image → a latent "concept".
|
| 31 |
+
- **Decoder** (MLP): latent → the parameters of 512 localized Gabor atoms — position, scale, orientation, frequency, and a complex `(a, b)` coefficient per colour channel.
|
| 32 |
+
- **Renderer**: splats those wave-packets onto the canvas; the image is their sum.
|
| 33 |
+
|
| 34 |
+
Trained on **Oxford Flowers-102** at **128×128 with 512 packets**.
|
| 35 |
+
|
| 36 |
+
## The blur is the prior; reality is the sharpness
|
| 37 |
+
|
| 38 |
+
Asked to generate a flower from a random latent, this model returns a soft, watercolour blob — and that is the correct, expected behaviour, not a failure. A generative prior with no input has to average over everything it cannot disambiguate, so it returns the low-frequency gist.
|
| 39 |
+
|
| 40 |
+
To see it work, you give it eyes. Hook it to a webcam and the blurry top-down prior collides with raw bottom-up reality; the live frame supplies the phase the prior could not guess, the packets lock to it, and the gist sharpens. That collision — top-down prediction meets bottom-up residual — is the predictive-coding loop, made live.
|
| 41 |
+
|
| 42 |
+
## How to load it
|
| 43 |
+
|
| 44 |
+
You need the architecture from the [ArtificialCortex repo](https://github.com/anttiluode/ArtificialCortex) (`splat_generator.py` defines `SplatVAE`).
|
| 45 |
+
|
| 46 |
+
```python
|
| 47 |
+
import torch
|
| 48 |
+
from huggingface_hub import hf_hub_download
|
| 49 |
+
from splat_generator import SplatVAE # from the ArtificialCortex repo (the_splat/)
|
| 50 |
+
|
| 51 |
+
ckpt = hf_hub_download("Aluode/Neuro_Splat", "model.pt")
|
| 52 |
+
model = SplatVAE(image_size=128, latent=128, num_packets=512, chunk=64)
|
| 53 |
+
model.load_state_dict(torch.load(ckpt, map_location="cpu"))
|
| 54 |
+
model.eval()
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## How to run it
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
pip install torch torchvision numpy opencv-python huggingface_hub
|
| 61 |
+
|
| 62 |
+
# perception — watch the packets phase-lock to a live webcam (panel 3)
|
| 63 |
+
python live_cortex_perception.py --model_path model.pt --image_size 128 --num_packets 512
|
| 64 |
+
|
| 65 |
+
# generation — the blurry priors from random latents (expected to be soft)
|
| 66 |
+
python splat_generator.py --mode sample --resume model.pt --image_size 128 --num_packets 512
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
`--image_size 128 --num_packets 512` must match these weights, or the `state_dict` will not load.
|
| 70 |
+
|
| 71 |
+
## The honest ledger
|
| 72 |
+
|
| 73 |
+
**What this model shows:**
|
| 74 |
+
- an image can be represented and learned as a sparse sum of localized Gabor wave-packets (the V1 / Olshausen–Field model, made trainable);
|
| 75 |
+
- the phase-wrapping problem is dodged by outputting complex `(a, b)` coefficients instead of raw angles;
|
| 76 |
+
- the correction half of predictive coding works live: a blurry top-down prior is sharpened by gradient descent against a bottom-up residual (the webcam frame).
|
| 77 |
+
|
| 78 |
+
**What it is not, and what it lacks:**
|
| 79 |
+
- not a photorealistic generator. It is a VAE with an amortized latent — sharp reconstructions, blurry-but-structured samples. It is interesting on biological representation, not on benchmarks against diffusion models;
|
| 80 |
+
- the **prior is flower-only**: in-domain (a flower) the top-down gist genuinely helps; off-domain (a room, a face) it is a wrong guess that the live-frame fit overwrites, so there the loop is doing direct re-fitting, not prediction;
|
| 81 |
+
- the **"floaters"**: on out-of-domain input, with an aggressive learning rate, the optimizer orphans some packets into tiny ultra-bright dots instead of coordinating them into edges. They *resemble* phosphenes, but the cause is an MSE optimizer with **no lateral inhibition between packets**, not the neural disinhibition that makes real phosphenes — a rhyme, not the mechanism. It points at the missing inhibitory coordination (the `grown_gates` line), not at a recreated brain;
|
| 82 |
+
- it is 2D; relative units throughout; one trained model.
|
| 83 |
+
|
| 84 |
+
**The bet (untouched):** that the phase-locked frame is a *felt* sharpening rather than a computed one. The model locates the mechanism in code that can fail; it does not touch the hard problem.
|
| 85 |
+
|
| 86 |
+
## Lineage
|
| 87 |
+
|
| 88 |
+
A sub-organ of [`the_artificial_cortex`](https://github.com/anttiluode/ArtificialCortex) (`the_splat/`). The generator is the trained top-down prior; the live cortex is reality forcing that prior into focus. MIT.
|
| 89 |
+
|
| 90 |
+
*The generator dreamed a blurry flower because it had nothing to look at. Open its eyes and reality supplies the phase the dream could not; the packets lock, the gist sharpens, and what they cannot yet coordinate, they see as stars.*
|