@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
|
@@ -55,7 +55,7 @@ Global index counter for assigning unique indices to nodes.
|
|
|
55
55
|
|
|
56
56
|
#### _safeUpdateWeight
|
|
57
57
|
|
|
58
|
-
`(connection: import("
|
|
58
|
+
`(connection: import("src/architecture/connection").default, delta: number) => void`
|
|
59
59
|
|
|
60
60
|
Internal helper to safely update a connection weight with clipping and NaN checks.
|
|
61
61
|
|
|
@@ -159,7 +159,7 @@ Useful for starting a new activation sequence (e.g., for a new input pattern).
|
|
|
159
159
|
|
|
160
160
|
#### connect
|
|
161
161
|
|
|
162
|
-
`(target: import("
|
|
162
|
+
`(target: import("src/architecture/node").default | { nodes: import("src/architecture/node").default[]; }, weight: number | undefined) => import("src/architecture/connection").default[]`
|
|
163
163
|
|
|
164
164
|
Creates a connection from this node to a target node or all nodes in a group.
|
|
165
165
|
|
|
@@ -179,7 +179,7 @@ The derivative of the activation function evaluated at the node's current state.
|
|
|
179
179
|
|
|
180
180
|
#### disconnect
|
|
181
181
|
|
|
182
|
-
`(target: import("
|
|
182
|
+
`(target: import("src/architecture/node").default, twosided: boolean) => void`
|
|
183
183
|
|
|
184
184
|
Removes the connection from this node to the target node.
|
|
185
185
|
|
|
@@ -193,7 +193,7 @@ Stores error values calculated during backpropagation.
|
|
|
193
193
|
|
|
194
194
|
#### fromJSON
|
|
195
195
|
|
|
196
|
-
`(json: { bias: number; type: string; squash: string; mask: number; }) => import("
|
|
196
|
+
`(json: { bias: number; type: string; squash: string; mask: number; }) => import("src/architecture/node").default`
|
|
197
197
|
|
|
198
198
|
Creates a Node instance from a JSON object.
|
|
199
199
|
|
|
@@ -204,7 +204,7 @@ Returns: A new Node instance configured according to the JSON object.
|
|
|
204
204
|
|
|
205
205
|
#### gate
|
|
206
206
|
|
|
207
|
-
`(connections: import("
|
|
207
|
+
`(connections: import("src/architecture/connection").default | import("src/architecture/connection").default[]) => void`
|
|
208
208
|
|
|
209
209
|
Makes this node gate the provided connection(s).
|
|
210
210
|
The connection's gain will be controlled by this node's activation value.
|
|
@@ -226,7 +226,7 @@ Internal flag to detect cycles during activation
|
|
|
226
226
|
|
|
227
227
|
#### isConnectedTo
|
|
228
228
|
|
|
229
|
-
`(target: import("
|
|
229
|
+
`(target: import("src/architecture/node").default) => boolean`
|
|
230
230
|
|
|
231
231
|
Checks if this node is connected to another node.
|
|
232
232
|
|
|
@@ -237,7 +237,7 @@ Returns: True if connected, otherwise false.
|
|
|
237
237
|
|
|
238
238
|
#### isProjectedBy
|
|
239
239
|
|
|
240
|
-
`(node: import("
|
|
240
|
+
`(node: import("src/architecture/node").default) => boolean`
|
|
241
241
|
|
|
242
242
|
Checks if the given node has a direct outgoing connection to this node.
|
|
243
243
|
Considers both regular incoming connections and the self-connection.
|
|
@@ -249,7 +249,7 @@ Returns: True if the given node projects to this node, false otherwise.
|
|
|
249
249
|
|
|
250
250
|
#### isProjectingTo
|
|
251
251
|
|
|
252
|
-
`(node: import("
|
|
252
|
+
`(node: import("src/architecture/node").default) => boolean`
|
|
253
253
|
|
|
254
254
|
Checks if this node has a direct outgoing connection to the given node.
|
|
255
255
|
Considers both regular outgoing connections and the self-connection.
|
|
@@ -369,7 +369,7 @@ Determines behavior (e.g., input nodes don't have biases modified typically, out
|
|
|
369
369
|
|
|
370
370
|
#### ungate
|
|
371
371
|
|
|
372
|
-
`(connections: import("
|
|
372
|
+
`(connections: import("src/architecture/connection").default | import("src/architecture/connection").default[]) => void`
|
|
373
373
|
|
|
374
374
|
Removes this node's gating control over the specified connection(s).
|
|
375
375
|
Resets the connection's gain to 1 and removes it from the `connections.gated` list.
|
|
@@ -394,7 +394,7 @@ may reject the model.
|
|
|
394
394
|
|
|
395
395
|
### exportToONNX
|
|
396
396
|
|
|
397
|
-
`(network: import("
|
|
397
|
+
`(network: import("src/architecture/network").default, options: import("src/architecture/network/onnx/network.onnx.utils.types").OnnxExportOptions) => import("src/architecture/network/onnx/network.onnx.utils.types").OnnxModel`
|
|
398
398
|
|
|
399
399
|
Export a NeatapticTS network to an ONNX-like **JSON object** (`OnnxModel`).
|
|
400
400
|
|
|
@@ -432,7 +432,7 @@ Returns: ONNX-like model object suitable for persistence or re-import.
|
|
|
432
432
|
|
|
433
433
|
### importFromONNX
|
|
434
434
|
|
|
435
|
-
`(onnx: import("
|
|
435
|
+
`(onnx: import("src/architecture/network/onnx/network.onnx.utils.types").OnnxModel) => import("src/architecture/network").default`
|
|
436
436
|
|
|
437
437
|
Reconstruct a NeatapticTS network from an exported `OnnxModel`.
|
|
438
438
|
|
|
@@ -534,9 +534,6 @@ Activates all nodes in the group. If input values are provided, they are assigne
|
|
|
534
534
|
sequentially to the nodes before activation. Otherwise, nodes activate based on their
|
|
535
535
|
existing states and incoming connections.
|
|
536
536
|
|
|
537
|
-
Parameters:
|
|
538
|
-
- `` - - An optional array of input values. If provided, its length must match the number of nodes in the group.
|
|
539
|
-
|
|
540
537
|
Returns: An array containing the activation value of each node in the group, in order.
|
|
541
538
|
|
|
542
539
|
#### clear
|
|
@@ -549,16 +546,11 @@ especially relevant in recurrent networks or sequence processing.
|
|
|
549
546
|
|
|
550
547
|
#### connect
|
|
551
548
|
|
|
552
|
-
`(target: import("
|
|
549
|
+
`(target: import("src/architecture/node").default | import("src/architecture/layer").default | import("src/architecture/group").default, method: unknown, weight: number | undefined) => import("src/architecture/connection").default[]`
|
|
553
550
|
|
|
554
551
|
Establishes connections from all nodes in this group to a target Group, Layer, or Node.
|
|
555
552
|
The connection pattern (e.g., all-to-all, one-to-one) can be specified.
|
|
556
553
|
|
|
557
|
-
Parameters:
|
|
558
|
-
- `` - - The destination entity (Group, Layer, or Node) to connect to.
|
|
559
|
-
- `` - - The connection method/type (e.g., `methods.groupConnection.ALL_TO_ALL`, `methods.groupConnection.ONE_TO_ONE`). Defaults depend on the target type and whether it's the same group.
|
|
560
|
-
- `` - - An optional fixed weight to assign to all created connections. If not provided, weights might be initialized randomly or based on node defaults.
|
|
561
|
-
|
|
562
554
|
Returns: An array containing all the connection objects created.
|
|
563
555
|
|
|
564
556
|
#### connections
|
|
@@ -570,25 +562,17 @@ Stores connection information related to this group.
|
|
|
570
562
|
|
|
571
563
|
#### disconnect
|
|
572
564
|
|
|
573
|
-
`(target: import("
|
|
565
|
+
`(target: import("src/architecture/node").default | import("src/architecture/group").default, twosided: boolean) => void`
|
|
574
566
|
|
|
575
567
|
Removes connections between nodes in this group and a target Group or Node.
|
|
576
568
|
|
|
577
|
-
Parameters:
|
|
578
|
-
- `` - - The Group or Node to disconnect from.
|
|
579
|
-
- `` - - If true, also removes connections originating from the `target` and ending in this group. Defaults to false (only removes connections from this group to the target).
|
|
580
|
-
|
|
581
569
|
#### gate
|
|
582
570
|
|
|
583
|
-
`(connections: import("
|
|
571
|
+
`(connections: import("src/architecture/connection").default | import("src/architecture/connection").default[], method: unknown) => void`
|
|
584
572
|
|
|
585
573
|
Configures nodes within this group to act as gates for the specified connection(s).
|
|
586
574
|
Gating allows the output of a node in this group to modulate the flow of signal through the gated connection.
|
|
587
575
|
|
|
588
|
-
Parameters:
|
|
589
|
-
- `` - - A single connection object or an array of connection objects to be gated.
|
|
590
|
-
- `` - - The gating mechanism to use (e.g., `methods.gating.INPUT`, `methods.gating.OUTPUT`, `methods.gating.SELF`). Specifies which part of the connection is influenced by the gater node.
|
|
591
|
-
|
|
592
576
|
#### nodes
|
|
593
577
|
|
|
594
578
|
An array holding all the nodes within this group.
|
|
@@ -601,23 +585,12 @@ Propagates the error backward through all nodes in the group. If target values a
|
|
|
601
585
|
the error is calculated against these targets (typically for output layers). Otherwise,
|
|
602
586
|
the error is calculated based on the error propagated from subsequent layers/nodes.
|
|
603
587
|
|
|
604
|
-
Parameters:
|
|
605
|
-
- `` - - The learning rate to apply during weight updates.
|
|
606
|
-
- `` - - The momentum factor to apply during weight updates.
|
|
607
|
-
- `` - - Optional target values for error calculation. If provided, its length must match the number of nodes.
|
|
608
|
-
|
|
609
588
|
#### set
|
|
610
589
|
|
|
611
590
|
`(values: { bias?: number | undefined; squash?: ((x: number, derivate?: boolean | undefined) => number) | undefined; type?: string | undefined; }) => void`
|
|
612
591
|
|
|
613
592
|
Sets specific properties (like bias, squash function, or type) for all nodes within the group.
|
|
614
593
|
|
|
615
|
-
Parameters:
|
|
616
|
-
- `` - - An object containing the properties and their new values. Only provided properties are updated.
|
|
617
|
-
`bias`: Sets the bias term for all nodes.
|
|
618
|
-
`squash`: Sets the activation function (squashing function) for all nodes.
|
|
619
|
-
`type`: Sets the node type (e.g., 'input', 'hidden', 'output') for all nodes.
|
|
620
|
-
|
|
621
594
|
#### toJSON
|
|
622
595
|
|
|
623
596
|
`() => { size: number; nodeIndices: (number | undefined)[]; connections: { in: number; out: number; self: number; }; }`
|
|
@@ -670,7 +643,7 @@ Returns: An array containing the activation value of each node in the layer afte
|
|
|
670
643
|
|
|
671
644
|
#### attention
|
|
672
645
|
|
|
673
|
-
`(size: number, heads: number) => import("
|
|
646
|
+
`(size: number, heads: number) => import("src/architecture/layer").default`
|
|
674
647
|
|
|
675
648
|
Creates a multi-head self-attention layer (stub implementation).
|
|
676
649
|
|
|
@@ -682,7 +655,7 @@ Returns: A new Layer instance representing an attention layer.
|
|
|
682
655
|
|
|
683
656
|
#### batchNorm
|
|
684
657
|
|
|
685
|
-
`(size: number) => import("
|
|
658
|
+
`(size: number) => import("src/architecture/layer").default`
|
|
686
659
|
|
|
687
660
|
Creates a batch normalization layer.
|
|
688
661
|
Applies batch normalization to the activations of the nodes in this layer during activation.
|
|
@@ -701,7 +674,7 @@ This is typically done before processing a new input sequence or sample.
|
|
|
701
674
|
|
|
702
675
|
#### connect
|
|
703
676
|
|
|
704
|
-
`(target: import("
|
|
677
|
+
`(target: import("src/architecture/node").default | import("src/architecture/group").default | import("src/architecture/layer/layer.utils.types").LayerLike, method: unknown, weight: number | undefined) => import("src/architecture/connection").default[]`
|
|
705
678
|
|
|
706
679
|
Connects this layer's output to a target component (Layer, Group, or Node).
|
|
707
680
|
|
|
@@ -726,7 +699,7 @@ by the network or higher-level structures rather than directly by the layer itse
|
|
|
726
699
|
|
|
727
700
|
#### conv1d
|
|
728
701
|
|
|
729
|
-
`(size: number, kernelSize: number, stride: number, padding: number) => import("
|
|
702
|
+
`(size: number, kernelSize: number, stride: number, padding: number) => import("src/architecture/layer").default`
|
|
730
703
|
|
|
731
704
|
Creates a 1D convolutional layer (stub implementation).
|
|
732
705
|
|
|
@@ -740,7 +713,7 @@ Returns: A new Layer instance representing a 1D convolutional layer.
|
|
|
740
713
|
|
|
741
714
|
#### dense
|
|
742
715
|
|
|
743
|
-
`(size: number) => import("
|
|
716
|
+
`(size: number) => import("src/architecture/layer").default`
|
|
744
717
|
|
|
745
718
|
Creates a standard fully connected (dense) layer.
|
|
746
719
|
|
|
@@ -754,7 +727,7 @@ Returns: A new Layer instance configured as a dense layer.
|
|
|
754
727
|
|
|
755
728
|
#### disconnect
|
|
756
729
|
|
|
757
|
-
`(target: import("
|
|
730
|
+
`(target: import("src/architecture/node").default | import("src/architecture/group").default, twosided: boolean | undefined) => void`
|
|
758
731
|
|
|
759
732
|
Removes connections between this layer's nodes and a target Group or Node.
|
|
760
733
|
|
|
@@ -769,7 +742,7 @@ Layer-level dropout takes precedence over node-level dropout for nodes in this l
|
|
|
769
742
|
|
|
770
743
|
#### gate
|
|
771
744
|
|
|
772
|
-
`(connections: import("
|
|
745
|
+
`(connections: import("src/architecture/connection").default[], method: unknown) => void`
|
|
773
746
|
|
|
774
747
|
Applies gating to a set of connections originating from this layer's output group.
|
|
775
748
|
|
|
@@ -782,7 +755,7 @@ Parameters:
|
|
|
782
755
|
|
|
783
756
|
#### gru
|
|
784
757
|
|
|
785
|
-
`(size: number) => import("
|
|
758
|
+
`(size: number) => import("src/architecture/layer").default`
|
|
786
759
|
|
|
787
760
|
Creates a Gated Recurrent Unit (GRU) layer.
|
|
788
761
|
|
|
@@ -797,7 +770,7 @@ Returns: A new Layer instance configured as a GRU layer.
|
|
|
797
770
|
|
|
798
771
|
#### input
|
|
799
772
|
|
|
800
|
-
`(from: import("
|
|
773
|
+
`(from: import("src/architecture/group").default | import("src/architecture/layer/layer.utils.types").LayerLike, method: unknown, weight: number | undefined) => import("src/architecture/connection").default[]`
|
|
801
774
|
|
|
802
775
|
Handles the connection logic when this layer is the *target* of a connection.
|
|
803
776
|
|
|
@@ -814,7 +787,7 @@ Returns: An array containing the newly created connection objects.
|
|
|
814
787
|
|
|
815
788
|
#### layerNorm
|
|
816
789
|
|
|
817
|
-
`(size: number) => import("
|
|
790
|
+
`(size: number) => import("src/architecture/layer").default`
|
|
818
791
|
|
|
819
792
|
Creates a layer normalization layer.
|
|
820
793
|
Applies layer normalization to the activations of the nodes in this layer during activation.
|
|
@@ -826,7 +799,7 @@ Returns: A new Layer instance configured as a layer normalization layer.
|
|
|
826
799
|
|
|
827
800
|
#### lstm
|
|
828
801
|
|
|
829
|
-
`(size: number) => import("
|
|
802
|
+
`(size: number) => import("src/architecture/layer").default`
|
|
830
803
|
|
|
831
804
|
Creates a Long Short-Term Memory (LSTM) layer.
|
|
832
805
|
|
|
@@ -841,7 +814,7 @@ Returns: A new Layer instance configured as an LSTM layer.
|
|
|
841
814
|
|
|
842
815
|
#### memory
|
|
843
816
|
|
|
844
|
-
`(size: number, memory: number) => import("
|
|
817
|
+
`(size: number, memory: number) => import("src/architecture/layer").default`
|
|
845
818
|
|
|
846
819
|
Creates a Memory layer, designed to hold state over a fixed number of time steps.
|
|
847
820
|
|
|
@@ -901,6 +874,40 @@ Parameters:
|
|
|
901
874
|
|
|
902
875
|
### network
|
|
903
876
|
|
|
877
|
+
### resolveAcyclicEnforcement
|
|
878
|
+
|
|
879
|
+
`(options: import("src/architecture/network/network.types").NetworkConstructorOptions | undefined, topologyIntent: import("src/architecture/network/network.types").NetworkTopologyIntent) => boolean`
|
|
880
|
+
|
|
881
|
+
Resolves whether acyclic enforcement should be enabled for one constructor call.
|
|
882
|
+
|
|
883
|
+
Parameters:
|
|
884
|
+
- `options` - Optional constructor options.
|
|
885
|
+
- `topologyIntent` - Resolved public topology intent.
|
|
886
|
+
|
|
887
|
+
Returns: True when acyclic enforcement should be enabled.
|
|
888
|
+
|
|
889
|
+
### resolveTopologyIntent
|
|
890
|
+
|
|
891
|
+
`(options: import("src/architecture/network/network.types").NetworkConstructorOptions | undefined) => import("src/architecture/network/network.types").NetworkTopologyIntent`
|
|
892
|
+
|
|
893
|
+
Resolves the public topology intent for one constructor call.
|
|
894
|
+
|
|
895
|
+
Parameters:
|
|
896
|
+
- `options` - Optional constructor options.
|
|
897
|
+
|
|
898
|
+
Returns: Resolved topology intent.
|
|
899
|
+
|
|
900
|
+
### validateTopologyIntentConfiguration
|
|
901
|
+
|
|
902
|
+
`(options: import("src/architecture/network/network.types").NetworkConstructorOptions | undefined) => void`
|
|
903
|
+
|
|
904
|
+
Validates that legacy acyclic flags do not contradict public topology intent.
|
|
905
|
+
|
|
906
|
+
Parameters:
|
|
907
|
+
- `options` - Optional constructor options.
|
|
908
|
+
|
|
909
|
+
Returns: Nothing.
|
|
910
|
+
|
|
904
911
|
### default
|
|
905
912
|
|
|
906
913
|
#### _accumulationReduction
|
|
@@ -1023,7 +1030,7 @@ Whether to apply separate bias clipping.
|
|
|
1023
1030
|
|
|
1024
1031
|
#### _hasPath
|
|
1025
1032
|
|
|
1026
|
-
`(from: import("
|
|
1033
|
+
`(from: import("src/architecture/node").default, to: import("src/architecture/node").default) => boolean`
|
|
1027
1034
|
|
|
1028
1035
|
Check whether a directed path exists between two nodes.
|
|
1029
1036
|
|
|
@@ -1134,6 +1141,10 @@ Dynamic stochastic depth schedule.
|
|
|
1134
1141
|
|
|
1135
1142
|
Topology dirty marker.
|
|
1136
1143
|
|
|
1144
|
+
#### _topologyIntent
|
|
1145
|
+
|
|
1146
|
+
Public topology intent used to preserve semantic API choices.
|
|
1147
|
+
|
|
1137
1148
|
#### _topoOrder
|
|
1138
1149
|
|
|
1139
1150
|
Cached topological order.
|
|
@@ -1169,11 +1180,6 @@ Original weights captured for weight-noise recovery.
|
|
|
1169
1180
|
Activates the network using the given input array.
|
|
1170
1181
|
Performs a forward pass through the network, calculating the activation of each node.
|
|
1171
1182
|
|
|
1172
|
-
Parameters:
|
|
1173
|
-
- `` - - An array of numerical values corresponding to the network's input nodes.
|
|
1174
|
-
- `` - - Flag indicating if the activation is part of a training process.
|
|
1175
|
-
- `` - - Maximum allowed activation depth to prevent infinite loops/cycles.
|
|
1176
|
-
|
|
1177
1183
|
Returns: An array of numerical values representing the activations of the network's output nodes.
|
|
1178
1184
|
|
|
1179
1185
|
#### activateBatch
|
|
@@ -1194,7 +1200,7 @@ Returns: Array of output vectors, each length equals this.output
|
|
|
1194
1200
|
|
|
1195
1201
|
#### activateRaw
|
|
1196
1202
|
|
|
1197
|
-
`(input: number[], training: boolean, maxActivationDepth: number) => import("
|
|
1203
|
+
`(input: number[], training: boolean, maxActivationDepth: number) => import("src/architecture/activationArrayPool").ActivationArray`
|
|
1198
1204
|
|
|
1199
1205
|
Raw activation that can return a typed array when pooling is enabled (zero-copy).
|
|
1200
1206
|
If reuseActivationArrays=false falls back to standard activate().
|
|
@@ -1240,7 +1246,7 @@ Clear the dynamic global weight-noise schedule.
|
|
|
1240
1246
|
|
|
1241
1247
|
#### clone
|
|
1242
1248
|
|
|
1243
|
-
`() => import("
|
|
1249
|
+
`() => import("src/architecture/network").default`
|
|
1244
1250
|
|
|
1245
1251
|
Creates a deep copy of the network.
|
|
1246
1252
|
|
|
@@ -1257,17 +1263,12 @@ Parameters:
|
|
|
1257
1263
|
|
|
1258
1264
|
#### connect
|
|
1259
1265
|
|
|
1260
|
-
`(from: import("
|
|
1266
|
+
`(from: import("src/architecture/node").default, to: import("src/architecture/node").default, weight: number | undefined) => import("src/architecture/connection").default[]`
|
|
1261
1267
|
|
|
1262
1268
|
Creates a connection between two nodes in the network.
|
|
1263
1269
|
Handles both regular connections and self-connections.
|
|
1264
1270
|
Adds the new connection object(s) to the appropriate network list (`connections` or `selfconns`).
|
|
1265
1271
|
|
|
1266
|
-
Parameters:
|
|
1267
|
-
- `` - - The source node of the connection.
|
|
1268
|
-
- `` - - The target node of the connection.
|
|
1269
|
-
- `` - - Optional weight for the connection. If not provided, a random weight is usually assigned by the underlying `Node.connect` method.
|
|
1270
|
-
|
|
1271
1272
|
Returns: An array containing the newly created connection object(s). Typically contains one connection, but might be empty or contain more in specialized node types.
|
|
1272
1273
|
|
|
1273
1274
|
#### connections
|
|
@@ -1276,20 +1277,15 @@ Connection list.
|
|
|
1276
1277
|
|
|
1277
1278
|
#### createMLP
|
|
1278
1279
|
|
|
1279
|
-
`(inputCount: number, hiddenCounts: number[], outputCount: number) => import("
|
|
1280
|
+
`(inputCount: number, hiddenCounts: number[], outputCount: number) => import("src/architecture/network").default`
|
|
1280
1281
|
|
|
1281
1282
|
Creates a fully connected, strictly layered MLP network.
|
|
1282
1283
|
|
|
1283
|
-
Parameters:
|
|
1284
|
-
- `` - - Number of input nodes
|
|
1285
|
-
- `` - - Array of hidden layer sizes (e.g. [2,3] for two hidden layers)
|
|
1286
|
-
- `` - - Number of output nodes
|
|
1287
|
-
|
|
1288
1284
|
Returns: A new, fully connected, layered MLP
|
|
1289
1285
|
|
|
1290
1286
|
#### crossOver
|
|
1291
1287
|
|
|
1292
|
-
`(network1: import("
|
|
1288
|
+
`(network1: import("src/architecture/network").default, network2: import("src/architecture/network").default, equal: boolean) => import("src/architecture/network").default`
|
|
1293
1289
|
|
|
1294
1290
|
Creates a new offspring network by performing crossover between two parent networks.
|
|
1295
1291
|
This method implements the crossover mechanism inspired by the NEAT algorithm and described
|
|
@@ -1297,17 +1293,11 @@ in the Instinct paper, combining genes (nodes and connections) from both parents
|
|
|
1297
1293
|
Fitness scores can influence the inheritance process. Matching genes are inherited randomly,
|
|
1298
1294
|
while disjoint/excess genes are typically inherited from the fitter parent (or randomly if fitness is equal or `equal` flag is set).
|
|
1299
1295
|
|
|
1300
|
-
Parameters:
|
|
1301
|
-
- `` - - The first parent network.
|
|
1302
|
-
- `` - - The second parent network.
|
|
1303
|
-
- `` - - If true, disjoint and excess genes are inherited randomly regardless of fitness.
|
|
1304
|
-
If false (default), they are inherited from the fitter parent.
|
|
1305
|
-
|
|
1306
1296
|
Returns: A new Network instance representing the offspring.
|
|
1307
1297
|
|
|
1308
1298
|
#### describeArchitecture
|
|
1309
1299
|
|
|
1310
|
-
`() => import("
|
|
1300
|
+
`() => import("src/architecture/network/network.types").NetworkArchitectureDescriptor`
|
|
1311
1301
|
|
|
1312
1302
|
Resolves a stable architecture descriptor for telemetry/UI consumers.
|
|
1313
1303
|
|
|
@@ -1318,17 +1308,11 @@ Returns: Architecture descriptor with hidden-layer widths and provenance.
|
|
|
1318
1308
|
|
|
1319
1309
|
#### deserialize
|
|
1320
1310
|
|
|
1321
|
-
`(data: [number[], number[], string[], { from: number; to: number; weight: number; gater: number | null; }[], number, number] | unknown[], inputSize: number | undefined, outputSize: number | undefined) => import("
|
|
1311
|
+
`(data: [number[], number[], string[], { from: number; to: number; weight: number; gater: number | null; }[], number, number] | unknown[], inputSize: number | undefined, outputSize: number | undefined) => import("src/architecture/network").default`
|
|
1322
1312
|
|
|
1323
1313
|
Creates a Network instance from serialized data produced by `serialize()`.
|
|
1324
1314
|
Reconstructs the network structure and state based on the provided arrays.
|
|
1325
1315
|
|
|
1326
|
-
Parameters:
|
|
1327
|
-
- `` - - The serialized network data array, typically obtained from `network.serialize()`.
|
|
1328
|
-
Expected format: `[activations, states, squashNames, connectionData, inputSize, outputSize]`.
|
|
1329
|
-
- `` - - Optional input size override.
|
|
1330
|
-
- `` - - Optional output size override.
|
|
1331
|
-
|
|
1332
1316
|
Returns: A new Network instance reconstructed from the serialized data.
|
|
1333
1317
|
|
|
1334
1318
|
#### disableDropConnect
|
|
@@ -1351,16 +1335,12 @@ Disable all weight-noise settings.
|
|
|
1351
1335
|
|
|
1352
1336
|
#### disconnect
|
|
1353
1337
|
|
|
1354
|
-
`(from: import("
|
|
1338
|
+
`(from: import("src/architecture/node").default, to: import("src/architecture/node").default) => void`
|
|
1355
1339
|
|
|
1356
1340
|
Disconnects two nodes, removing the connection between them.
|
|
1357
1341
|
Handles both regular connections and self-connections.
|
|
1358
1342
|
If the connection being removed was gated, it is also ungated.
|
|
1359
1343
|
|
|
1360
|
-
Parameters:
|
|
1361
|
-
- `` - - The source node of the connection to remove.
|
|
1362
|
-
- `` - - The target node of the connection to remove.
|
|
1363
|
-
|
|
1364
1344
|
#### dropout
|
|
1365
1345
|
|
|
1366
1346
|
Dropout probability.
|
|
@@ -1396,35 +1376,28 @@ Returns: Activation output.
|
|
|
1396
1376
|
|
|
1397
1377
|
#### fromJSON
|
|
1398
1378
|
|
|
1399
|
-
`(json: Record<string, unknown>) => import("
|
|
1379
|
+
`(json: Record<string, unknown>) => import("src/architecture/network").default`
|
|
1400
1380
|
|
|
1401
1381
|
Reconstructs a network from a JSON object (latest standard).
|
|
1402
1382
|
Handles formatVersion, robust error handling, and index-based references.
|
|
1403
1383
|
|
|
1404
|
-
Parameters:
|
|
1405
|
-
- `` - - The JSON object representing the network.
|
|
1406
|
-
|
|
1407
1384
|
Returns: The reconstructed network.
|
|
1408
1385
|
|
|
1409
1386
|
#### gate
|
|
1410
1387
|
|
|
1411
|
-
`(node: import("
|
|
1388
|
+
`(node: import("src/architecture/node").default, connection: import("src/architecture/connection").default) => void`
|
|
1412
1389
|
|
|
1413
1390
|
Gates a connection with a specified node.
|
|
1414
1391
|
The activation of the `node` (gater) will modulate the weight of the `connection`.
|
|
1415
1392
|
Adds the connection to the network's `gates` list.
|
|
1416
1393
|
|
|
1417
|
-
Parameters:
|
|
1418
|
-
- `` - - The node that will act as the gater. Must be part of this network.
|
|
1419
|
-
- `` - - The connection to be gated.
|
|
1420
|
-
|
|
1421
1394
|
#### gates
|
|
1422
1395
|
|
|
1423
1396
|
Network gates collection.
|
|
1424
1397
|
|
|
1425
1398
|
#### getConnectionSlab
|
|
1426
1399
|
|
|
1427
|
-
`() => import("
|
|
1400
|
+
`() => import("src/architecture/network/slab/network.slab.utils.types").ConnectionSlabView`
|
|
1428
1401
|
|
|
1429
1402
|
Read slab structures for fast activation.
|
|
1430
1403
|
|
|
@@ -1472,6 +1445,14 @@ Read the raw deterministic RNG state word.
|
|
|
1472
1445
|
|
|
1473
1446
|
Returns: RNG state value when present.
|
|
1474
1447
|
|
|
1448
|
+
#### getTopologyIntent
|
|
1449
|
+
|
|
1450
|
+
`() => import("src/architecture/network/network.types").NetworkTopologyIntent`
|
|
1451
|
+
|
|
1452
|
+
Returns the public topology intent for this network.
|
|
1453
|
+
|
|
1454
|
+
Returns: Current topology intent.
|
|
1455
|
+
|
|
1475
1456
|
#### getTrainingStats
|
|
1476
1457
|
|
|
1477
1458
|
`() => { gradNorm: number; gradNormRaw: number; lossScale: number; optimizerStep: number; mp: { good: number; bad: number; overflowCount: number; scaleUps: number; scaleDowns: number; lastOverflowStep: number; }; }`
|
|
@@ -1492,7 +1473,7 @@ Optional layered view cache.
|
|
|
1492
1473
|
|
|
1493
1474
|
#### mutate
|
|
1494
1475
|
|
|
1495
|
-
`(method: import("
|
|
1476
|
+
`(method: import("src/architecture/network/network.types").MutationMethod) => void`
|
|
1496
1477
|
|
|
1497
1478
|
Mutates the network's structure or parameters according to the specified method.
|
|
1498
1479
|
This is a core operation for neuro-evolutionary algorithms (like NEAT).
|
|
@@ -1514,10 +1495,6 @@ Activates the network without calculating eligibility traces.
|
|
|
1514
1495
|
This is a performance optimization for scenarios where backpropagation is not needed,
|
|
1515
1496
|
such as during testing, evaluation, or deployment (inference).
|
|
1516
1497
|
|
|
1517
|
-
Parameters:
|
|
1518
|
-
- `` - - An array of numerical values corresponding to the network's input nodes.
|
|
1519
|
-
The length must match the network's `input` size.
|
|
1520
|
-
|
|
1521
1498
|
Returns: An array of numerical values representing the activations of the network's output nodes.
|
|
1522
1499
|
|
|
1523
1500
|
#### output
|
|
@@ -1535,15 +1512,6 @@ learning rate, momentum, and optional L2 regularization.
|
|
|
1535
1512
|
|
|
1536
1513
|
The process starts from the output nodes and moves backward layer by layer (or topologically for recurrent nets).
|
|
1537
1514
|
|
|
1538
|
-
Parameters:
|
|
1539
|
-
- `` - - The learning rate (controls the step size of weight adjustments).
|
|
1540
|
-
- `` - - The momentum factor (helps overcome local minima and speeds up convergence). Typically between 0 and 1.
|
|
1541
|
-
- `` - - If true, apply the calculated weight and bias updates. If false, only calculate gradients (e.g., for batch accumulation).
|
|
1542
|
-
- `` - - An array of target values corresponding to the network's output nodes.
|
|
1543
|
-
The length must match the network's `output` size.
|
|
1544
|
-
- `` - - The L2 regularization factor (lambda). Helps prevent overfitting by penalizing large weights.
|
|
1545
|
-
- `` - - Optional derivative of the cost function for output nodes.
|
|
1546
|
-
|
|
1547
1515
|
#### pruneToSparsity
|
|
1548
1516
|
|
|
1549
1517
|
`(targetSparsity: number, method: "magnitude" | "snip") => void`
|
|
@@ -1557,15 +1525,12 @@ Parameters:
|
|
|
1557
1525
|
|
|
1558
1526
|
#### rebuildConnections
|
|
1559
1527
|
|
|
1560
|
-
`(net: import("
|
|
1528
|
+
`(net: import("src/architecture/network").default) => void`
|
|
1561
1529
|
|
|
1562
1530
|
Rebuilds the network's connections array from all per-node connections.
|
|
1563
1531
|
This ensures that the network.connections array is consistent with the actual
|
|
1564
1532
|
outgoing connections of all nodes. Useful after manual wiring or node manipulation.
|
|
1565
1533
|
|
|
1566
|
-
Parameters:
|
|
1567
|
-
- `` - - The network instance to rebuild connections for.
|
|
1568
|
-
|
|
1569
1534
|
Returns: Example usage:
|
|
1570
1535
|
Network.rebuildConnections(net);
|
|
1571
1536
|
|
|
@@ -1582,7 +1547,7 @@ Returns: Slab rebuild result.
|
|
|
1582
1547
|
|
|
1583
1548
|
#### remove
|
|
1584
1549
|
|
|
1585
|
-
`(node: import("
|
|
1550
|
+
`(node: import("src/architecture/node").default) => void`
|
|
1586
1551
|
|
|
1587
1552
|
Removes a node from the network.
|
|
1588
1553
|
This involves:
|
|
@@ -1594,9 +1559,6 @@ This involves:
|
|
|
1594
1559
|
5. Handling gates involving the removed node (ungating connections gated *by* this node,
|
|
1595
1560
|
and potentially re-gating connections that were gated *by other nodes* onto the removed node's connections).
|
|
1596
1561
|
|
|
1597
|
-
Parameters:
|
|
1598
|
-
- `` - - The node instance to remove. Must exist within the network's `nodes` list.
|
|
1599
|
-
|
|
1600
1562
|
#### resetDropoutMasks
|
|
1601
1563
|
|
|
1602
1564
|
`() => void`
|
|
@@ -1623,7 +1585,7 @@ Self-connection list.
|
|
|
1623
1585
|
|
|
1624
1586
|
#### serialize
|
|
1625
1587
|
|
|
1626
|
-
`() => [number[], number[], string[], import("
|
|
1588
|
+
`() => [number[], number[], string[], import("src/architecture/network/network.types").SerializedConnection[], number, number]`
|
|
1627
1589
|
|
|
1628
1590
|
Lightweight tuple serializer delegating to network.serialize.ts
|
|
1629
1591
|
|
|
@@ -1634,9 +1596,6 @@ Lightweight tuple serializer delegating to network.serialize.ts
|
|
|
1634
1596
|
Sets specified properties (e.g., bias, squash function) for all nodes in the network.
|
|
1635
1597
|
Useful for initializing or resetting node properties uniformly.
|
|
1636
1598
|
|
|
1637
|
-
Parameters:
|
|
1638
|
-
- `` - - An object containing the properties and values to set.
|
|
1639
|
-
|
|
1640
1599
|
#### setEnforceAcyclic
|
|
1641
1600
|
|
|
1642
1601
|
`(flag: boolean) => void`
|
|
@@ -1691,6 +1650,17 @@ Set stochastic-depth schedule function.
|
|
|
1691
1650
|
Parameters:
|
|
1692
1651
|
- `fn` - Function mapping step and current schedule to next schedule.
|
|
1693
1652
|
|
|
1653
|
+
#### setTopologyIntent
|
|
1654
|
+
|
|
1655
|
+
`(topologyIntent: import("src/architecture/network/network.types").NetworkTopologyIntent) => void`
|
|
1656
|
+
|
|
1657
|
+
Sets the public topology intent and keeps acyclic enforcement aligned.
|
|
1658
|
+
|
|
1659
|
+
Parameters:
|
|
1660
|
+
- `topologyIntent` - Desired topology intent.
|
|
1661
|
+
|
|
1662
|
+
Returns: Nothing.
|
|
1663
|
+
|
|
1694
1664
|
#### setWeightNoiseSchedule
|
|
1695
1665
|
|
|
1696
1666
|
`(fn: (step: number) => number) => void`
|
|
@@ -1702,7 +1672,7 @@ Parameters:
|
|
|
1702
1672
|
|
|
1703
1673
|
#### snapshotRNG
|
|
1704
1674
|
|
|
1705
|
-
`() => import("
|
|
1675
|
+
`() => import("src/architecture/network/network.types").RNGSnapshot`
|
|
1706
1676
|
|
|
1707
1677
|
Snapshot deterministic RNG runtime state.
|
|
1708
1678
|
|
|
@@ -1717,10 +1687,6 @@ Calculates the average error over the dataset using a specified cost function.
|
|
|
1717
1687
|
Uses `noTraceActivate` for efficiency as gradients are not needed.
|
|
1718
1688
|
Handles dropout scaling if dropout was used during training.
|
|
1719
1689
|
|
|
1720
|
-
Parameters:
|
|
1721
|
-
- `` - - The test dataset, an array of objects with `input` and `output` arrays.
|
|
1722
|
-
- `` - - The cost function to evaluate the error. Defaults to Mean Squared Error.
|
|
1723
|
-
|
|
1724
1690
|
Returns: An object containing the calculated average error over the dataset and the time taken for the test in milliseconds.
|
|
1725
1691
|
|
|
1726
1692
|
#### testForceOverflow
|
|
@@ -1741,7 +1707,7 @@ Returns: A JSON-compatible object representing the network.
|
|
|
1741
1707
|
|
|
1742
1708
|
#### toONNX
|
|
1743
1709
|
|
|
1744
|
-
`() => import("
|
|
1710
|
+
`() => import("src/architecture/network/onnx/network.onnx.utils.types").OnnxModel`
|
|
1745
1711
|
|
|
1746
1712
|
Exports the network to ONNX format (JSON object, minimal MLP support).
|
|
1747
1713
|
Only standard feedforward architectures and standard activations are supported.
|
|
@@ -1755,15 +1721,12 @@ Current training step counter.
|
|
|
1755
1721
|
|
|
1756
1722
|
#### ungate
|
|
1757
1723
|
|
|
1758
|
-
`(connection: import("
|
|
1724
|
+
`(connection: import("src/architecture/connection").default) => void`
|
|
1759
1725
|
|
|
1760
1726
|
Removes the gate from a specified connection.
|
|
1761
1727
|
The connection will no longer be modulated by its gater node.
|
|
1762
1728
|
Removes the connection from the network's `gates` list.
|
|
1763
1729
|
|
|
1764
|
-
Parameters:
|
|
1765
|
-
- `` - - The connection object to ungate.
|
|
1766
|
-
|
|
1767
1730
|
## architecture/nodePool.ts
|
|
1768
1731
|
|
|
1769
1732
|
### nodePool
|
|
@@ -1788,7 +1751,7 @@ Deferred (Phase 3+): preWarm(count), adaptive trim(), leak pattern heuristics, s
|
|
|
1788
1751
|
|
|
1789
1752
|
### acquireNode
|
|
1790
1753
|
|
|
1791
|
-
`(opts: import("
|
|
1754
|
+
`(opts: import("src/architecture/nodePool").AcquireNodeOptions) => import("src/architecture/node").default`
|
|
1792
1755
|
|
|
1793
1756
|
### AcquireNodeOptions
|
|
1794
1757
|
|
|
@@ -1800,7 +1763,7 @@ Options bag for acquiring a node.
|
|
|
1800
1763
|
|
|
1801
1764
|
### releaseNode
|
|
1802
1765
|
|
|
1803
|
-
`(node: import("
|
|
1766
|
+
`(node: import("src/architecture/node").default) => void`
|
|
1804
1767
|
|
|
1805
1768
|
### resetNodePool
|
|
1806
1769
|
|
|
@@ -1836,7 +1799,7 @@ connection strategies from `methods.groupConnection`.
|
|
|
1836
1799
|
|
|
1837
1800
|
#### construct
|
|
1838
1801
|
|
|
1839
|
-
`(list: (import("
|
|
1802
|
+
`(list: (import("src/architecture/node").default | import("src/architecture/layer").default | import("src/architecture/group").default)[]) => import("src/architecture/network").default`
|
|
1840
1803
|
|
|
1841
1804
|
Constructs a Network instance from an array of interconnected Layers, Groups, or Nodes.
|
|
1842
1805
|
|
|
@@ -1845,101 +1808,77 @@ gates, and self-connections, and determines the network's input and output sizes
|
|
|
1845
1808
|
on the `type` property ('input' or 'output') set on the nodes. It uses Sets internally
|
|
1846
1809
|
for efficient handling of unique elements during construction.
|
|
1847
1810
|
|
|
1848
|
-
Parameters:
|
|
1849
|
-
- `` - - An array containing the building blocks (Nodes, Layers, Groups) of the network, assumed to be already interconnected.
|
|
1850
|
-
|
|
1851
1811
|
Returns: A Network object representing the constructed architecture.
|
|
1852
1812
|
|
|
1853
1813
|
#### enforceMinimumHiddenLayerSizes
|
|
1854
1814
|
|
|
1855
|
-
`(network: import("
|
|
1815
|
+
`(network: import("src/architecture/network").default) => import("src/architecture/network").default`
|
|
1856
1816
|
|
|
1857
1817
|
Enforces the minimum hidden layer size rule on a network.
|
|
1858
1818
|
|
|
1859
1819
|
This ensures that all hidden layers have at least min(input, output) + 1 nodes,
|
|
1860
1820
|
which is a common heuristic to ensure networks have adequate representation capacity.
|
|
1861
1821
|
|
|
1862
|
-
Parameters:
|
|
1863
|
-
- `` - - The network to enforce minimum hidden layer sizes on
|
|
1864
|
-
|
|
1865
1822
|
Returns: The same network with properly sized hidden layers
|
|
1866
1823
|
|
|
1867
1824
|
#### gru
|
|
1868
1825
|
|
|
1869
|
-
`(layers: number[]) => import("
|
|
1826
|
+
`(layers: number[]) => import("src/architecture/network").default`
|
|
1870
1827
|
|
|
1871
1828
|
Creates a Gated Recurrent Unit (GRU) network.
|
|
1872
1829
|
GRUs are another type of recurrent neural network, similar to LSTMs but often simpler.
|
|
1873
1830
|
This constructor uses `Layer.gru` to create the core GRU blocks.
|
|
1874
1831
|
|
|
1875
|
-
Parameters:
|
|
1876
|
-
- `` - - A sequence of numbers representing the size (number of units) of each layer: input layer size, hidden GRU layer sizes..., output layer size. Must include at least input, one hidden, and output layer sizes.
|
|
1877
|
-
|
|
1878
1832
|
Returns: The constructed GRU network.
|
|
1879
1833
|
|
|
1880
1834
|
#### hopfield
|
|
1881
1835
|
|
|
1882
|
-
`(size: number) => import("
|
|
1836
|
+
`(size: number) => import("src/architecture/network").default`
|
|
1883
1837
|
|
|
1884
1838
|
Creates a Hopfield network.
|
|
1885
1839
|
Hopfield networks are a form of recurrent neural network often used for associative memory tasks.
|
|
1886
1840
|
This implementation creates a simple, fully connected structure.
|
|
1887
1841
|
|
|
1888
|
-
Parameters:
|
|
1889
|
-
- `` - - The number of nodes in the network (input and output layers will have this size).
|
|
1890
|
-
|
|
1891
1842
|
Returns: The constructed Hopfield network.
|
|
1892
1843
|
|
|
1893
1844
|
#### lstm
|
|
1894
1845
|
|
|
1895
|
-
`(layerArgs: (number | { inputToOutput?: boolean | undefined; })[]) => import("
|
|
1846
|
+
`(layerArgs: (number | { inputToOutput?: boolean | undefined; })[]) => import("src/architecture/network").default`
|
|
1896
1847
|
|
|
1897
1848
|
Creates a Long Short-Term Memory (LSTM) network.
|
|
1898
1849
|
LSTMs are a type of recurrent neural network (RNN) capable of learning long-range dependencies.
|
|
1899
1850
|
This constructor uses `Layer.lstm` to create the core LSTM blocks.
|
|
1900
1851
|
|
|
1901
|
-
Parameters:
|
|
1902
|
-
- `` - - A sequence of arguments defining the network structure:
|
|
1903
|
-
- Numbers represent the size (number of units) of each layer: input layer size, hidden LSTM layer sizes..., output layer size.
|
|
1904
|
-
- An optional configuration object can be provided as the last argument.
|
|
1905
|
-
- `` - - Configuration options (if passed as the last argument).
|
|
1906
|
-
|
|
1907
1852
|
Returns: The constructed LSTM network.
|
|
1908
1853
|
|
|
1909
1854
|
#### narx
|
|
1910
1855
|
|
|
1911
|
-
`(inputSize: number, hiddenLayers: number | number[], outputSize: number, previousInput: number, previousOutput: number) => import("
|
|
1856
|
+
`(inputSize: number, hiddenLayers: number | number[], outputSize: number, previousInput: number, previousOutput: number) => import("src/architecture/network").default`
|
|
1912
1857
|
|
|
1913
1858
|
Creates a Nonlinear AutoRegressive network with eXogenous inputs (NARX).
|
|
1914
1859
|
NARX networks are recurrent networks often used for time series prediction.
|
|
1915
1860
|
They predict the next value of a time series based on previous values of the series
|
|
1916
1861
|
and previous values of external (exogenous) input series.
|
|
1917
1862
|
|
|
1918
|
-
Parameters:
|
|
1919
|
-
- `` - - The number of input nodes for the exogenous inputs at each time step.
|
|
1920
|
-
- `` - - The size of the hidden layer(s). Can be a single number for one hidden layer, or an array of numbers for multiple hidden layers. Use 0 or [] for no hidden layers.
|
|
1921
|
-
- `` - - The number of output nodes (predicting the time series).
|
|
1922
|
-
- `` - - The number of past time steps of the exogenous input to feed back into the network.
|
|
1923
|
-
- `` - - The number of past time steps of the network's own output to feed back into the network (autoregressive part).
|
|
1924
|
-
|
|
1925
1863
|
Returns: The constructed NARX network.
|
|
1926
1864
|
|
|
1927
1865
|
#### perceptron
|
|
1928
1866
|
|
|
1929
|
-
`(layers: number[]) => import("
|
|
1867
|
+
`(layers: number[]) => import("src/architecture/network").default`
|
|
1930
1868
|
|
|
1931
1869
|
Creates a standard Multi-Layer Perceptron (MLP) network.
|
|
1932
1870
|
An MLP consists of an input layer, one or more hidden layers, and an output layer,
|
|
1933
1871
|
fully connected layer by layer.
|
|
1934
1872
|
|
|
1935
|
-
|
|
1936
|
-
|
|
1873
|
+
The returned network is marked with the public `feed-forward` topology
|
|
1874
|
+
intent so acyclic enforcement and slab fast-path eligibility stay aligned
|
|
1875
|
+
with the builder users already chose.
|
|
1937
1876
|
|
|
1938
1877
|
Returns: The constructed MLP network.
|
|
1939
1878
|
|
|
1940
1879
|
#### random
|
|
1941
1880
|
|
|
1942
|
-
`(input: number, hidden: number, output: number, options: { connections?: number | undefined; backconnections?: number | undefined; selfconnections?: number | undefined; gates?: number | undefined; }) => import("
|
|
1881
|
+
`(input: number, hidden: number, output: number, options: { connections?: number | undefined; backconnections?: number | undefined; selfconnections?: number | undefined; gates?: number | undefined; }) => import("src/architecture/network").default`
|
|
1943
1882
|
|
|
1944
1883
|
Creates a randomly structured network based on specified node counts and connection options.
|
|
1945
1884
|
|
|
@@ -1948,12 +1887,6 @@ It initializes a network with input and output nodes and then iteratively adds h
|
|
|
1948
1887
|
and various types of connections (forward, backward, self) and gates using mutation methods.
|
|
1949
1888
|
This approach is inspired by neuro-evolution techniques where network topology evolves.
|
|
1950
1889
|
|
|
1951
|
-
Parameters:
|
|
1952
|
-
- `` - - The number of input nodes.
|
|
1953
|
-
- `` - - The number of hidden nodes to add.
|
|
1954
|
-
- `` - - The number of output nodes.
|
|
1955
|
-
- `` - - Optional configuration for the network structure.
|
|
1956
|
-
|
|
1957
1890
|
Returns: The constructed network with a randomized topology.
|
|
1958
1891
|
|
|
1959
1892
|
## architecture/connection.ts
|
|
@@ -1990,7 +1923,7 @@ bits4+ reserved.
|
|
|
1990
1923
|
|
|
1991
1924
|
#### acquire
|
|
1992
1925
|
|
|
1993
|
-
`(from: import("
|
|
1926
|
+
`(from: import("src/architecture/node").default, to: import("src/architecture/node").default, weight: number | undefined) => import("src/architecture/connection").default`
|
|
1994
1927
|
|
|
1995
1928
|
Acquire a `Connection` from the pool (or construct new). Fields are fully reset & given
|
|
1996
1929
|
a fresh sequential `innovation` id. Prefer this in evolutionary algorithms that mutate
|
|
@@ -2091,7 +2024,7 @@ Last applied delta weight (used by classic momentum).
|
|
|
2091
2024
|
|
|
2092
2025
|
#### release
|
|
2093
2026
|
|
|
2094
|
-
`(conn: import("
|
|
2027
|
+
`(conn: import("src/architecture/connection").default) => void`
|
|
2095
2028
|
|
|
2096
2029
|
Return a `Connection` to the internal pool for later reuse. Do NOT use the instance again
|
|
2097
2030
|
afterward unless re-acquired (treat as surrendered). Optimizer / trace fields are not
|