guns/elm.nim online sequential ELM (ridge/RLS), fixed random
hidden layer, one pass, no backprop
guns/waveelm.nim the WaveElm gun: a simulated omnidirectional expanding
ring of probes fired from the SHOOTER, where the ELM
learns a BIAS CORRECTION to the ring's reconstructed
position (predicting the position outright was measured
and refuted: it collapses on abrupt/burst movement)
guns/gun_knowledge.nim GUNK: a learned additive angular residual on top of
the self-consistent lead forecast. Only answers "which
absolute gun direction", nothing else
guns/docs/ the open-access OS-ELM / ELM reference set plus
fetch_papers.sh, which re-downloads it idempotently
Plus the matching test and measurement harnesses (test_waveelm*, test_elm,
test_gun_knowledge, test_knowledge_registration, gk_aim_probe,
measure_gk_{residual,virtual}.py) and the docs README with the citations.
25 lines
1.0 KiB
Nim
25 lines
1.0 KiB
Nim
## Cross-check probe for `measure_gk_residual.py`: it prints the PRODUCTION aim
|
|
## base of `guns/gun_knowledge.nim` -- the exact angle `KnowledgeGun.predict`
|
|
## turns into its prediction point -- for every
|
|
## ex ey eh es sx sy power
|
|
## line on stdin, one float per line on stdout. The measurement script replays
|
|
## the aim offline and asserts that its replay equals THIS, so the offline
|
|
## numbers cannot silently drift away from the shipped code again.
|
|
##
|
|
## Build: nim c --path:common_libs common_libs/tests/gk_aim_probe.nim
|
|
## (the script builds it itself and skips the cross-check with a loud warning
|
|
## if the binary is missing).
|
|
|
|
import std/[os, strutils]
|
|
import guns/gun_knowledge
|
|
|
|
for line in stdin.lines:
|
|
let f = line.splitWhitespace()
|
|
if f.len < 7: continue
|
|
let feat = GkFeatures(
|
|
enemyX: parseFloat(f[0]), enemyY: parseFloat(f[1]),
|
|
enemyHeading: parseFloat(f[2]), enemySpeed: parseFloat(f[3]),
|
|
selfX: parseFloat(f[4]), selfY: parseFloat(f[5]),
|
|
power: parseFloat(f[6]), hasTarget: true)
|
|
echo forecastBase(feat, 0.0)
|