ESP32-S3 Bench Guide
ESP32-S3 N16R8 bench guide: live pinout, lessons, simulators and the bench log.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
A spiking model of a real fruit fly brain learns a three-lane rhythm game, in the style of Guitar Hero, by trial and error. The learning happens inside the simulated brain: dopamine strengthens the synapses that led to a hit and weakens the ones that led to a mistake.
33% of notes hit before practice, 99.3% after 30 songs, and 100% on a song it never heard. With its dopamine neurons blocked, it stays at 33%.檢視完整 README ↗A spiking model of a real fruit fly brain learns a three-lane rhythm game, in the style of Guitar Hero, by trial and error. The learning happens inside the simulated brain: dopamine strengthens the synapses that led to a hit and weakens the ones that led to a mistake.
Live demo: bsgelman.github.io/fly-hero
33% of notes hit before practice, 99.3% after 30 songs, and 100% on a song it never heard. With its dopamine neurons blocked, it stays at 33%.
The simulation has 6,900 neurons (3,275 in the brain and 3,625 in the nerve cord) and 6,419,481 synapses from the Janelia and Google male fruit fly connectome. Every neuron that fires flashes on the brain view as it happens, all the way down the nerve cord.
Janelia/Google male CNS connectome (public data)
│
▼ extract_subgraph.py connectome → 6,900 neurons, 6,419,481 synapses
▼ flyhero/sim.py synapses → spiking neurons, 1 ms steps (NumPy)
▼ flyhero/game.py notes → the eye neurons for that lane fire
▼ flyhero/agents.py spikes → key press, reward, dopamine, synapse update
▼ js/ same model → runs live in the browser: game, brain view and charts
| File | Lines | Job |
|---|---|---|
tools/extract_subgraph.py | 126 | Picks the eye, memory, dopamine, output and nerve cord neurons from the male CNS and writes the network |
flyhero/sim.py | 170 | Leaky integrate-and-fire neurons on the real synapse list, plus the shuffled and random wiring controls |
flyhero/game.py | 87 | Songs, rewards and a millisecond-level game loop |
flyhero/agents.py | 105 | Bio-RL (dopamine learning inside the brain) and Deep-RL (a readout trained with REINFORCE) |
flyhero/run_experiments.py | 88 | Runs every learner and control in parallel and writes data/results.json |
flyhero/train_fly.py | 30 | Trains the fly you play against |
flyhero/test.py | 106 | Checks the neuron model, wiring controls, rewards and learning, and that the browser version matches |
js/sim.js, js/game.js, js/agents.js | 327 | The same model ported line for line, so it runs live in the browser |
js/app.js | 285 | The page: watch the fly learn, you vs fly, compare learners |
js/brain.js | 53 | Brain and nerve cord drawing |
The model is Python with NumPy as its only dependency. Browsers can't run it live, so the page runs a JavaScript port with no frameworks or build step. Both use float64 and the same random number generator, and flyhero/test.py checks that they produce identical spikes and key presses from the same seed.
Each learner practised for 30 songs (the same song 30 times), repeated 5 times from scratch. Scores are the share of notes hit.
| Learner | Before practice | End of practice | New song |
|---|---|---|---|
| Bio-RL, real wiring | 33.1% | 99.3% | 100.0% |
| Bio-RL, shuffled wiring | 21.9% | 21.9% | 27.2% |
| Bio-RL, random network | 15.0% | 25.9% | 26.2% |
| Bio-RL, dopamine blocked | 31.9% | 33.3% | 35.9% |
| Deep-RL, real wiring | 23.1% | 99.0% | 97.4% |
| Deep-RL, shuffled wiring | 23.1% | 82.8% | 75.9% |
| Deep-RL, random network | 23.1% | 100.0% | 100.0% |
| Deep-RL, real wiring, 150 songs | 21.9% | 98.5% | 95.7% |
End of practice is the average of songs 26 to 30 (146 to 150 for the last row). New song is a different song, played once with learning switched off.
Full numbers, spreads and the reasoning behind each control are in docs/lab-notebook.md.
It reads notes instead of memorising the song. The fly only sees which lane a note is in, never where it is in the song. That is why it scores the same on a song it never practised.
Dopamine is made of simulated spikes. After each press, reward (PAM) or punishment (PPL1) dopamine neurons fire in proportion to how surprising the result was, and their spike counts set how much the synapses change. Blocking dopamine silences those neurons, and learning stops.
Mistakes can't wipe out what it learned. Simple dopamine rules often fail because early mistakes far outnumber hits. Here a change shrinks to zero once a pathway already predicts its reward, only synapses that just fired can change, waiting changes nothing, and synapse strength is capped.
One fly for everything. The wiring, the sign of every synapse, the drawing and each neuron's position all come from the Janelia and Google male CNS connectome, so every flash is at that neuron's own cell body.
The nerve cord fires too. 3,625 nerve cord neurons receive the brain's descending neurons, so activity travels down the neck when the fly acts. The cord only listens: nothing flows back into the brain, and the wiring controls leave it untouched. Replaying runs with and without it gave identical key presses.
Settings were fixed before the results. Every learner and control runs through the same code with the same parameters, set once before the experiments.
Each note is a single decision, so this is reward prediction error learning, not learning over long sequences. In real flies, dopamine mostly weakens these synapses, while here reward strengthens them. Dopamine reaches the whole memory centre at once rather than individual compartments. Only the right half of the brain is simulated, and the nerve cord only receives signals from the brain.
git clone https://github.com/bsgelman/fly-hero.git
cd fly-hero
python tools/serve.py
Open http://localhost:8766.
pip install -r requirements.txt
python -m flyhero.test # checks, about 4 min (the browser check also needs Node)
python -m flyhero.run_experiments # every learner and control, about 55 min on 22 cores
python -m flyhero.train_fly # retrains the You vs fly opponent
To rebuild the network from the raw connectome, download three files from the Janelia male CNS downloads into data/raw/ and run python tools/extract_subgraph.py (needs pandas and pyarrow):
body-annotations-male-cns-v1.0-minconf-0.5.feather, saved as mcns_annotations.featherconnectome-weights-male-cns-v1.0-minconf-0.5.feather, saved as mcns_weights.feather (about 1 GB)body-neurotransmitters-male-cns-v1.0.feather, saved as mcns_neurotransmitters.featherCode is under the MIT License. The network and brain positions are derived from the Janelia and Google male CNS data (CC-BY), credited above. The typeface is Atkinson Hyperlegible Next under the SIL Open Font License (fonts/OFL.txt).