@reicek/neataptic-ts 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/agents/boundary-mapper.agent.md +31 -0
- package/.github/agents/docs-scout.agent.md +29 -0
- package/.github/agents/plan-scout.agent.md +31 -0
- package/.github/agents/solid-split.agent.md +143 -0
- package/.github/copilot-instructions.md +119 -0
- package/.github/skills/solid-split-playbook/SKILL.md +220 -0
- package/.github/skills/solid-split-playbook/assets/docs-checklist.md +34 -0
- package/.github/skills/solid-split-playbook/assets/split-plan-template.md +48 -0
- package/.github/skills/solid-split-playbook/assets/split-workflow-checklist.md +51 -0
- package/.github/skills/trace-analyzer-extension/SKILL.md +63 -0
- package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +24 -0
- package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +101 -0
- package/.github/skills/trace-audit-reporting/SKILL.md +96 -0
- package/.github/skills/trace-audit-reporting/assets/performance-report-template.md +123 -0
- package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +132 -0
- package/package.json +7 -3
- package/plans/ES2023 migration +13 -8
- package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
- package/plans/Flappy_Bird_Folder_Documentation_Pass.md +53 -0
- package/plans/Flappy_Evolution_Worker_Documentation_Pass.md +58 -0
- package/plans/Interactive_Examples_and_Learning_Path.md +10 -2
- package/plans/Memory_Optimization.md +3 -3
- package/plans/README.md +63 -0
- package/plans/Roadmap.md +15 -3
- package/plans/asciiMaze_SOLID_split.done.md +130 -0
- package/plans/flappy_bird_SOLID_split.done.md +67 -0
- package/scripts/analyze-trace.ts +590 -0
- package/scripts/assets/theme.css +221 -34
- package/scripts/copy-examples.mjs +9 -5
- package/scripts/export-onnx.mjs +3 -3
- package/scripts/generate-bench-tables.mjs +10 -10
- package/scripts/generate-bench-tables.ts +10 -10
- package/scripts/generate-docs.ts +1415 -449
- package/scripts/render-docs-html.ts +15 -8
- package/src/README.md +127 -222
- package/src/architecture/README.md +117 -184
- package/src/architecture/architect.ts +6 -0
- package/src/architecture/layer/README.md +38 -38
- package/src/architecture/network/README.md +49 -31
- package/src/architecture/network/activate/README.md +77 -77
- package/src/architecture/network/connect/README.md +15 -13
- package/src/architecture/network/deterministic/README.md +7 -7
- package/src/architecture/network/evolve/README.md +44 -44
- package/src/architecture/network/gating/README.md +20 -20
- package/src/architecture/network/genetic/README.md +51 -51
- package/src/architecture/network/mutate/README.md +97 -97
- package/src/architecture/network/network.types.ts +39 -0
- package/src/architecture/network/onnx/README.md +264 -264
- package/src/architecture/network/prune/README.md +39 -39
- package/src/architecture/network/remove/README.md +26 -26
- package/src/architecture/network/serialize/README.md +56 -56
- package/src/architecture/network/serialize/network.serialize.json.utils.ts +1 -0
- package/src/architecture/network/serialize/network.serialize.utils.ts +6 -1
- package/src/architecture/network/serialize/network.serialize.utils.types.ts +1 -1
- package/src/architecture/network/slab/README.md +61 -61
- package/src/architecture/network/standalone/README.md +24 -24
- package/src/architecture/network/stats/README.md +9 -9
- package/src/architecture/network/topology/README.md +46 -46
- package/src/architecture/network/training/README.md +21 -21
- package/src/architecture/network.ts +114 -10
- package/src/methods/README.md +9 -87
- package/src/multithreading/README.md +8 -77
- package/src/multithreading/workers/README.md +2 -2
- package/src/multithreading/workers/browser/README.md +0 -6
- package/src/multithreading/workers/node/README.md +0 -3
- package/src/neat/README.md +623 -568
- package/src/neat/neat.evolve.population.utils.ts +29 -5
- package/src/neat/neat.helpers.ts +16 -0
- package/src/neat/neat.topology-intent.utils.ts +160 -0
- package/src/utils/README.md +18 -18
- package/test/examples/asciiMaze/README.md +59 -59
- package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +14 -9
- package/test/examples/asciiMaze/browser-entry/README.md +196 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.abort.services.ts +95 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.constants.ts +23 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.curriculum.services.ts +115 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.globals.services.ts +106 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.host.services.ts +157 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.services.ts +14 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.ts +129 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.types.ts +120 -0
- package/test/examples/asciiMaze/browser-entry/browser-entry.utils.ts +98 -0
- package/test/examples/asciiMaze/browser-entry.ts +10 -576
- package/test/examples/asciiMaze/dashboardManager/README.md +276 -0
- package/test/examples/asciiMaze/dashboardManager/archive/README.md +16 -0
- package/test/examples/asciiMaze/dashboardManager/archive/dashboardManager.archive.services.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.constants.ts +35 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.services.ts +103 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.ts +181 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.types.ts +267 -0
- package/test/examples/asciiMaze/dashboardManager/dashboardManager.utils.ts +254 -0
- package/test/examples/asciiMaze/dashboardManager/live/README.md +14 -0
- package/test/examples/asciiMaze/dashboardManager/live/dashboardManager.live.services.ts +264 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +47 -0
- package/test/examples/asciiMaze/dashboardManager/telemetry/dashboardManager.telemetry.services.ts +513 -0
- package/test/examples/asciiMaze/dashboardManager.ts +13 -2335
- package/test/examples/asciiMaze/evolutionEngine/README.md +1058 -0
- package/test/examples/asciiMaze/evolutionEngine/curriculumPhase.ts +90 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.constants.ts +36 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.ts +58 -513
- package/test/examples/asciiMaze/evolutionEngine/engineState.types.ts +212 -0
- package/test/examples/asciiMaze/evolutionEngine/engineState.utils.ts +301 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionEngine.types.ts +445 -0
- package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +81 -50
- package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +2 -4
- package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +17 -33
- package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +1 -2
- package/test/examples/asciiMaze/evolutionEngine/sampling.ts +1 -1
- package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +2 -5
- package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +30 -37
- package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +16 -58
- package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +2 -2
- package/test/examples/asciiMaze/evolutionEngine.ts +55 -55
- package/test/examples/asciiMaze/fitness.ts +2 -2
- package/test/examples/asciiMaze/fitness.types.ts +65 -0
- package/test/examples/asciiMaze/interfaces.ts +64 -1352
- package/test/examples/asciiMaze/mazeMovement/README.md +356 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +49 -0
- package/test/examples/asciiMaze/mazeMovement/finalization/mazeMovement.finalization.ts +138 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.constants.ts +101 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.services.ts +230 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.ts +299 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.types.ts +185 -0
- package/test/examples/asciiMaze/mazeMovement/mazeMovement.utils.ts +153 -0
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +91 -0
- package/test/examples/asciiMaze/mazeMovement/policy/mazeMovement.policy.ts +467 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +95 -0
- package/test/examples/asciiMaze/mazeMovement/runtime/mazeMovement.runtime.ts +354 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +124 -0
- package/test/examples/asciiMaze/mazeMovement/shaping/mazeMovement.shaping.ts +459 -0
- package/test/examples/asciiMaze/mazeMovement.ts +12 -2978
- package/test/examples/flappy_bird/README.md +193 -88
- package/test/examples/flappy_bird/browser-entry/README.md +1441 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.host.utils.ts +4 -324
- package/test/examples/flappy_bird/browser-entry/browser-entry.network-view.utils.ts +9 -396
- package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +6 -714
- package/test/examples/flappy_bird/browser-entry/browser-entry.render.types.ts +26 -3
- package/test/examples/flappy_bird/browser-entry/browser-entry.runtime.types.ts +16 -1
- package/test/examples/flappy_bird/browser-entry/browser-entry.simulation.types.ts +39 -5
- package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
- package/test/examples/flappy_bird/browser-entry/browser-entry.stats.types.ts +32 -4
- package/test/examples/flappy_bird/browser-entry/browser-entry.ts +11 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.types.ts +8 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.types.ts +50 -7
- package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +21 -893
- package/test/examples/flappy_bird/browser-entry/browser-entry.worker.types.ts +91 -10
- package/test/examples/flappy_bird/browser-entry/host/README.md +318 -0
- package/test/examples/flappy_bird/browser-entry/host/host.canvas.service.ts +16 -0
- package/test/examples/flappy_bird/browser-entry/host/host.constants.ts +20 -0
- package/test/examples/flappy_bird/browser-entry/host/host.dom.service.ts +10 -0
- package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
- package/test/examples/flappy_bird/browser-entry/host/host.stats.service.ts +14 -0
- package/test/examples/flappy_bird/browser-entry/host/host.ts +592 -6
- package/test/examples/flappy_bird/browser-entry/host/host.types.ts +13 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +309 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +47 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +392 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +132 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +92 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +389 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.draw.service.ts +13 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.labels.utils.ts +12 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.layout.utils.ts +14 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +267 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +823 -7
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.types.ts +11 -0
- package/test/examples/flappy_bird/browser-entry/playback/README.md +845 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +355 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +1068 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.batch.services.ts +64 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +207 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +197 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.batch.utils.ts +114 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.test.ts +96 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.layout.utils.ts +204 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.services.ts +49 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +313 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.layer.services.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.test.ts +33 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +201 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.selection.utils.ts +171 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.timing.utils.ts +124 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.test.ts +279 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +132 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.scene.services.ts +26 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +65 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.ts +48 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.types.ts +342 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +10 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.cache.services.ts +96 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.constants.ts +127 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.draw.services.ts +184 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.scene.services.ts +64 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +6 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.ts +53 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.types.ts +105 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.utils.ts +100 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +541 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.bird.utils.ts +180 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.canvas.services.ts +77 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.entity.services.ts +167 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.scene.services.ts +57 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.test.ts +176 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +113 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +35 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.trail.utils.ts +248 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +103 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +11 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.constants.ts +1 -1
- package/test/examples/flappy_bird/browser-entry/playback/playback.frame-render.service.ts +10 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.iteration.services.ts +192 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.loop.service.ts +12 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.orchestration.types.ts +78 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.render.pipe-outline.service.ts +128 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.render.service.ts +1 -116
- package/test/examples/flappy_bird/browser-entry/playback/playback.session.services.ts +184 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.test.ts +121 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +8 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.layer.services.ts +36 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +11 -128
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +268 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +91 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
- package/test/examples/flappy_bird/browser-entry/playback/playback.trail.utils.ts +9 -86
- package/test/examples/flappy_bird/browser-entry/playback/playback.ts +75 -7
- package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +12 -9
- package/test/examples/flappy_bird/browser-entry/playback/playback.worker-channel.utils.ts +11 -123
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +55 -0
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.services.ts +103 -0
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.test.ts +45 -0
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/playback.snapshot.summary.utils.ts +28 -0
- package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +95 -0
- package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.test.ts +35 -0
- package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.history.services.ts +64 -0
- package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.test.ts +37 -0
- package/test/examples/flappy_bird/browser-entry/playback/trail/playback.trail.opacity.utils.ts +74 -0
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +71 -0
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.request.services.ts +45 -0
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.summary.services.ts +74 -0
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/playback.worker-channel.types.ts +53 -0
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +304 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.browser-globals.service.ts +15 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.errors.ts +17 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +56 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-loop.service.ts +19 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +96 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +92 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.telemetry.service.ts +24 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +65 -0
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +568 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.colors.utils.ts +26 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.constants.ts +110 -0
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.draw.service.ts +979 -19
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +157 -3
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +13 -27
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +7 -20
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.types.ts +14 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +238 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.errors.ts +11 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.generation.service.ts +12 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.test.ts +143 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.playback.service.ts +140 -14
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.request.service.ts +27 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.ts +8 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.types.ts +23 -0
- package/test/examples/flappy_bird/browser-entry/worker-channel/worker-channel.url.service.ts +5 -0
- package/test/examples/flappy_bird/constants/README.md +1163 -0
- package/test/examples/flappy_bird/constants/constants.birds.ts +16 -38
- package/test/examples/flappy_bird/constants/constants.difficulty.ts +21 -0
- package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
- package/test/examples/flappy_bird/constants/constants.network.ts +1 -1
- package/test/examples/flappy_bird/constants/constants.observation.ts +7 -0
- package/test/examples/flappy_bird/constants/constants.palette.ts +9 -2
- package/test/examples/flappy_bird/constants/constants.physics.ts +9 -0
- package/test/examples/flappy_bird/constants/constants.pipe-render.ts +3 -0
- package/test/examples/flappy_bird/constants/constants.pipes.ts +22 -3
- package/test/examples/flappy_bird/constants/constants.runtime.ts +28 -4
- package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
- package/test/examples/flappy_bird/constants/constants.ts +6 -0
- package/test/examples/flappy_bird/environment/README.md +182 -0
- package/test/examples/flappy_bird/environment/environment.collision.utils.ts +7 -0
- package/test/examples/flappy_bird/environment/environment.constants.ts +16 -3
- package/test/examples/flappy_bird/environment/environment.observation.utils.ts +12 -19
- package/test/examples/flappy_bird/environment/environment.state.service.ts +10 -0
- package/test/examples/flappy_bird/environment/environment.step.service.ts +15 -66
- package/test/examples/flappy_bird/environment/environment.types.ts +14 -0
- package/test/examples/flappy_bird/evaluation/README.md +155 -0
- package/test/examples/flappy_bird/evaluation/evaluation.constants.ts +23 -4
- package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +16 -1
- package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +7 -374
- package/test/examples/flappy_bird/evaluation/evaluation.seed.utils.ts +4 -0
- package/test/examples/flappy_bird/evaluation/evaluation.types.ts +18 -2
- package/test/examples/flappy_bird/evaluation/rollout/README.md +355 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +38 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +71 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +338 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +69 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +399 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +845 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.constants.ts +49 -7
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.errors.ts +34 -3
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.evolution.service.ts +22 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +62 -26
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.protocol.service.ts +27 -1
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.runtime.service.ts +23 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +378 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +22 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +20 -203
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.test.ts +94 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.snapshot.utils.ts +78 -13
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +235 -344
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.types.ts +170 -22
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +314 -0
- package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +17 -0
- package/test/examples/flappy_bird/flappyEnvironment.ts +21 -0
- package/test/examples/flappy_bird/flappyEvaluation.ts +12 -0
- package/test/examples/flappy_bird/flappyEvolution.worker.ts +7 -0
- package/test/examples/flappy_bird/index.ts +8 -2
- package/test/examples/flappy_bird/rng.ts +10 -0
- package/test/examples/flappy_bird/simulation-shared/README.md +518 -0
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +255 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +339 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +19 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +81 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.constants.ts +3 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.control.utils.ts +6 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.difficulty.utils.ts +9 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.errors.ts +10 -1
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.memory.utils.ts +18 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +7 -402
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +36 -6
- package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +30 -9
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.types.ts +38 -5
- package/test/examples/flappy_bird/trainFlappyBird.ts +13 -0
- package/test/examples/flappy_bird/trainer/README.md +676 -0
- package/test/examples/flappy_bird/trainer/evaluation/README.md +253 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +15 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +86 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +187 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +32 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +182 -0
- package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
- package/test/examples/flappy_bird/trainer/trainer.fitness.service.ts +23 -1
- package/test/examples/flappy_bird/trainer/trainer.loop.service.ts +17 -1
- package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.ts +136 -0
- package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
- package/test/examples/flappy_bird/trainer/trainer.setup.service.ts +22 -0
- package/test/examples/flappy_bird/trainer/trainer.signals.service.ts +8 -0
- package/test/examples/flappy_bird/trainer/trainer.ts +38 -553
- package/test/examples/flappy_bird/trainer/trainer.types.ts +44 -7
- package/test/neat/neat.topology-intent.test.ts +129 -0
- package/test/network/network.topology-intent.test.ts +44 -0
- package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
- package/test/examples/flappy_bird/environment/environment.ts +0 -7
- package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
- package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
# browser-entry/visualization
|
|
2
|
+
|
|
3
|
+
## browser-entry/visualization/visualization.types.ts
|
|
4
|
+
|
|
5
|
+
### DynamicColorScale
|
|
6
|
+
|
|
7
|
+
Visualization-specific color-scale contracts for network rendering.
|
|
8
|
+
|
|
9
|
+
The Flappy Bird demo renders connection weights and node biases with tiered
|
|
10
|
+
neon ramps so humans can quickly read sign and magnitude without parsing raw
|
|
11
|
+
numbers on every edge and node.
|
|
12
|
+
|
|
13
|
+
### NetworkVisualizationColorScales
|
|
14
|
+
|
|
15
|
+
Grouped color scales for connection and bias channels.
|
|
16
|
+
|
|
17
|
+
Keeping the two scales together ensures the legend and drawing code read from
|
|
18
|
+
one consistent view of the active network range.
|
|
19
|
+
|
|
20
|
+
## browser-entry/visualization/visualization.ts
|
|
21
|
+
|
|
22
|
+
### visualization
|
|
23
|
+
|
|
24
|
+
Public visualization facade for browser-entry network rendering.
|
|
25
|
+
|
|
26
|
+
The dedicated visualization folder focuses on turning network structure and
|
|
27
|
+
parameter ranges into readable graphics. Layer resolution itself is shared
|
|
28
|
+
with the neighboring network-view topology boundary, so this facade exposes
|
|
29
|
+
that topology helper while keeping the visualization subsystem's public story
|
|
30
|
+
in one place.
|
|
31
|
+
|
|
32
|
+
### resolveNetworkVisualizationLayers
|
|
33
|
+
|
|
34
|
+
`(network: import("src/architecture/network").default | undefined, inputSize: number, outputSize: number) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkNodeLike[][]`
|
|
35
|
+
|
|
36
|
+
Topology resolution helpers for the browser network view.
|
|
37
|
+
|
|
38
|
+
These helpers answer a key visualization question: how should the current
|
|
39
|
+
network be partitioned into ordered layers so layout and architecture labels
|
|
40
|
+
stay meaningful even when some metadata is missing?
|
|
41
|
+
|
|
42
|
+
## browser-entry/visualization/visualization.errors.ts
|
|
43
|
+
|
|
44
|
+
### visualization.errors
|
|
45
|
+
|
|
46
|
+
Error text for non-finite legend bounds.
|
|
47
|
+
|
|
48
|
+
### assertFiniteLegendBound
|
|
49
|
+
|
|
50
|
+
`(value: number) => void`
|
|
51
|
+
|
|
52
|
+
Guards legend-bound formatting against non-finite values.
|
|
53
|
+
|
|
54
|
+
Parameters:
|
|
55
|
+
- `value` - - Legend bound candidate.
|
|
56
|
+
|
|
57
|
+
Returns: Nothing.
|
|
58
|
+
|
|
59
|
+
### FLAPPY_VISUALIZATION_NON_FINITE_BOUND_ERROR_MESSAGE
|
|
60
|
+
|
|
61
|
+
### VisualizationNonFiniteBoundError
|
|
62
|
+
|
|
63
|
+
Thrown when a legend bound cannot be safely formatted.
|
|
64
|
+
|
|
65
|
+
## browser-entry/visualization/visualization.constants.ts
|
|
66
|
+
|
|
67
|
+
### visualization.constants
|
|
68
|
+
|
|
69
|
+
Pixel side length for dotted negative-connection square markers.
|
|
70
|
+
|
|
71
|
+
### FLAPPY_NETWORK_DISABLED_CONNECTION_ALPHA
|
|
72
|
+
|
|
73
|
+
### FLAPPY_NETWORK_DISABLED_CONNECTION_DASH_PATTERN
|
|
74
|
+
|
|
75
|
+
### FLAPPY_NETWORK_DOTTED_CONNECTION_ALIGNMENT_EPSILON
|
|
76
|
+
|
|
77
|
+
### FLAPPY_NETWORK_DOTTED_CONNECTION_SQUARE_SIDE_PX
|
|
78
|
+
|
|
79
|
+
### FLAPPY_NETWORK_DOTTED_CONNECTION_STEP_COMPACT_RATIO
|
|
80
|
+
|
|
81
|
+
### FLAPPY_NETWORK_DOTTED_CONNECTION_WIDTH_SPACING_RATIO
|
|
82
|
+
|
|
83
|
+
### FLAPPY_NETWORK_ENABLED_CONNECTION_ALPHA
|
|
84
|
+
|
|
85
|
+
### FLAPPY_NETWORK_HEADER_LINE_HEIGHT_PX
|
|
86
|
+
|
|
87
|
+
### FLAPPY_NETWORK_HEADER_PADDING_PX
|
|
88
|
+
|
|
89
|
+
### FLAPPY_NETWORK_HIDDEN_NODE_STROKE_WIDTH_PX
|
|
90
|
+
|
|
91
|
+
### FLAPPY_NETWORK_HIDDEN_NODE_VERTICAL_PADDING_PX
|
|
92
|
+
|
|
93
|
+
### FLAPPY_NETWORK_LEGEND_ARCHITECTURE_GAP_PX
|
|
94
|
+
|
|
95
|
+
### FLAPPY_NETWORK_LEGEND_BIAS_LABEL_X_PX
|
|
96
|
+
|
|
97
|
+
### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_SIZE_PX
|
|
98
|
+
|
|
99
|
+
### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_X_PX
|
|
100
|
+
|
|
101
|
+
### FLAPPY_NETWORK_LEGEND_BIAS_SWATCH_Y_PX
|
|
102
|
+
|
|
103
|
+
### FLAPPY_NETWORK_LEGEND_BOX_PADDING_PX
|
|
104
|
+
|
|
105
|
+
### FLAPPY_NETWORK_LEGEND_CONNECTION_LABEL_X_PX
|
|
106
|
+
|
|
107
|
+
### FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_END_X_PX
|
|
108
|
+
|
|
109
|
+
### FLAPPY_NETWORK_LEGEND_CONNECTION_SAMPLE_Y_OFFSET_PX
|
|
110
|
+
|
|
111
|
+
### FLAPPY_NETWORK_LEGEND_HEADER_TOP_PADDING_PX
|
|
112
|
+
|
|
113
|
+
### FLAPPY_NETWORK_LEGEND_MIN_ARCHITECTURE_TOP_PX
|
|
114
|
+
|
|
115
|
+
### FLAPPY_NETWORK_MIN_RENDER_NODE_HEIGHT_PX
|
|
116
|
+
|
|
117
|
+
### FLAPPY_NETWORK_OUTPUT_NODE_HEIGHT_REDUCTION_PX
|
|
118
|
+
|
|
119
|
+
### FLAPPY_NETWORK_OUTPUT_NODE_SHADOW_BLUR_PX
|
|
120
|
+
|
|
121
|
+
### FLAPPY_NETWORK_OUTPUT_NODE_STROKE_WIDTH_PX
|
|
122
|
+
|
|
123
|
+
## browser-entry/visualization/visualization.draw.service.ts
|
|
124
|
+
|
|
125
|
+
### drawBiasNodeScene
|
|
126
|
+
|
|
127
|
+
`(context: CanvasRenderingContext2D, biasNodeScene: BiasNodeScene, nodeWidthPx: number) => void`
|
|
128
|
+
|
|
129
|
+
Draws a resolved node rectangle and optional bias label.
|
|
130
|
+
|
|
131
|
+
Parameters:
|
|
132
|
+
- `context` - - Render context.
|
|
133
|
+
- `biasNodeScene` - - Paint-ready node scene.
|
|
134
|
+
- `nodeWidthPx` - - Shared node width.
|
|
135
|
+
|
|
136
|
+
Returns: Nothing.
|
|
137
|
+
|
|
138
|
+
### drawBiasNodesLayer
|
|
139
|
+
|
|
140
|
+
`(context: CanvasRenderingContext2D, positionedNodes: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike[], nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => void`
|
|
141
|
+
|
|
142
|
+
Draws all network nodes with bias labels.
|
|
143
|
+
|
|
144
|
+
The node layer pairs each rectangle with a compact bias label so the panel can
|
|
145
|
+
show both topology and a lightweight hint of parameter state.
|
|
146
|
+
|
|
147
|
+
Parameters:
|
|
148
|
+
- `context` - - Render context.
|
|
149
|
+
- `positionedNodes` - - Positioned nodes.
|
|
150
|
+
- `nodeDimensions` - - Node dimensions.
|
|
151
|
+
- `biasScale` - - Dynamic bias color scale.
|
|
152
|
+
|
|
153
|
+
Returns: Nothing.
|
|
154
|
+
|
|
155
|
+
### drawLeftAlignedTextRows
|
|
156
|
+
|
|
157
|
+
`(context: CanvasRenderingContext2D, request: { lines: string[]; leftPx: number; topPx: number; lineHeightPx: number; font: string; fillStyle: string; }) => void`
|
|
158
|
+
|
|
159
|
+
Draws multiline text rows aligned to a fixed left edge.
|
|
160
|
+
|
|
161
|
+
Parameters:
|
|
162
|
+
- `context` - - Render context.
|
|
163
|
+
- `request` - - Multiline text draw request.
|
|
164
|
+
|
|
165
|
+
Returns: Nothing.
|
|
166
|
+
|
|
167
|
+
### drawLegendArchitectureLabel
|
|
168
|
+
|
|
169
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
|
|
170
|
+
|
|
171
|
+
Draws the architecture label block above the legend frame.
|
|
172
|
+
|
|
173
|
+
Parameters:
|
|
174
|
+
- `context` - - Render context.
|
|
175
|
+
- `legendSceneContext` - - Legend scene context.
|
|
176
|
+
|
|
177
|
+
Returns: Nothing.
|
|
178
|
+
|
|
179
|
+
### drawLegendBiasRow
|
|
180
|
+
|
|
181
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext, biasLegendRow: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow, biasRowTopPx: number) => void`
|
|
182
|
+
|
|
183
|
+
Draws a single bias legend row.
|
|
184
|
+
|
|
185
|
+
Parameters:
|
|
186
|
+
- `context` - - Render context.
|
|
187
|
+
- `legendSceneContext` - - Legend scene context.
|
|
188
|
+
- `biasLegendRow` - - Legend row.
|
|
189
|
+
- `biasRowTopPx` - - Row top coordinate.
|
|
190
|
+
|
|
191
|
+
Returns: Nothing.
|
|
192
|
+
|
|
193
|
+
### drawLegendBiasSection
|
|
194
|
+
|
|
195
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
|
|
196
|
+
|
|
197
|
+
Draws the bias legend section.
|
|
198
|
+
|
|
199
|
+
Parameters:
|
|
200
|
+
- `context` - - Render context.
|
|
201
|
+
- `legendSceneContext` - - Legend scene context.
|
|
202
|
+
|
|
203
|
+
Returns: Nothing.
|
|
204
|
+
|
|
205
|
+
### drawLegendConnectionRow
|
|
206
|
+
|
|
207
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext, connectionLegendRow: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow, connectionRowTopPx: number) => void`
|
|
208
|
+
|
|
209
|
+
Draws a single connection legend row.
|
|
210
|
+
|
|
211
|
+
Parameters:
|
|
212
|
+
- `context` - - Render context.
|
|
213
|
+
- `legendSceneContext` - - Legend scene context.
|
|
214
|
+
- `connectionLegendRow` - - Legend row.
|
|
215
|
+
- `connectionRowTopPx` - - Row top coordinate.
|
|
216
|
+
|
|
217
|
+
Returns: Nothing.
|
|
218
|
+
|
|
219
|
+
### drawLegendConnectionSection
|
|
220
|
+
|
|
221
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
|
|
222
|
+
|
|
223
|
+
Draws the connection-weight legend section.
|
|
224
|
+
|
|
225
|
+
Parameters:
|
|
226
|
+
- `context` - - Render context.
|
|
227
|
+
- `legendSceneContext` - - Legend scene context.
|
|
228
|
+
|
|
229
|
+
Returns: Nothing.
|
|
230
|
+
|
|
231
|
+
### drawLegendFrame
|
|
232
|
+
|
|
233
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
|
|
234
|
+
|
|
235
|
+
Draws the legend container frame.
|
|
236
|
+
|
|
237
|
+
Parameters:
|
|
238
|
+
- `context` - - Render context.
|
|
239
|
+
- `legendSceneContext` - - Legend scene context.
|
|
240
|
+
|
|
241
|
+
Returns: Nothing.
|
|
242
|
+
|
|
243
|
+
### drawLegendHeader
|
|
244
|
+
|
|
245
|
+
`(context: CanvasRenderingContext2D, legendSceneContext: LegendSceneContext) => void`
|
|
246
|
+
|
|
247
|
+
Draws the legend title row.
|
|
248
|
+
|
|
249
|
+
Parameters:
|
|
250
|
+
- `context` - - Render context.
|
|
251
|
+
- `legendSceneContext` - - Legend scene context.
|
|
252
|
+
|
|
253
|
+
Returns: Nothing.
|
|
254
|
+
|
|
255
|
+
### drawNetworkColorLegend
|
|
256
|
+
|
|
257
|
+
`(context: CanvasRenderingContext2D, architectureLabel: string, colorScales: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales) => void`
|
|
258
|
+
|
|
259
|
+
Draws the color legend for connections and node bias values.
|
|
260
|
+
|
|
261
|
+
This legend is what turns the panel from "colorful art" into an interpretable
|
|
262
|
+
instrument: it tells the viewer what each weight and bias color actually
|
|
263
|
+
means numerically.
|
|
264
|
+
|
|
265
|
+
Parameters:
|
|
266
|
+
- `context` - - Render context.
|
|
267
|
+
- `architectureLabel` - - Compact architecture description.
|
|
268
|
+
- `colorScales` - - Connection and bias color scales.
|
|
269
|
+
|
|
270
|
+
Returns: Nothing.
|
|
271
|
+
|
|
272
|
+
### drawNetworkVisualizationHeader
|
|
273
|
+
|
|
274
|
+
`(context: CanvasRenderingContext2D, architectureLabel: string) => void`
|
|
275
|
+
|
|
276
|
+
Draws network architecture header text.
|
|
277
|
+
|
|
278
|
+
The header gives viewers a compact architecture summary before they inspect
|
|
279
|
+
individual nodes and edges.
|
|
280
|
+
|
|
281
|
+
Parameters:
|
|
282
|
+
- `context` - - Render context.
|
|
283
|
+
- `architectureLabel` - - Header label.
|
|
284
|
+
|
|
285
|
+
Returns: Nothing.
|
|
286
|
+
|
|
287
|
+
### drawSquareDottedConnection
|
|
288
|
+
|
|
289
|
+
`(context: CanvasRenderingContext2D, input: { fromXPx: number; fromYPx: number; toXPx: number; toYPx: number; color: string; lineWidthPx: number; }) => void`
|
|
290
|
+
|
|
291
|
+
Draws a square-dotted connection stroke for negative weights.
|
|
292
|
+
|
|
293
|
+
Parameters:
|
|
294
|
+
- `context` - - Render context.
|
|
295
|
+
- `input` - - Dotted-stroke endpoints and style.
|
|
296
|
+
|
|
297
|
+
Returns: Nothing.
|
|
298
|
+
|
|
299
|
+
### drawWeightedConnectionScene
|
|
300
|
+
|
|
301
|
+
`(context: CanvasRenderingContext2D, weightedConnectionScene: WeightedConnectionScene) => void`
|
|
302
|
+
|
|
303
|
+
Draws a previously resolved weighted connection scene.
|
|
304
|
+
|
|
305
|
+
Parameters:
|
|
306
|
+
- `context` - - Render context.
|
|
307
|
+
- `weightedConnectionScene` - - Render-ready connection scene.
|
|
308
|
+
|
|
309
|
+
Returns: Nothing.
|
|
310
|
+
|
|
311
|
+
### drawWeightedConnectionsLayer
|
|
312
|
+
|
|
313
|
+
`(context: CanvasRenderingContext2D, runtimeConnections: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkConnectionLike[], positionByNodeIndex: Map<number, import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike>, connectionScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => void`
|
|
314
|
+
|
|
315
|
+
Draws weighted connection lines.
|
|
316
|
+
|
|
317
|
+
Connection styling carries semantic meaning: color encodes magnitude and sign,
|
|
318
|
+
while dash patterns and auxiliary marks help distinguish disabled or negative
|
|
319
|
+
edges in a way that still reads quickly on a dense graph.
|
|
320
|
+
|
|
321
|
+
Parameters:
|
|
322
|
+
- `context` - - Render context.
|
|
323
|
+
- `runtimeConnections` - - Runtime connection list.
|
|
324
|
+
- `positionByNodeIndex` - - Node layout map.
|
|
325
|
+
- `connectionScale` - - Dynamic connection color scale.
|
|
326
|
+
|
|
327
|
+
Returns: Nothing.
|
|
328
|
+
|
|
329
|
+
### resolveBiasNodeHeightPx
|
|
330
|
+
|
|
331
|
+
`(nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, biasNodeLabelMetrics: BiasNodeLabelMetrics, isOutputNode: boolean) => number`
|
|
332
|
+
|
|
333
|
+
Resolves node rectangle height from label metrics and node role.
|
|
334
|
+
|
|
335
|
+
Parameters:
|
|
336
|
+
- `nodeDimensions` - - Shared node dimensions.
|
|
337
|
+
- `biasNodeLabelMetrics` - - Measured label metrics.
|
|
338
|
+
- `isOutputNode` - - Whether the node is an output node.
|
|
339
|
+
|
|
340
|
+
Returns: Render height for the node rectangle.
|
|
341
|
+
|
|
342
|
+
### resolveBiasNodeLabelMetrics
|
|
343
|
+
|
|
344
|
+
`(context: CanvasRenderingContext2D, nodeLabel: string, nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike) => BiasNodeLabelMetrics`
|
|
345
|
+
|
|
346
|
+
Measures a bias label and resolves its font declaration.
|
|
347
|
+
|
|
348
|
+
Parameters:
|
|
349
|
+
- `context` - - Render context.
|
|
350
|
+
- `nodeLabel` - - Bias label string.
|
|
351
|
+
- `nodeDimensions` - - Shared node dimensions.
|
|
352
|
+
|
|
353
|
+
Returns: Measured label metrics.
|
|
354
|
+
|
|
355
|
+
### resolveBiasNodePaintStyle
|
|
356
|
+
|
|
357
|
+
`(positionedNode: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => BiasNodePaintStyle`
|
|
358
|
+
|
|
359
|
+
Resolves node fill, stroke, and glow styling.
|
|
360
|
+
|
|
361
|
+
Parameters:
|
|
362
|
+
- `positionedNode` - - Positioned node payload.
|
|
363
|
+
- `biasScale` - - Bias color scale.
|
|
364
|
+
|
|
365
|
+
Returns: Node paint style.
|
|
366
|
+
|
|
367
|
+
### resolveBiasNodeScene
|
|
368
|
+
|
|
369
|
+
`(context: CanvasRenderingContext2D, positionedNode: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike, nodeDimensions: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkNodeDimensionsLike, halfNodeWidthPx: number, biasScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => BiasNodeScene`
|
|
370
|
+
|
|
371
|
+
Resolves all paint attributes needed to render a single node.
|
|
372
|
+
|
|
373
|
+
Parameters:
|
|
374
|
+
- `context` - - Render context.
|
|
375
|
+
- `positionedNode` - - Positioned node payload.
|
|
376
|
+
- `nodeDimensions` - - Shared node dimensions.
|
|
377
|
+
- `halfNodeWidthPx` - - Cached half node width.
|
|
378
|
+
- `biasScale` - - Bias color scale.
|
|
379
|
+
|
|
380
|
+
Returns: Paint-ready node scene.
|
|
381
|
+
|
|
382
|
+
### resolveLegendSceneContext
|
|
383
|
+
|
|
384
|
+
`(context: CanvasRenderingContext2D, architectureLabel: string, colorScales: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales) => LegendSceneContext`
|
|
385
|
+
|
|
386
|
+
Resolves the legend rows, layout, and architecture label bounds.
|
|
387
|
+
|
|
388
|
+
Parameters:
|
|
389
|
+
- `context` - - Render context.
|
|
390
|
+
- `architectureLabel` - - Multiline architecture label.
|
|
391
|
+
- `colorScales` - - Connection and bias color scales.
|
|
392
|
+
|
|
393
|
+
Returns: Legend scene context.
|
|
394
|
+
|
|
395
|
+
### resolveWeightedConnectionScene
|
|
396
|
+
|
|
397
|
+
`(runtimeConnection: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkConnectionLike, positionByNodeIndex: Map<number, import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").PositionedNetworkNodeLike>, connectionScale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale) => WeightedConnectionScene | undefined`
|
|
398
|
+
|
|
399
|
+
Resolves a renderable connection scene from runtime data and node positions.
|
|
400
|
+
|
|
401
|
+
Parameters:
|
|
402
|
+
- `runtimeConnection` - - Candidate runtime connection.
|
|
403
|
+
- `positionByNodeIndex` - - Node layout map.
|
|
404
|
+
- `connectionScale` - - Connection color scale.
|
|
405
|
+
|
|
406
|
+
Returns: Renderable connection scene, when both endpoint nodes exist.
|
|
407
|
+
|
|
408
|
+
### shouldHideNetworkColorLegend
|
|
409
|
+
|
|
410
|
+
`(context: CanvasRenderingContext2D) => boolean`
|
|
411
|
+
|
|
412
|
+
Determines whether the responsive viewport intentionally hides the overlay legend.
|
|
413
|
+
|
|
414
|
+
Parameters:
|
|
415
|
+
- `context` - - Render context.
|
|
416
|
+
|
|
417
|
+
Returns: True when the legend should be omitted.
|
|
418
|
+
|
|
419
|
+
## browser-entry/visualization/visualization.colors.utils.ts
|
|
420
|
+
|
|
421
|
+
### createLogDivergingColorTiers
|
|
422
|
+
|
|
423
|
+
`(input: { maxAbsValue: number; centerBlueThreshold: number; negativePalette: readonly string[]; centerBluePalette: readonly string[]; positivePalette: readonly string[]; logarithmicSteepness: number; edgeStartAbsValue?: number | undefined; edgeTierCount?: number | undefined; }) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorTier[]`
|
|
424
|
+
|
|
425
|
+
Color-scale synthesis helpers for network visualization.
|
|
426
|
+
|
|
427
|
+
These utilities convert raw connection weights and node biases into tiered
|
|
428
|
+
neon color scales. The goal is not photorealism; it is interpretability. A
|
|
429
|
+
reader should be able to glance at the network panel and see where strong
|
|
430
|
+
positive, strong negative, and near-zero values live.
|
|
431
|
+
|
|
432
|
+
### resolveBiasRangeColor
|
|
433
|
+
|
|
434
|
+
`(nodeBias: number) => string`
|
|
435
|
+
|
|
436
|
+
Resolves bias color for a raw node bias.
|
|
437
|
+
|
|
438
|
+
Bias colors follow the same diverging logic as connection colors so the legend
|
|
439
|
+
remains conceptually consistent across channels.
|
|
440
|
+
|
|
441
|
+
Parameters:
|
|
442
|
+
- `nodeBias` - - Node bias.
|
|
443
|
+
|
|
444
|
+
Returns: Tier color.
|
|
445
|
+
|
|
446
|
+
### resolveConnectionRangeColor
|
|
447
|
+
|
|
448
|
+
`(connectionWeight: number) => string`
|
|
449
|
+
|
|
450
|
+
Resolves connection color for a raw weight.
|
|
451
|
+
|
|
452
|
+
This small helper is useful when one-off drawing code wants the same color
|
|
453
|
+
semantics as the full dynamic scale machinery.
|
|
454
|
+
|
|
455
|
+
Parameters:
|
|
456
|
+
- `connectionWeight` - - Connection weight.
|
|
457
|
+
|
|
458
|
+
Returns: Tier color.
|
|
459
|
+
|
|
460
|
+
### resolveNetworkVisualizationColorScales
|
|
461
|
+
|
|
462
|
+
`(network: import("src/architecture/network").default | undefined) => import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").NetworkVisualizationColorScales`
|
|
463
|
+
|
|
464
|
+
Resolves dynamic connection/bias color scales from the active network range.
|
|
465
|
+
|
|
466
|
+
The active network may contain only a narrow slice of the full theoretical
|
|
467
|
+
value range, so the legend adapts to what is currently present instead of
|
|
468
|
+
always rendering a fixed generic scale.
|
|
469
|
+
|
|
470
|
+
Parameters:
|
|
471
|
+
- `network` - - Active network.
|
|
472
|
+
|
|
473
|
+
Returns: Dynamic scales used by graph drawing and legend rows.
|
|
474
|
+
|
|
475
|
+
### resolveTierColor
|
|
476
|
+
|
|
477
|
+
`(value: number, tiers: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorTier[], aboveTierColor: string) => string`
|
|
478
|
+
|
|
479
|
+
Resolves a color from ordered tier definitions.
|
|
480
|
+
|
|
481
|
+
This is the final classification step that maps one numeric weight or bias to
|
|
482
|
+
the swatch color the renderer should paint.
|
|
483
|
+
|
|
484
|
+
Parameters:
|
|
485
|
+
- `value` - - Numeric value to classify.
|
|
486
|
+
- `tiers` - - Ordered tier list.
|
|
487
|
+
- `aboveTierColor` - - Fallback color for values above the last tier.
|
|
488
|
+
|
|
489
|
+
Returns: Resolved color string.
|
|
490
|
+
|
|
491
|
+
## browser-entry/visualization/visualization.legend.utils.ts
|
|
492
|
+
|
|
493
|
+
### createColorLegendRows
|
|
494
|
+
|
|
495
|
+
`(scale: import("test/examples/flappy_bird/browser-entry/visualization/visualization.types").DynamicColorScale, symbol: "w" | "b") => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[]`
|
|
496
|
+
|
|
497
|
+
Legend-layout helpers for network visualization.
|
|
498
|
+
|
|
499
|
+
The legend explains how colors map back to numeric weights and biases. These
|
|
500
|
+
helpers turn color scales into labeled rows and place the legend so it stays
|
|
501
|
+
readable across different canvas sizes.
|
|
502
|
+
|
|
503
|
+
### resolveDefaultNetworkLegendLayout
|
|
504
|
+
|
|
505
|
+
`(context: CanvasRenderingContext2D, network: import("src/architecture/network").default | undefined) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkLegendLayout`
|
|
506
|
+
|
|
507
|
+
Resolves default legend layout from internal tier definitions.
|
|
508
|
+
|
|
509
|
+
This convenience helper is used when the caller wants a layout driven by the
|
|
510
|
+
currently active network and does not need to assemble the intermediate rows
|
|
511
|
+
manually.
|
|
512
|
+
|
|
513
|
+
Parameters:
|
|
514
|
+
- `context` - - Render context.
|
|
515
|
+
- `network` - - Active network instance.
|
|
516
|
+
|
|
517
|
+
Returns: Legend layout.
|
|
518
|
+
|
|
519
|
+
### resolveNetworkLegendLayout
|
|
520
|
+
|
|
521
|
+
`(context: CanvasRenderingContext2D, connectionLegendRows: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[], biasLegendRows: import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").ColorLegendRow[]) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").NetworkLegendLayout`
|
|
522
|
+
|
|
523
|
+
Resolves network legend layout from canvas constraints.
|
|
524
|
+
|
|
525
|
+
The legend layout adapts between regular and compact modes so the network
|
|
526
|
+
panel can stay informative on smaller viewports without swallowing the whole
|
|
527
|
+
canvas.
|
|
528
|
+
|
|
529
|
+
Parameters:
|
|
530
|
+
- `context` - - Render context.
|
|
531
|
+
- `connectionLegendRows` - - Connection legend rows.
|
|
532
|
+
- `biasLegendRows` - - Bias legend rows.
|
|
533
|
+
|
|
534
|
+
Returns: Computed legend layout.
|
|
535
|
+
|
|
536
|
+
## browser-entry/visualization/visualization.topology.utils.ts
|
|
537
|
+
|
|
538
|
+
### visualization.topology.utils
|
|
539
|
+
|
|
540
|
+
Shared topology formatting helpers used by network-view and visualization.
|
|
541
|
+
|
|
542
|
+
The topology boundary resolves node layering, while this helper module adds a
|
|
543
|
+
few small presentation-oriented utilities that are reused by the visualization
|
|
544
|
+
panel.
|
|
545
|
+
|
|
546
|
+
### formatNodeBiasLabel
|
|
547
|
+
|
|
548
|
+
`(nodeBias: number) => string`
|
|
549
|
+
|
|
550
|
+
Formats node bias labels with fixed sign and precision.
|
|
551
|
+
|
|
552
|
+
Consistent sign and precision make dense node labels easier to scan quickly in
|
|
553
|
+
the rendered network panel.
|
|
554
|
+
|
|
555
|
+
Parameters:
|
|
556
|
+
- `nodeBias` - - Node bias value.
|
|
557
|
+
|
|
558
|
+
Returns: Label text.
|
|
559
|
+
|
|
560
|
+
### resolveNetworkVisualizationLayers
|
|
561
|
+
|
|
562
|
+
`(network: import("src/architecture/network").default | undefined, inputSize: number, outputSize: number) => import("test/examples/flappy_bird/browser-entry/browser-entry.visualization.types").VisualNetworkNodeLike[][]`
|
|
563
|
+
|
|
564
|
+
Topology resolution helpers for the browser network view.
|
|
565
|
+
|
|
566
|
+
These helpers answer a key visualization question: how should the current
|
|
567
|
+
network be partitioned into ordered layers so layout and architecture labels
|
|
568
|
+
stay meaningful even when some metadata is missing?
|
|
@@ -12,9 +12,22 @@ import type {
|
|
|
12
12
|
NetworkVisualizationColorScales,
|
|
13
13
|
} from './visualization.types';
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Color-scale synthesis helpers for network visualization.
|
|
17
|
+
*
|
|
18
|
+
* These utilities convert raw connection weights and node biases into tiered
|
|
19
|
+
* neon color scales. The goal is not photorealism; it is interpretability. A
|
|
20
|
+
* reader should be able to glance at the network panel and see where strong
|
|
21
|
+
* positive, strong negative, and near-zero values live.
|
|
22
|
+
*/
|
|
23
|
+
|
|
15
24
|
/**
|
|
16
25
|
* Builds logarithmic diverging color tiers with a center band and edge extension.
|
|
17
26
|
*
|
|
27
|
+
* Diverging scales are useful here because network parameters naturally split
|
|
28
|
+
* around zero. Negative and positive values should feel visually related, but
|
|
29
|
+
* not identical.
|
|
30
|
+
*
|
|
18
31
|
* @param input - Tier creation options.
|
|
19
32
|
* @returns Ordered tier list.
|
|
20
33
|
*/
|
|
@@ -74,6 +87,9 @@ export function createLogDivergingColorTiers(input: {
|
|
|
74
87
|
/**
|
|
75
88
|
* Resolves a color from ordered tier definitions.
|
|
76
89
|
*
|
|
90
|
+
* This is the final classification step that maps one numeric weight or bias to
|
|
91
|
+
* the swatch color the renderer should paint.
|
|
92
|
+
*
|
|
77
93
|
* @param value - Numeric value to classify.
|
|
78
94
|
* @param tiers - Ordered tier list.
|
|
79
95
|
* @param aboveTierColor - Fallback color for values above the last tier.
|
|
@@ -91,6 +107,9 @@ export function resolveTierColor(
|
|
|
91
107
|
/**
|
|
92
108
|
* Resolves connection color for a raw weight.
|
|
93
109
|
*
|
|
110
|
+
* This small helper is useful when one-off drawing code wants the same color
|
|
111
|
+
* semantics as the full dynamic scale machinery.
|
|
112
|
+
*
|
|
94
113
|
* @param connectionWeight - Connection weight.
|
|
95
114
|
* @returns Tier color.
|
|
96
115
|
*/
|
|
@@ -109,6 +128,9 @@ export function resolveConnectionRangeColor(connectionWeight: number): string {
|
|
|
109
128
|
/**
|
|
110
129
|
* Resolves bias color for a raw node bias.
|
|
111
130
|
*
|
|
131
|
+
* Bias colors follow the same diverging logic as connection colors so the legend
|
|
132
|
+
* remains conceptually consistent across channels.
|
|
133
|
+
*
|
|
112
134
|
* @param nodeBias - Node bias.
|
|
113
135
|
* @returns Tier color.
|
|
114
136
|
*/
|
|
@@ -123,6 +145,10 @@ export function resolveBiasRangeColor(nodeBias: number): string {
|
|
|
123
145
|
/**
|
|
124
146
|
* Resolves dynamic connection/bias color scales from the active network range.
|
|
125
147
|
*
|
|
148
|
+
* The active network may contain only a narrow slice of the full theoretical
|
|
149
|
+
* value range, so the legend adapts to what is currently present instead of
|
|
150
|
+
* always rendering a fixed generic scale.
|
|
151
|
+
*
|
|
126
152
|
* @param network - Active network.
|
|
127
153
|
* @returns Dynamic scales used by graph drawing and legend rows.
|
|
128
154
|
*/
|