our_knp/claude-memory/knp-mnist-altai-work.md
2026-10-15 10:48:29 +03:00

30 lines
5.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
name: knp-mnist-altai-work
description: "Ongoing work on KNP (Kaspersky Neuromorphic Platform): mnist-learn altai/blifat accuracy + cats-vs-dogs SNN experiment, acceleration, GPU STDP prototype — state and next steps"
metadata:
node_type: memory
type: project
originSessionId: 5e1c8e61-f0ee-51a6-9940-e024073c3caf
modified: 2026-10-14T15:29:20.294Z
---
This WSL machine (1220WS2, IP 10.9.8.230 on wswg0) IS the "test stand" referenced in handoff docs; /mnt/c/knp == /mnt/c/KNP. No SSH needed. Runtime: ~/run/exp (MNIST), ~/run/cats-dogs (cats/dogs), build ~/knp-build, python with numpy: ~/anvenv/bin/python.
Git: /mnt/c/knp is one repo (branch main, remote https://git.snw.su/int/our_knp.git), created 2026-10-14. Nested .git of 1/, viz/, examples/ moved to /mnt/c/knp-nested-git-backup/ (examples = KasperskyLab/knp @55470ed6 + 6 local file changes). Local DNS doesn't resolve git.snw.su → repo config http.curloptResolve to 45.141.100.133. Credentials saved (credential.helper store) — Claude can push directly; push after commits.
MNIST (to 2026-10-13): altai 82.5%→91.5% via KNP_COL_JITTER=20 + KNP_MNIST_INFER_INHIB=255; fixed ModelLoader::init_channels bug. Simulator viz/altai_sim.py, visualizer viz/app.html→altai_viz.html. Col size 20≈40 (91.9%). Fashion ~55%. Weakness: OFF pixels send no spikes. Agreed next idea: ON/OFF input coding. sz80_*/sz40_60k runs have empty result.csv (killed). Reports: /mnt/c/knp/reports/<date>/ (index reports/README.md).
Cats/dogs (2026-10-14, other chat; docs cats-dogs/HANDOFF.md, V2.md, ACCELERATION.md, reports/2026-10-14/журнал.md): v1 contrast input 52% test; v2 HOG-like features (non-spiking) + KNP STDP: val 62.6%, test 61.8% (test already viewed — not for further tuning). Parallel independent processes 2.1× throughput. Verified 2026-10-14 evening: tuned multithread backend and fast connection-cache backend give byte-identical CSVs; tuned2 3.5× slower, fast ~10% faster (800+200 only). GPU STDP hybrid draft (gpu_stdp*.cu/.cpp) written, NOT built/verified.
MAIN GOAL (user, 2026-10-14): object recognition; MNIST is a testbed — carry every finding over to objects (cats/dogs). MNIST 92% is only on aligned MNIST: shift 2px → ~64%, thickness ±1px → 75-79% (template-like net); hand-drawn digits in viz look bad. ON/OFF naive (local) gave 56.5% val: input spike count tripled → 1/3 images silent (all column sums negative), not a quantization issue; needs spike-rate normalization.
Night 14→15 Oct (report reports/2026-10-15/Отчёт_объекты_ночь.md, log reports/2026-10-14/журнал.md): bottleneck for objects was FEATURES (HOG: even linear ~60%). Learned k-means patch features (objects/kmeans_features.py, ~WTA competitive learning) + linear: 77% on fresh test; fully spiking exact sim (objects/spiking_pipeline.py, layer1 800×729 AltAI-like neurons + one "dog−cat" readout neuron trained off-chip): 68.3%; KNP STDP columns on top-256 learned features with KNP_COL_PUNISH=0.012: 67.0%; old v2: 62.5%. Fresh test = CIFAR test 700–999/class, NOW USED (all CIFAR cat/dog test images consumed). Data v3: ~/run/cats-dogs/data-v3 (train 9000). KNP_COL_PUNISH (neg. dopamine to wrong columns) best 0.012–0.02 (+3.8pp MNIST). STDP columns fail on dense inputs (weights mostly negative → silence); need sparse input. MNIST: stroke features + spiking readout 95.1%, shift-2px 89.9%.
Later that night: online WTA (objects/kmeans_features.learn_online) ≈ k-means; three-factor dopamine-error readout (objects/dopamine_readout.py) + calibrated decision neuron: all-neural-rule pipeline 71.6% val (K=1600), ridge 73.5%; seed spread D 64.0±0.6 vs v2 62.1±1.2. Digit page (artifact Vc1q1WCZuPY2QAHBSGtrKF v2) has stroke-feature spiking readout panel (94.7% MNIST test).
Morning 15 Oct (log reports/2026-10-15/журнал.md): KNP_DELTA=a,b (+ isolated backend readout/build_delta_cpu.py → ~/run/delta-cpu/libknp-cpu-delta-backend.so, env KNP_DELTA_RULE=rate, KNP_DELTA_LAG=1 REQUIRED — dopamine arrives 1 step after input) = error-driven dopamine readout inside KNP, KNP_COL_SIZE=1. MNIST coarse features: 94.8% (b=4–6, r=3), augmented 90k: 94.6%, shift-2px 91.3%. Cats/dogs: 65–69% (columns 64–65%, ridge 74%); weight range (KNP_W_RANGE) and 3 epochs don't help. cats-dogs/run.py --backend delta; cats_dogs input size via KNP_MNIST_INPUT_SIZE.
Next: close KNP object gap (smaller steps/learning-rate decay?), port WTA feature layer into KNP; reduce spike-coding loss; make columns handle dense features.
Waiting tip: never `pgrep -f <name>` for a string that appears in the waiting command itself (self-match hung a wait 1.5h); use `ps -eo args | grep -c "[x]yz"`. `tail -5` fails here; use `tail -n 5`.
User wants a real KNP/AltAI spiking net trained (not CNN substitution). Daily log: reports/YYYY-MM-DD/журнал.md (+ reports of that day in the same folder; index reports/README.md, living overview reports/Итоги_и_план.md): short for discussion, detailed for code/runs; no passwords.
**Why:** session transcripts don't survive between days; user expects continuity.
**How to apply:** read reports/README.md, reports/Итоги_и_план.md and the latest reports/<date>/журнал.md; check `uptime` (WSL restarts kill runs) and result files before trusting; update this memory and the daily log at session end.