@reicek/neataptic-ts 0.1.16 → 0.1.19
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/copilot-instructions.md +111 -0
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/deploy-pages.yml +1 -7
- package/.github/workflows/manual_release_pipeline.yml +1 -1
- package/.github/workflows/publish.yml +3 -3
- package/.github/workflows/release_dispatch.yml +1 -1
- package/LICENSE +1 -1
- package/package.json +1 -1
- package/plans/HyperEvoDevoMorphoNEAT.md +587 -0
- package/plans/Memory_Optimization.md +158 -64
- package/plans/ONNX_EXPORT_PLAN.md +11 -32
- package/plans/neat.plans.md +317 -0
- package/plans/network-main-utils-split.md +29 -0
- package/scripts/generate-docs.ts +76 -5
- package/src/README.md +844 -790
- package/src/architecture/README.md +1123 -559
- package/src/architecture/architect.ts +15 -15
- package/src/architecture/connection.ts +14 -14
- package/src/architecture/group.ts +7 -7
- package/src/architecture/layer/README.md +1295 -0
- package/src/architecture/layer/layer.activation.utils.ts +206 -0
- package/src/architecture/layer/layer.connection.utils.ts +343 -0
- package/src/architecture/layer/layer.factory.core.utils.ts +58 -0
- package/src/architecture/layer/layer.factory.experimental.utils.ts +210 -0
- package/src/architecture/layer/layer.factory.normalization.utils.ts +188 -0
- package/src/architecture/layer/layer.factory.recurrent.utils.ts +814 -0
- package/src/architecture/layer/layer.guard.utils.ts +29 -0
- package/src/architecture/layer/layer.propagation.utils.ts +96 -0
- package/src/architecture/layer/layer.utils.ts +418 -0
- package/src/architecture/layer/layer.utils.types.ts +140 -0
- package/src/architecture/layer.ts +196 -548
- package/src/architecture/network/README.md +1642 -819
- package/src/architecture/network/activate/README.md +1235 -0
- package/src/architecture/network/activate/network.activate.batch.utils.ts +132 -0
- package/src/architecture/network/activate/network.activate.contexts.utils.ts +80 -0
- package/src/architecture/network/activate/network.activate.core.utils.ts +1260 -0
- package/src/architecture/network/activate/network.activate.helpers.utils.ts +8 -0
- package/src/architecture/network/activate/network.activate.notrace.traversal.utils.ts +121 -0
- package/src/architecture/network/activate/network.activate.notrace.utils.ts +178 -0
- package/src/architecture/network/activate/network.activate.raw.utils.ts +49 -0
- package/src/architecture/network/activate/network.activate.utils.ts +124 -0
- package/src/architecture/network/activate/network.activate.utils.types.ts +172 -0
- package/src/architecture/network/connect/README.md +223 -0
- package/src/architecture/network/connect/network.connect.create.utils.ts +108 -0
- package/src/architecture/network/connect/network.connect.remove.utils.ts +107 -0
- package/src/architecture/network/connect/network.connect.utils.ts +130 -0
- package/src/architecture/network/connect/network.connect.utils.types.ts +6 -0
- package/src/architecture/network/deterministic/README.md +323 -0
- package/src/architecture/network/deterministic/network.deterministic.lifecycle.utils.ts +60 -0
- package/src/architecture/network/deterministic/network.deterministic.setup.utils.ts +123 -0
- package/src/architecture/network/deterministic/network.deterministic.state.utils.ts +61 -0
- package/src/architecture/network/deterministic/network.deterministic.utils.ts +155 -0
- package/src/architecture/network/deterministic/network.deterministic.utils.types.ts +21 -0
- package/src/architecture/network/evolve/README.md +650 -0
- package/src/architecture/network/evolve/network.evolve.finalize.utils.ts +65 -0
- package/src/architecture/network/evolve/network.evolve.fitness.utils.ts +568 -0
- package/src/architecture/network/evolve/network.evolve.loop.utils.ts +230 -0
- package/src/architecture/network/evolve/network.evolve.setup.utils.ts +270 -0
- package/src/architecture/network/evolve/network.evolve.utils.ts +99 -0
- package/src/architecture/network/evolve/network.evolve.utils.types.ts +84 -0
- package/src/architecture/network/gating/README.md +329 -0
- package/src/architecture/network/gating/network.gating.gate.utils.ts +107 -0
- package/src/architecture/network/gating/network.gating.remove.utils.ts +272 -0
- package/src/architecture/network/gating/network.gating.utils.ts +143 -0
- package/src/architecture/network/gating/network.gating.utils.types.ts +31 -0
- package/src/architecture/network/genetic/README.md +677 -0
- package/src/architecture/network/genetic/network.genetic.materialize.utils.ts +286 -0
- package/src/architecture/network/genetic/network.genetic.selection.utils.ts +417 -0
- package/src/architecture/network/genetic/network.genetic.setup.utils.ts +487 -0
- package/src/architecture/network/genetic/network.genetic.utils.ts +107 -0
- package/src/architecture/network/genetic/network.genetic.utils.types.ts +30 -0
- package/src/architecture/network/mutate/README.md +1473 -0
- package/src/architecture/network/mutate/network.mutate.dispatch.utils.ts +122 -0
- package/src/architecture/network/mutate/network.mutate.handlers.utils.ts +2169 -0
- package/src/architecture/network/mutate/network.mutate.utils.ts +116 -0
- package/src/architecture/network/mutate/network.mutate.utils.types.ts +118 -0
- package/src/architecture/network/network.types.ts +1572 -0
- package/src/architecture/network/network.utils.ts +97 -0
- package/src/architecture/network/onnx/README.md +3950 -0
- package/src/architecture/network/onnx/network.onnx.export-build.utils.ts +319 -0
- package/src/architecture/network/onnx/network.onnx.export-conv.utils.ts +674 -0
- package/src/architecture/network/onnx/network.onnx.export-dense.utils.ts +776 -0
- package/src/architecture/network/onnx/network.onnx.export-flow.utils.ts +52 -0
- package/src/architecture/network/onnx/network.onnx.export-layer-common.utils.ts +493 -0
- package/src/architecture/network/onnx/network.onnx.export-layer-graph.utils.ts +291 -0
- package/src/architecture/network/onnx/network.onnx.export-orchestrators.utils.ts +444 -0
- package/src/architecture/network/onnx/network.onnx.export-postprocess.utils.ts +1106 -0
- package/src/architecture/network/onnx/network.onnx.export-recurrent.utils.ts +378 -0
- package/src/architecture/network/onnx/network.onnx.export-setup.utils.ts +335 -0
- package/src/architecture/network/onnx/network.onnx.import-activations.utils.ts +437 -0
- package/src/architecture/network/onnx/network.onnx.import-flow.utils.ts +67 -0
- package/src/architecture/network/onnx/network.onnx.import-fused-recurrent.utils.ts +676 -0
- package/src/architecture/network/onnx/network.onnx.import-orchestrators.utils.ts +482 -0
- package/src/architecture/network/onnx/network.onnx.import-weights.utils.ts +1120 -0
- package/src/architecture/network/onnx/network.onnx.layer-analysis.utils.ts +593 -0
- package/src/architecture/network/onnx/network.onnx.runtime-load.utils.ts +213 -0
- package/src/architecture/network/onnx/network.onnx.ts +182 -0
- package/src/architecture/network/onnx/network.onnx.utils.ts +119 -0
- package/src/architecture/network/onnx/network.onnx.utils.types.ts +1355 -0
- package/src/architecture/network/prune/README.md +565 -0
- package/src/architecture/network/prune/network.prune.evolutionary.utils.ts +186 -0
- package/src/architecture/network/prune/network.prune.regrowth.utils.ts +207 -0
- package/src/architecture/network/prune/network.prune.schedule.utils.ts +331 -0
- package/src/architecture/network/prune/network.prune.sparsity.utils.ts +27 -0
- package/src/architecture/network/prune/network.prune.utils.ts +185 -0
- package/src/architecture/network/prune/network.prune.utils.types.ts +23 -0
- package/src/architecture/network/remove/README.md +360 -0
- package/src/architecture/network/remove/network.remove.finalize.utils.ts +65 -0
- package/src/architecture/network/remove/network.remove.gates.utils.ts +64 -0
- package/src/architecture/network/remove/network.remove.reconnect.utils.ts +126 -0
- package/src/architecture/network/remove/network.remove.snapshot.utils.ts +117 -0
- package/src/architecture/network/remove/network.remove.utils.ts +75 -0
- package/src/architecture/network/remove/network.remove.utils.types.ts +76 -0
- package/src/architecture/network/remove/network.remove.validation.utils.ts +72 -0
- package/src/architecture/network/serialize/README.md +1015 -0
- package/src/architecture/network/serialize/network.serialize.activation.utils.ts +148 -0
- package/src/architecture/network/serialize/network.serialize.compact.utils.ts +369 -0
- package/src/architecture/network/serialize/network.serialize.json.utils.ts +488 -0
- package/src/architecture/network/serialize/network.serialize.runtime.utils.ts +199 -0
- package/src/architecture/network/serialize/network.serialize.utils.ts +245 -0
- package/src/architecture/network/serialize/network.serialize.utils.types.ts +153 -0
- package/src/architecture/network/slab/README.md +1178 -0
- package/src/architecture/network/slab/network.slab.activate.utils.ts +58 -0
- package/src/architecture/network/slab/network.slab.adjacency.helpers.utils.ts +381 -0
- package/src/architecture/network/slab/network.slab.fast-path.helpers.utils.ts +452 -0
- package/src/architecture/network/slab/network.slab.pool.utils.ts +137 -0
- package/src/architecture/network/slab/network.slab.rebuild.helpers.utils.ts +776 -0
- package/src/architecture/network/slab/network.slab.setup.utils.ts +17 -0
- package/src/architecture/network/slab/network.slab.shared.helpers.utils.ts +23 -0
- package/src/architecture/network/slab/network.slab.utils.ts +257 -0
- package/src/architecture/network/slab/network.slab.utils.types.ts +211 -0
- package/src/architecture/network/slab/network.slab.view.utils.ts +91 -0
- package/src/architecture/network/standalone/README.md +515 -0
- package/src/architecture/network/standalone/network.standalone.utils.activation.ts +223 -0
- package/src/architecture/network/standalone/network.standalone.utils.coverage.ts +42 -0
- package/src/architecture/network/standalone/network.standalone.utils.finalize.ts +89 -0
- package/src/architecture/network/standalone/network.standalone.utils.graph.ts +184 -0
- package/src/architecture/network/standalone/network.standalone.utils.loop.ts +152 -0
- package/src/architecture/network/standalone/network.standalone.utils.setup.ts +86 -0
- package/src/architecture/network/standalone/network.standalone.utils.ts +79 -0
- package/src/architecture/network/standalone/network.standalone.utils.types.ts +95 -0
- package/src/architecture/network/stats/README.md +172 -0
- package/src/architecture/network/stats/network.stats.test.utils.ts +221 -0
- package/src/architecture/network/{network.stats.ts → stats/network.stats.utils.ts} +7 -16
- package/src/architecture/network/topology/README.md +574 -0
- package/src/architecture/network/topology/network.topology.factory.utils.ts +256 -0
- package/src/architecture/network/topology/network.topology.loop.utils.ts +151 -0
- package/src/architecture/network/topology/network.topology.path.utils.ts +131 -0
- package/src/architecture/network/topology/network.topology.setup.utils.ts +156 -0
- package/src/architecture/network/topology/network.topology.utils.ts +82 -0
- package/src/architecture/network/topology/network.topology.utils.types.ts +31 -0
- package/src/architecture/network/training/README.md +454 -0
- package/src/architecture/network/training/network.training.backprop.utils.ts +242 -0
- package/src/architecture/network/training/network.training.finalize.utils.ts +425 -0
- package/src/architecture/network/training/network.training.gradient-clip.utils.ts +177 -0
- package/src/architecture/network/training/network.training.loop.utils.ts +327 -0
- package/src/architecture/network/training/network.training.smoothing.utils.ts +137 -0
- package/src/architecture/network/training/network.training.utils.ts +144 -0
- package/src/architecture/network/training/network.training.utils.types.ts +118 -0
- package/src/architecture/network.ts +378 -214
- package/src/architecture/node.ts +28 -28
- package/src/architecture/nodePool.ts +1 -1
- package/src/architecture/onnx.ts +2 -2
- package/src/methods/README.md +820 -155
- package/src/methods/activation.ts +52 -150
- package/src/methods/activation.utils.ts +426 -0
- package/src/methods/cost.ts +31 -177
- package/src/methods/cost.utils.ts +428 -0
- package/src/methods/rate.ts +74 -136
- package/src/methods/rate.utils.ts +371 -0
- package/src/multithreading/README.md +226 -21
- package/src/multithreading/multi.ts +94 -157
- package/src/multithreading/multi.utils.ts +282 -0
- package/src/multithreading/workers/README.md +6 -2
- package/src/multithreading/workers/node/README.md +18 -18
- package/src/multithreading/workers/node/testworker.ts +9 -6
- package/src/multithreading/workers/node/worker.ts +1 -1
- package/src/neat/README.md +10136 -844
- package/src/neat/neat.adaptive.ancestor-uniqueness.utils.ts +198 -0
- package/src/neat/neat.adaptive.complexity.utils.ts +359 -0
- package/src/neat/neat.adaptive.minimal-criterion.utils.ts +112 -0
- package/src/neat/neat.adaptive.mutation.utils.ts +476 -0
- package/src/neat/neat.adaptive.operator.utils.ts +60 -0
- package/src/neat/neat.adaptive.phases.utils.ts +60 -0
- package/src/neat/neat.adaptive.shared.ts +386 -0
- package/src/neat/neat.adaptive.ts +154 -490
- package/src/neat/neat.adaptive.utils.ts +7 -0
- package/src/neat/neat.cache.ts +1 -0
- package/src/neat/neat.cache.utils.ts +12 -0
- package/src/neat/neat.compat.ts +36 -135
- package/src/neat/neat.compat.utils.ts +278 -0
- package/src/neat/neat.diversity.ts +19 -197
- package/src/neat/neat.diversity.utils.ts +359 -0
- package/src/neat/neat.evaluate.auto-distance.utils.ts +210 -0
- package/src/neat/neat.evaluate.constants.utils.ts +42 -0
- package/src/neat/neat.evaluate.entropy-compat.utils.ts +67 -0
- package/src/neat/neat.evaluate.entropy-sharing.utils.ts +78 -0
- package/src/neat/neat.evaluate.fitness.utils.ts +48 -0
- package/src/neat/neat.evaluate.novelty.utils.ts +225 -0
- package/src/neat/neat.evaluate.objectives.utils.ts +50 -0
- package/src/neat/neat.evaluate.speciation.utils.ts +35 -0
- package/src/neat/neat.evaluate.ts +44 -422
- package/src/neat/neat.evaluate.utils.ts +9 -0
- package/src/neat/neat.evaluate.utils.types.ts +198 -0
- package/src/neat/neat.evolve.adaptive.utils.ts +224 -0
- package/src/neat/neat.evolve.objectives.utils.ts +241 -0
- package/src/neat/neat.evolve.offspring.constants.ts +8 -0
- package/src/neat/neat.evolve.offspring.utils.ts +107 -0
- package/src/neat/neat.evolve.population.utils.ts +513 -0
- package/src/neat/neat.evolve.runtime.utils.ts +128 -0
- package/src/neat/neat.evolve.speciation.utils.ts +251 -0
- package/src/neat/neat.evolve.telemetry.utils.ts +39 -0
- package/src/neat/neat.evolve.ts +219 -1328
- package/src/neat/neat.evolve.types.ts +320 -0
- package/src/neat/neat.evolve.utils.ts +10 -0
- package/src/neat/neat.evolve.warnings.utils.ts +14 -0
- package/src/neat/neat.export.ts +25 -17
- package/src/neat/neat.helpers.ts +17 -17
- package/src/neat/neat.lineage.ts +46 -131
- package/src/neat/neat.lineage.utils.ts +387 -0
- package/src/neat/neat.multiobjective.archive.utils.ts +59 -0
- package/src/neat/neat.multiobjective.category.utils.ts +335 -0
- package/src/neat/neat.multiobjective.crowding.utils.ts +512 -0
- package/src/neat/neat.multiobjective.dominance.utils.ts +403 -0
- package/src/neat/neat.multiobjective.fronts.utils.ts +177 -0
- package/src/neat/neat.multiobjective.metrics.utils.ts +65 -0
- package/src/neat/neat.multiobjective.objectives.utils.ts +75 -0
- package/src/neat/neat.multiobjective.ts +30 -229
- package/src/neat/neat.multiobjective.utils.ts +10 -0
- package/src/neat/neat.multiobjective.utils.types.ts +112 -0
- package/src/neat/neat.mutation.add-conn.utils.ts +278 -0
- package/src/neat/neat.mutation.add-node.utils.ts +309 -0
- package/src/neat/neat.mutation.dead-ends.utils.ts +229 -0
- package/src/neat/neat.mutation.flow.utils.ts +355 -0
- package/src/neat/neat.mutation.min-hidden.utils.ts +310 -0
- package/src/neat/neat.mutation.select.utils.ts +347 -0
- package/src/neat/neat.mutation.ts +186 -788
- package/src/neat/neat.mutation.types.ts +193 -0
- package/src/neat/neat.mutation.utils.ts +6 -0
- package/src/neat/neat.novelty.utils.ts +17 -0
- package/src/neat/neat.objectives.ts +33 -72
- package/src/neat/neat.objectives.utils.ts +195 -0
- package/src/neat/neat.pruning.ts +75 -165
- package/src/neat/neat.pruning.utils.ts +375 -0
- package/src/neat/neat.rng.constants.ts +18 -0
- package/src/neat/neat.rng.ts +2 -0
- package/src/neat/neat.rng.utils.ts +158 -0
- package/src/neat/neat.selection.ts +49 -197
- package/src/neat/neat.selection.utils.ts +470 -0
- package/src/neat/neat.speciation.ts +82 -221
- package/src/neat/neat.speciation.utils.ts +926 -0
- package/src/neat/neat.species.history.utils.ts +13 -0
- package/src/neat/neat.species.ts +17 -69
- package/src/neat/neat.species.utils.ts +156 -0
- package/src/neat/neat.telemetry.accessors.utils.ts +71 -0
- package/src/neat/neat.telemetry.buffer.utils.ts +58 -0
- package/src/neat/neat.telemetry.complexity.utils.ts +250 -0
- package/src/neat/neat.telemetry.diversity.utils.ts +214 -0
- package/src/neat/neat.telemetry.entropy.utils.ts +111 -0
- package/src/neat/neat.telemetry.exports.ts +181 -231
- package/src/neat/neat.telemetry.exports.utils.ts +428 -0
- package/src/neat/neat.telemetry.lineage.utils.ts +359 -0
- package/src/neat/neat.telemetry.objectives.utils.ts +216 -0
- package/src/neat/neat.telemetry.operator.utils.ts +35 -0
- package/src/neat/neat.telemetry.performance.utils.ts +30 -0
- package/src/neat/neat.telemetry.rng.utils.ts +22 -0
- package/src/neat/neat.telemetry.selection.utils.ts +108 -0
- package/src/neat/neat.telemetry.ts +270 -675
- package/src/neat/neat.telemetry.types.ts +51 -0
- package/src/neat/neat.telemetry.utils.ts +12 -0
- package/src/neat/neat.types.ts +418 -36
- package/src/neat.ts +506 -771
- package/src/utils/README.md +220 -7
- package/src/utils/memory.ts +39 -244
- package/src/utils/memory.utils.ts +450 -0
- package/test/architecture/activationArrayPool.capacity.test.ts +1 -1
- package/test/architecture/group.test.ts +17 -17
- package/test/architecture/layer.test.ts +103 -99
- package/test/architecture/node.test.ts +24 -26
- package/test/benchmarks/benchmark.buildVariants.test.ts +1 -1
- package/test/benchmarks/benchmark.fieldAudit.test.ts +1 -1
- package/test/benchmarks/benchmark.memory.test.ts +36 -43
- package/test/benchmarks/benchmark.nodePool.determinism.test.ts +2 -2
- package/test/benchmarks/benchmark.nodePool.memory.test.ts +2 -2
- package/test/benchmarks/benchmark.nodePool.removeRelease.test.ts +1 -1
- package/test/benchmarks/benchmark.nodePool.stress.test.ts +1 -1
- package/test/benchmarks/benchmark.report.test.ts +3 -3
- package/test/benchmarks/benchmark.serialization.gater.test.ts +11 -11
- package/test/benchmarks/benchmark.slab.fragmentation.bounds.test.ts +2 -2
- package/test/benchmarks/benchmark.slab.fragmentation.trend.test.ts +1 -1
- package/test/benchmarks/benchmark.variance.test.ts +2 -2
- package/test/examples/asciiMaze/README.md +347 -0
- package/test/examples/asciiMaze/asciiMaze.e2e.test.ts +2 -2
- package/test/examples/asciiMaze/browser-entry.ts +26 -25
- package/test/examples/asciiMaze/browserLogger.ts +10 -7
- package/test/examples/asciiMaze/browserTerminalUtility.ts +1 -1
- package/test/examples/asciiMaze/dashboardManager.ts +107 -110
- package/test/examples/asciiMaze/evolutionEngine/engineState.ts +20 -20
- package/test/examples/asciiMaze/evolutionEngine/evolutionLoop.ts +44 -44
- package/test/examples/asciiMaze/evolutionEngine/neatConfiguration.ts +3 -3
- package/test/examples/asciiMaze/evolutionEngine/networkInspection.ts +8 -8
- package/test/examples/asciiMaze/evolutionEngine/optionsAndSetup.ts +6 -6
- package/test/examples/asciiMaze/evolutionEngine/populationDynamics.ts +44 -44
- package/test/examples/asciiMaze/evolutionEngine/populationPruning.ts +15 -15
- package/test/examples/asciiMaze/evolutionEngine/rngAndTiming.ts +4 -4
- package/test/examples/asciiMaze/evolutionEngine/sampling.ts +8 -8
- package/test/examples/asciiMaze/evolutionEngine/scratchPools.ts +18 -18
- package/test/examples/asciiMaze/evolutionEngine/setupHelpers.ts +18 -14
- package/test/examples/asciiMaze/evolutionEngine/telemetryMetrics.ts +60 -54
- package/test/examples/asciiMaze/evolutionEngine/trainingWarmStart.ts +16 -16
- package/test/examples/asciiMaze/evolutionEngine.ts +17 -17
- package/test/examples/asciiMaze/fitness.ts +7 -7
- package/test/examples/asciiMaze/interfaces.ts +7 -6
- package/test/examples/asciiMaze/mazeMovement.ts +72 -72
- package/test/examples/asciiMaze/mazeUtils.ts +13 -18
- package/test/examples/asciiMaze/mazeVision.ts +7 -7
- package/test/examples/asciiMaze/mazeVisualization.ts +48 -48
- package/test/examples/asciiMaze/mazes.ts +4 -4
- package/test/examples/asciiMaze/networkRefinement.ts +15 -13
- package/test/examples/asciiMaze/networkVisualization.ts +102 -109
- package/test/examples/asciiMaze/refineWinner.ts +1 -1
- package/test/examples/asciiMaze/terminalUtility.ts +1 -1
- package/test/methods/activation.test.ts +5 -5
- package/test/methods/connection.test.ts +1 -1
- package/test/methods/cost.test.ts +3 -3
- package/test/methods/crossover.test.ts +2 -2
- package/test/methods/gating.test.ts +3 -3
- package/test/methods/mutation.test.ts +5 -6
- package/test/methods/optimizers.behavior.test.ts +3 -3
- package/test/methods/optimizers.formula.test.ts +5 -5
- package/test/methods/selection.test.ts +1 -1
- package/test/multithreading/multi.test.ts +1 -1
- package/test/multithreading/workers.coverage.test.ts +3 -4
- package/test/neat/neat.adaptive.ancestorUniq.cooldown.test.ts +14 -11
- package/test/neat/neat.adaptive.ancestorUniq.epsilon.test.ts +36 -14
- package/test/neat/neat.adaptive.ancestorUniq.lineagePressure.test.ts +36 -14
- package/test/neat/neat.adaptive.complexityBudget.connShrink.test.ts +3 -4
- package/test/neat/neat.adaptive.complexityBudget.growth.novelty.test.ts +1 -1
- package/test/neat/neat.adaptive.complexityBudget.minClamp.test.ts +1 -1
- package/test/neat/neat.adaptive.complexityBudget.trend.test.ts +2 -2
- package/test/neat/neat.adaptive.criterion.complexity.test.ts +3 -2
- package/test/neat/neat.adaptive.minimalCriterion.rejection.test.ts +1 -1
- package/test/neat/neat.adaptive.mutation.amount.adapt.test.ts +6 -6
- package/test/neat/neat.adaptive.mutation.anneal.strategy.test.ts +6 -7
- package/test/neat/neat.adaptive.mutation.exploreLow.strategy.test.ts +4 -5
- package/test/neat/neat.adaptive.mutation.strategy.test.ts +8 -6
- package/test/neat/neat.adaptive.mutation.twotier.balance.test.ts +4 -5
- package/test/neat/neat.adaptive.mutation.twotier.fallback.single.test.ts +4 -5
- package/test/neat/neat.adaptive.operator.adaptation.decay.balance.test.ts +4 -5
- package/test/neat/neat.adaptive.operator.bandit.decay.test.ts +1 -1
- package/test/neat/neat.adaptive.phasedComplexity.toggle.test.ts +1 -1
- package/test/neat/neat.adaptive.pruning.test.ts +1 -1
- package/test/neat/neat.additional.coverage.test.ts +2 -2
- package/test/neat/neat.advanced.enhancements.test.ts +2 -2
- package/test/neat/neat.advanced.test.ts +11 -4
- package/test/neat/neat.compat.distance.cache.test.ts +2 -2
- package/test/neat/neat.diversity.autocompat.test.ts +4 -3
- package/test/neat/neat.diversity.stats.test.ts +1 -1
- package/test/neat/neat.enhancements.test.ts +6 -6
- package/test/neat/neat.entropy.ancestorAdaptive.test.ts +1 -1
- package/test/neat/neat.helpers.spawn.pool.test.ts +2 -2
- package/test/neat/neat.innovation.test.ts +10 -10
- package/test/neat/neat.lineage.antibreeding.test.ts +2 -2
- package/test/neat/neat.lineage.entropy.test.ts +3 -3
- package/test/neat/neat.lineage.inbreeding.test.ts +2 -2
- package/test/neat/neat.lineage.pressure.test.ts +1 -1
- package/test/neat/neat.multiobjective.adaptive.test.ts +2 -2
- package/test/neat/neat.multiobjective.dynamic.test.ts +4 -4
- package/test/neat/neat.multiobjective.fastsort.delegation.test.ts +5 -4
- package/test/neat/neat.multiobjective.prune.test.ts +1 -1
- package/test/neat/neat.mutation.addconn.cycle.guard.test.ts +11 -9
- package/test/neat/neat.mutation.undefined.pool.test.ts +2 -2
- package/test/neat/neat.objectives.register.clear.test.ts +4 -4
- package/test/neat/neat.operator.phases.test.ts +2 -2
- package/test/neat/neat.pruneInactive.behavior.test.ts +1 -1
- package/test/neat/neat.pruning.adaptive.test.ts +2 -2
- package/test/neat/neat.reenable.adaptation.test.ts +1 -1
- package/test/neat/neat.rng.state.test.ts +2 -2
- package/test/neat/neat.spawn.add.test.ts +7 -7
- package/test/neat/neat.speciation.age.penalty.test.ts +1 -1
- package/test/neat/neat.speciation.assign.existing.test.ts +1 -1
- package/test/neat/neat.speciation.auto.tuning.jitter.test.ts +1 -1
- package/test/neat/neat.speciation.create.newSpecies.test.ts +4 -3
- package/test/neat/neat.speciation.fitnessSharing.equal.test.ts +2 -2
- package/test/neat/neat.speciation.fitnessSharing.kernel.test.ts +2 -2
- package/test/neat/neat.speciation.pid.threshold.clip.max.test.ts +2 -2
- package/test/neat/neat.speciation.pid.threshold.clip.min.test.ts +2 -2
- package/test/neat/neat.telemetry.advanced.test.ts +19 -19
- package/test/neat/neat.telemetry.csv.lineage.test.ts +1 -1
- package/test/neat/neat.telemetry.fastmode.diversity.test.ts +1 -1
- package/test/neat/neat.telemetry.objective.events.test.ts +1 -1
- package/test/neat/neat.telemetry.parity.test.ts +2 -2
- package/test/neat/neat.test.ts +14 -12
- package/test/neat/neat.utilities.test.ts +6 -6
- package/test/network/error.handling.test.ts +14 -14
- package/test/network/evolution.test.ts +5 -5
- package/test/network/genetic.test.ts +2 -2
- package/test/network/learning.capability.test.ts +1 -1
- package/test/network/mutation.effects.test.ts +8 -8
- package/test/network/network.activate.test.ts +4 -4
- package/test/network/network.deterministic.test.ts +2 -2
- package/test/network/network.evolve.branches.test.ts +4 -4
- package/test/network/network.evolve.multithread.branches.test.ts +5 -5
- package/test/network/network.evolve.test.ts +3 -3
- package/test/network/network.gating.removal.test.ts +2 -2
- package/test/network/network.mutate.additional.test.ts +6 -6
- package/test/network/network.mutate.edgecases.test.ts +2 -2
- package/test/network/network.mutate.test.ts +1 -1
- package/test/network/network.prune.earlyexit.test.ts +5 -5
- package/test/network/network.pruning.test.ts +1 -1
- package/test/network/network.remove.errors.test.ts +4 -4
- package/test/network/network.slab.async.test.ts +6 -6
- package/test/network/network.slab.capacity.test.ts +1 -1
- package/test/network/network.slab.fallbacks.test.ts +3 -3
- package/test/network/network.slab.fast.gain.parity.test.ts +1 -1
- package/test/network/network.slab.fast.gating.guard.test.ts +2 -2
- package/test/network/network.slab.fast.parity.test.ts +1 -1
- package/test/network/network.slab.flags.test.ts +7 -5
- package/test/network/network.slab.gain.omission.test.ts +7 -5
- package/test/network/network.slab.gain.release-on-reset.test.ts +6 -4
- package/test/network/network.slab.phase3.test.ts +7 -5
- package/test/network/network.slab.plasticity.test.ts +7 -5
- package/test/network/network.slab.versioning.test.ts +7 -5
- package/test/network/network.stats.test.ts +2 -2
- package/test/network/network.training.advanced.test.ts +2 -2
- package/test/network/network.training.basic.test.ts +12 -12
- package/test/network/network.training.helpers.test.ts +11 -11
- package/test/network/onnx.export.test.ts +17 -17
- package/test/network/onnx.recurrent.fused.test.ts +11 -9
- package/test/network/pruning.topology.test.ts +4 -4
- package/test/network/regularization.determinism.test.ts +12 -8
- package/test/network/regularization.dropconnect.validation.test.ts +2 -2
- package/test/network/regularization.stochasticdepth.test.ts +15 -11
- package/test/network/regularization.test.ts +18 -18
- package/test/network/regularization.weightnoise.test.ts +1 -1
- package/test/network/standalone.test.ts +19 -19
- package/test/network/structure.serialization.test.ts +54 -50
- package/test/onnx/onnx.conv.groundwork.test.ts +8 -4
- package/test/onnx/onnx.conv.infer.test.ts +2 -2
- package/test/onnx/onnx.conv.pool.flatten.test.ts +1 -1
- package/test/onnx/onnx.conv.pool.validation.test.ts +7 -5
- package/test/onnx/onnx.export.test.ts +71 -49
- package/test/onnx/onnx.import.test.ts +3 -3
- package/test/onnx/onnx.roundtrip.test.ts +1 -1
- package/test/training/training.earlystopping.test.ts +1 -1
- package/test/training/training.edge-cases.test.ts +2 -2
- package/test/training/training.extensions.test.ts +1 -1
- package/test/training/training.gradient.features.test.ts +5 -3
- package/test/training/training.gradient.refinements.test.ts +5 -3
- package/test/training/training.optimizer.test.ts +1 -1
- package/test/utils/console-helper.ts +6 -4
- package/test/utils/jest-setup.ts +8 -6
- package/test/utils/pollUntil.test.ts +5 -5
- package/test/utils/pollUntil.ts +1 -1
- package/test/utils/test-helpers.ts +9 -9
- package/dist-docs/package.json +0 -3
- package/dist-docs/scripts/generate-bench-tables.d.ts +0 -2
- package/dist-docs/scripts/generate-bench-tables.d.ts.map +0 -1
- package/dist-docs/scripts/generate-bench-tables.js +0 -134
- package/dist-docs/scripts/generate-bench-tables.js.map +0 -1
- package/dist-docs/scripts/generate-docs.d.ts +0 -2
- package/dist-docs/scripts/generate-docs.d.ts.map +0 -1
- package/dist-docs/scripts/generate-docs.js +0 -445
- package/dist-docs/scripts/generate-docs.js.map +0 -1
- package/dist-docs/scripts/render-docs-html.d.ts +0 -2
- package/dist-docs/scripts/render-docs-html.d.ts.map +0 -1
- package/dist-docs/scripts/render-docs-html.js +0 -133
- package/dist-docs/scripts/render-docs-html.js.map +0 -1
- package/docs/FOLDERS.md +0 -15
- package/docs/README.md +0 -1664
- package/docs/architecture/README.md +0 -1596
- package/docs/architecture/index.html +0 -991
- package/docs/architecture/network/README.md +0 -1322
- package/docs/architecture/network/index.html +0 -835
- package/docs/assets/ascii-maze.bundle.js +0 -60
- package/docs/assets/ascii-maze.bundle.js.map +0 -7
- package/docs/assets/theme.css +0 -45
- package/docs/examples/README.md +0 -82
- package/docs/examples/asciiMaze/index.html +0 -49
- package/docs/examples/index.html +0 -71
- package/docs/index.html +0 -1890
- package/docs/methods/README.md +0 -668
- package/docs/methods/index.html +0 -427
- package/docs/multithreading/README.md +0 -290
- package/docs/multithreading/index.html +0 -172
- package/docs/multithreading/workers/README.md +0 -23
- package/docs/multithreading/workers/browser/README.md +0 -47
- package/docs/multithreading/workers/browser/index.html +0 -27
- package/docs/multithreading/workers/index.html +0 -12
- package/docs/multithreading/workers/node/README.md +0 -59
- package/docs/multithreading/workers/node/index.html +0 -38
- package/docs/neat/README.md +0 -1318
- package/docs/neat/index.html +0 -776
- package/docs/src/README.md +0 -2871
- package/docs/src/index.html +0 -1638
- package/docs/utils/README.md +0 -46
- package/docs/utils/index.html +0 -27
- package/plans/HyperMorphoNEAT.md +0 -757
- package/src/architecture/network/network.activate.ts +0 -237
- package/src/architecture/network/network.connect.ts +0 -168
- package/src/architecture/network/network.deterministic.ts +0 -188
- package/src/architecture/network/network.evolve.ts +0 -521
- package/src/architecture/network/network.gating.ts +0 -199
- package/src/architecture/network/network.genetic.ts +0 -287
- package/src/architecture/network/network.mutate.ts +0 -676
- package/src/architecture/network/network.onnx.ts +0 -2330
- package/src/architecture/network/network.prune.ts +0 -238
- package/src/architecture/network/network.remove.ts +0 -112
- package/src/architecture/network/network.serialize.ts +0 -427
- package/src/architecture/network/network.slab.ts +0 -920
- package/src/architecture/network/network.standalone.ts +0 -276
- package/src/architecture/network/network.topology.ts +0 -98
- package/src/architecture/network/network.training.ts +0 -1436
- /package/{plans/ASCII_MAZE_enhancements.md → src/architecture/network/network.errors.ts} +0 -0
|
@@ -4,6 +4,17 @@ Purpose
|
|
|
4
4
|
-------
|
|
5
5
|
When generating, modifying, or suggesting code that touches files under `src/` or `test/`, follow the project `STYLEGUIDE.md` rules and perform the quick validations listed below before returning suggestions.
|
|
6
6
|
|
|
7
|
+
Educational docs preference (JSDoc)
|
|
8
|
+
----------------------------------
|
|
9
|
+
This is a public-facing, educational library. JSDoc comments are compiled into user-facing documentation (for example the aggregated READMEs under `src/**/README.md` generated by the docs workflow).
|
|
10
|
+
|
|
11
|
+
When you touch code under `src/` or `test/`, prefer improving JSDoc so the generated docs are:
|
|
12
|
+
- **Interesting and explanatory**, not just type signatures.
|
|
13
|
+
- **Example-driven**: include small examples in the main description (prefer fenced code blocks like ```ts) so the docs generator preserves them.
|
|
14
|
+
- **Conceptual**: include a brief “what/why” explanation and any important semantics (defaults, invariants, error cases, performance notes).
|
|
15
|
+
|
|
16
|
+
Keep examples short, dependency-light, and consistent with the current public API (avoid imaginary helpers or absolute file paths).
|
|
17
|
+
|
|
7
18
|
**CRITICAL: Fix-first strategy for test failures**
|
|
8
19
|
---------------------------------------------------
|
|
9
20
|
When asked to fix multiple test failures:
|
|
@@ -77,6 +88,8 @@ Strict rules to enforce (apply to any suggestion touching `src/` or `test/`)
|
|
|
77
88
|
|
|
78
89
|
2. JSDoc: exported classes/functions/constants and public methods must have JSDoc with `@param` and `@returns` where appropriate. Add short `@example` when behavior is non-obvious.
|
|
79
90
|
|
|
91
|
+
JSDoc-for-constants rule: All exported or shared default constants in `src/` and `test/` must include a concise educational JSDoc explaining what the value controls (e.g., decay factor meaning, floor rates). Keep descriptions short and clarifying.
|
|
92
|
+
|
|
80
93
|
3. Tests: follow the single-expect rule. Each `it()` (or `test()`) must have exactly one top-level `expect(...)` statement. If multiple assertions are needed, split into multiple `it()` cases or use helper assertions.
|
|
81
94
|
|
|
82
95
|
4. Constants: replace magic numbers with named `export const` or class-private `static #` constants with a short JSDoc.
|
|
@@ -87,6 +100,71 @@ Strict rules to enforce (apply to any suggestion touching `src/` or `test/`)
|
|
|
87
100
|
|
|
88
101
|
7. Types: avoid `any` and `unknown` in `src/` and `test/`. Use precise types or `// eslint-disable-next-line @typescript-eslint/no-explicit-any` with a short justification comment.
|
|
89
102
|
|
|
103
|
+
8. Local helper structure preference:
|
|
104
|
+
- For new or refactored functions that introduce internal helpers, order the function as:
|
|
105
|
+
1) Local variables/constants at top
|
|
106
|
+
2) Declarative logic (calls to helpers)
|
|
107
|
+
3) Return (fold)
|
|
108
|
+
4) Internal helper function declarations at the end of the parent function
|
|
109
|
+
- Helpers should be small and pure where practical, with step-level inline comments and JSDoc.
|
|
110
|
+
|
|
111
|
+
9. Mandatory implementation pattern (always; keep cognitive complexity low):
|
|
112
|
+
- Applies to all new code and any modified/refactored code in `src/` and `test/`.
|
|
113
|
+
- Prefer a *declarative top-level flow* ("collect → transform → fold/return") over deeply nested control flow.
|
|
114
|
+
- Avoid ternary chains (especially nested) for multi-branch fallback logic; use named resolver helpers with early returns instead.
|
|
115
|
+
- When normalizing legacy/loose data, isolate type assertions/casting into a single helper and keep the rest strongly typed.
|
|
116
|
+
- Keep helpers after the fold, and give each helper a single responsibility (SOLID: SRP). If the logic reads like a decision tree, it likely wants 2–4 small helpers.
|
|
117
|
+
|
|
118
|
+
10. General multi-pass decomposition requirements (apply to all medium/large refactors):
|
|
119
|
+
- Perform refactors in explicit passes, in this order unless unsafe:
|
|
120
|
+
1) Stabilize current behavior and identify seams
|
|
121
|
+
2) Extract pure helpers by responsibility
|
|
122
|
+
3) Introduce typed context/result objects to reduce parameter sprawl
|
|
123
|
+
4) Simplify top-level flow to orchestration only
|
|
124
|
+
5) Fold repeated logic into collect/transform/fold helpers
|
|
125
|
+
- Keep the top-level method declarative and linear, with numbered inline comments (`Step 1`, `Step 2`, ...).
|
|
126
|
+
- Ensure each helper has one reason to change (SRP), very low cognitive complexity, and descriptive naming.
|
|
127
|
+
- Place helper declarations after the top-level return/fold where language/style allows.
|
|
128
|
+
- Prefer immutable pass-style transforms (`map`, `filter`, `reduce`, index-collection helpers) over mixed mutation-heavy loops.
|
|
129
|
+
- When passing more than 3-4 arguments repeatedly, introduce a typed context object and shared result types.
|
|
130
|
+
|
|
131
|
+
Example (ideal structure)
|
|
132
|
+
-------------------------
|
|
133
|
+
```ts
|
|
134
|
+
export function exampleMethod(input: Input) {
|
|
135
|
+
const constants = /* ... */;
|
|
136
|
+
const locals = /* ... */;
|
|
137
|
+
|
|
138
|
+
if (/* guard */) return /* fold */;
|
|
139
|
+
|
|
140
|
+
const stepOne = helperOne(input, locals, constants);
|
|
141
|
+
const stepTwo = helperTwo(stepOne, locals, constants);
|
|
142
|
+
return helperThree(stepTwo, locals, constants);
|
|
143
|
+
|
|
144
|
+
/** @param value - Input. @returns Intermediate. */
|
|
145
|
+
function helperOne(value: Input, _locals: unknown, _constants: unknown): Intermediate {
|
|
146
|
+
// Step 1: ...
|
|
147
|
+
return /* ... */;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** @param value - Intermediate. @returns Intermediate. */
|
|
151
|
+
function helperTwo(value: Intermediate, _locals: unknown, _constants: unknown): Intermediate {
|
|
152
|
+
// Step 1: ...
|
|
153
|
+
return /* ... */;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/** @param value - Intermediate. @returns Output. */
|
|
157
|
+
function helperThree(value: Intermediate, _locals: unknown, _constants: unknown): Output {
|
|
158
|
+
// Step 1: Fold/return.
|
|
159
|
+
return /* ... */;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
type Input = unknown;
|
|
164
|
+
type Intermediate = unknown;
|
|
165
|
+
type Output = unknown;
|
|
166
|
+
```
|
|
167
|
+
|
|
90
168
|
Automated validations to run before finalizing a suggestion
|
|
91
169
|
-------------------------------------------------------
|
|
92
170
|
When you modify or create files under `src/` or `test/`, run (or advise running) these quick validations. If you cannot run them, still make sure your suggestion would pass them.
|
|
@@ -130,3 +208,36 @@ When you modify or create files under `src/` or `test/`, run (or advise running)
|
|
|
130
208
|
4. ONLY run `npm test` after all planned fixes are complete
|
|
131
209
|
5. Analyze results and iterate on remaining issues
|
|
132
210
|
|
|
211
|
+
|
|
212
|
+
Refactor format: large-file split (step-by-step, user-confirmed)
|
|
213
|
+
---------------------------------------------------------------
|
|
214
|
+
When splitting a large module into submodules, follow this exact execution format:
|
|
215
|
+
|
|
216
|
+
1. Plan first
|
|
217
|
+
- Propose a file map (main orchestration file + helper/type modules).
|
|
218
|
+
- Keep exported APIs in the main file unless explicitly requested otherwise.
|
|
219
|
+
- Define boundaries clearly (types, pool, rebuild helpers, fast-path helpers, adjacency helpers).
|
|
220
|
+
|
|
221
|
+
2. Create a TODO checklist
|
|
222
|
+
- Add ordered steps with one active item at a time.
|
|
223
|
+
- Track progress visibly (mark completed items as soon as each step finishes).
|
|
224
|
+
|
|
225
|
+
3. Execute in strict passes (one step at a time)
|
|
226
|
+
- Step A: create empty target files (skeletons only).
|
|
227
|
+
- Step B: move one category at a time (types first, then helper groups).
|
|
228
|
+
- Step C: after moving a category, delete the original source from the main file immediately.
|
|
229
|
+
- Never batch multiple categories in one pass.
|
|
230
|
+
|
|
231
|
+
4. Require user confirmation between steps
|
|
232
|
+
- After each completed step, stop and request confirmation before continuing.
|
|
233
|
+
- Do not proceed to the next step without explicit user approval.
|
|
234
|
+
|
|
235
|
+
5. Keep the main file as high-level orchestration
|
|
236
|
+
- Exported functions should show step-level flow (`Step 1`, `Step 2`, ...).
|
|
237
|
+
- Avoid trivial re-export wrappers or single-helper pass-through exports.
|
|
238
|
+
- Main file may retain shared constants and orchestration-level guards.
|
|
239
|
+
|
|
240
|
+
6. Validate only after all planned moves
|
|
241
|
+
- Run `npx tsc --noEmit -p tsconfig.json` after completing all migration steps.
|
|
242
|
+
- Report concise validation summary and any unresolved follow-ups.
|
|
243
|
+
|
package/.github/workflows/ci.yml
CHANGED
|
@@ -3,12 +3,6 @@ name: Deploy docs (GitHub Pages)
|
|
|
3
3
|
on:
|
|
4
4
|
push:
|
|
5
5
|
branches: [develop]
|
|
6
|
-
paths:
|
|
7
|
-
- 'docs/**'
|
|
8
|
-
- 'dist/**'
|
|
9
|
-
- 'src/**'
|
|
10
|
-
- 'package.json'
|
|
11
|
-
- '.github/workflows/deploy-pages.yml'
|
|
12
6
|
workflow_dispatch:
|
|
13
7
|
|
|
14
8
|
permissions:
|
|
@@ -33,7 +27,7 @@ jobs:
|
|
|
33
27
|
- name: Setup Node
|
|
34
28
|
uses: actions/setup-node@v4
|
|
35
29
|
with:
|
|
36
|
-
node-version:
|
|
30
|
+
node-version: 22
|
|
37
31
|
|
|
38
32
|
- name: Install dependencies
|
|
39
33
|
run: npm ci
|
|
@@ -59,14 +59,14 @@ jobs:
|
|
|
59
59
|
if: ${{ env.LOOP_SKIP == 'false' }}
|
|
60
60
|
uses: actions/setup-node@v4
|
|
61
61
|
with:
|
|
62
|
-
node-version:
|
|
62
|
+
node-version: 22
|
|
63
63
|
cache: 'npm'
|
|
64
64
|
|
|
65
65
|
- name: Setup Node (npmjs)
|
|
66
66
|
if: ${{ env.LOOP_SKIP == 'false' }}
|
|
67
67
|
uses: actions/setup-node@v4
|
|
68
68
|
with:
|
|
69
|
-
node-version:
|
|
69
|
+
node-version: 22
|
|
70
70
|
registry-url: https://registry.npmjs.org
|
|
71
71
|
always-auth: true
|
|
72
72
|
env:
|
|
@@ -143,7 +143,7 @@ jobs:
|
|
|
143
143
|
if: ${{ env.LOOP_SKIP == 'false' }}
|
|
144
144
|
uses: actions/setup-node@v4
|
|
145
145
|
with:
|
|
146
|
-
node-version:
|
|
146
|
+
node-version: 22
|
|
147
147
|
registry-url: https://npm.pkg.github.com/
|
|
148
148
|
always-auth: true
|
|
149
149
|
env:
|
package/LICENSE
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
3
|
Copyright (c) 2024 Cesar Anton <reicek@gmail.com>
|
|
4
|
-
Copyright (c) 2017 Thomas Wagenaar <wagenaartje@protonmail.com>
|
|
4
|
+
Copyright (c) 2017 Thomas Wagenaar <wagenaartje@protonmail.com> (parts used from Neataptic)
|
|
5
5
|
Copyright (c) 2017 Juan Cazala (parts used from Synaptic)
|
|
6
6
|
|
|
7
7
|
|
package/package.json
CHANGED