@reicek/neataptic-ts 0.1.21 → 0.1.22
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 +29 -0
- package/.github/agents/docs-scout.agent.md +29 -0
- package/.github/agents/plan-scout.agent.md +29 -0
- package/.github/agents/solid-split.agent.md +138 -0
- package/.github/copilot-instructions.md +103 -0
- package/package.json +6 -3
- package/plans/ES2023 migration +13 -8
- package/plans/Evolution_Training_Interoperability_Contracts.md +1 -1
- 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/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 +101 -223
- package/src/architecture/README.md +57 -185
- package/src/architecture/layer/README.md +38 -38
- package/src/architecture/network/README.md +33 -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/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/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/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 +562 -568
- 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/Trace-20260309T191949.json +24124 -0
- package/test/examples/flappy_bird/browser-entry/README.md +1129 -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 +6 -399
- package/test/examples/flappy_bird/browser-entry/browser-entry.playback.utils.ts +1 -717
- package/test/examples/flappy_bird/browser-entry/browser-entry.spawn.utils.ts +11 -31
- package/test/examples/flappy_bird/browser-entry/browser-entry.visualization.utils.ts +15 -893
- package/test/examples/flappy_bird/browser-entry/host/README.md +307 -0
- package/test/examples/flappy_bird/browser-entry/host/host.resize.service.ts +1 -295
- package/test/examples/flappy_bird/browser-entry/host/host.ts +562 -6
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +274 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.constants.ts +31 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.services.ts +360 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.types.ts +63 -0
- package/test/examples/flappy_bird/browser-entry/host/resize/host.resize.service.utils.ts +250 -0
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +399 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.topology.utils.ts +255 -0
- package/test/examples/flappy_bird/browser-entry/network-view/network-view.ts +802 -7
- package/test/examples/flappy_bird/browser-entry/playback/README.md +684 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +277 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +770 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.cache.services.ts +178 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.constants.ts +107 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.geometry.utils.ts +518 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.math.utils.ts +117 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.pulse.utils.ts +233 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.services.ts +211 -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 +212 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/playback.background.ground-grid.utils.ts +81 -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 +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/background/playback.background.services.ts +244 -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 +68 -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 +310 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.service.ts +92 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.types.ts +39 -0
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/playback.frame-render.utils.ts +493 -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 +4 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.snapshot.utils.ts +44 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.service.ts +39 -122
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.services.ts +272 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.types.ts +62 -0
- package/test/examples/flappy_bird/browser-entry/playback/playback.starfield.utils.ts +11 -4
- package/test/examples/flappy_bird/browser-entry/playback/playback.ts +409 -8
- package/test/examples/flappy_bird/browser-entry/playback/playback.types.ts +4 -12
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +235 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.evolution-launch.service.ts +45 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.lifecycle.service.ts +81 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.startup.service.ts +74 -0
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.ts +31 -121
- package/test/examples/flappy_bird/browser-entry/runtime/runtime.types.ts +36 -0
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +557 -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 +957 -19
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.legend.utils.ts +138 -3
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.topology.utils.ts +3 -27
- package/test/examples/flappy_bird/browser-entry/visualization/visualization.ts +1 -23
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +156 -0
- package/test/examples/flappy_bird/constants/README.md +1179 -0
- package/test/examples/flappy_bird/constants/constants.network-view.ts +24 -0
- package/test/examples/flappy_bird/constants/constants.palette.ts +7 -0
- package/test/examples/flappy_bird/constants/constants.starfield.ts +78 -3
- package/test/examples/flappy_bird/environment/README.md +143 -0
- package/test/examples/flappy_bird/environment/environment.observation.utils.ts +1 -19
- package/test/examples/flappy_bird/environment/environment.step.service.ts +3 -66
- package/test/examples/flappy_bird/evaluation/README.md +130 -0
- package/test/examples/flappy_bird/evaluation/evaluation.fitness.utils.ts +1 -1
- package/test/examples/flappy_bird/evaluation/evaluation.rollout.service.ts +5 -375
- package/test/examples/flappy_bird/evaluation/rollout/README.md +291 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.constants.ts +30 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.service.ts +58 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.services.ts +310 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.types.ts +56 -0
- package/test/examples/flappy_bird/evaluation/rollout/evaluation.rollout.utils.ts +368 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +618 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.playback.service.ts +7 -7
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.frame.service.ts +364 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.types.ts +14 -0
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.simulation.utils.ts +4 -201
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.ts +184 -345
- package/test/examples/flappy_bird/flappy-evolution-worker/flappy-evolution-worker.warm-start.service.ts +291 -0
- package/test/examples/flappy_bird/flappy.simulation.shared.utils.ts +5 -0
- package/test/examples/flappy_bird/simulation-shared/README.md +417 -0
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +183 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.features.utils.ts +301 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.ts +9 -0
- package/test/examples/flappy_bird/simulation-shared/observation/observation.vector.utils.ts +59 -0
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.observation.utils.ts +5 -403
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.spawn.utils.ts +20 -6
- package/test/examples/flappy_bird/{evaluation/evaluation.statistics.utils.ts → simulation-shared/simulation-shared.statistics.utils.ts} +23 -8
- package/test/examples/flappy_bird/trainer/README.md +563 -0
- package/test/examples/flappy_bird/trainer/evaluation/README.md +199 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.constants.ts +9 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.services.ts +73 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.ts +165 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.types.ts +25 -0
- package/test/examples/flappy_bird/trainer/evaluation/trainer.evaluation.service.utils.ts +161 -0
- package/test/examples/flappy_bird/trainer/trainer.evaluation.service.ts +13 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.services.ts +181 -0
- package/test/examples/flappy_bird/trainer/trainer.report.service.ts +126 -0
- package/test/examples/flappy_bird/trainer/trainer.selection.utils.ts +89 -0
- package/test/examples/flappy_bird/trainer/trainer.ts +11 -553
- package/test/examples/flappy_bird/browser-entry/browser-entry.utils.ts +0 -12
- package/test/examples/flappy_bird/environment/environment.ts +0 -7
- package/test/examples/flappy_bird/evaluation/evaluation.ts +0 -7
- package/test/examples/flappy_bird/simulation-shared/simulation-shared.ts +0 -15
- package/test/examples/flappy_bird/trainer/trainer.statistics.utils.ts +0 -78
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
# trainer
|
|
2
|
+
|
|
3
|
+
## trainer/trainer.types.ts
|
|
4
|
+
|
|
5
|
+
### FlappyGenerationEvaluationPlan
|
|
6
|
+
|
|
7
|
+
Generation-level rollout plans for staged evaluation.
|
|
8
|
+
|
|
9
|
+
### FlappyGenerationReport
|
|
10
|
+
|
|
11
|
+
Compact generation report used for training logs.
|
|
12
|
+
|
|
13
|
+
### FlappyTrainerNeatController
|
|
14
|
+
|
|
15
|
+
Local typed view for population-level fitness mode used by this trainer.
|
|
16
|
+
|
|
17
|
+
### FlappyTrainerNetwork
|
|
18
|
+
|
|
19
|
+
Network shape expected by the Flappy trainer.
|
|
20
|
+
|
|
21
|
+
### FlappyTrainerRuntimeState
|
|
22
|
+
|
|
23
|
+
Trainer runtime state shared by orchestration helpers.
|
|
24
|
+
|
|
25
|
+
### FlappyTrainerSetup
|
|
26
|
+
|
|
27
|
+
Immutable trainer setup values.
|
|
28
|
+
|
|
29
|
+
### ScoredGenomeEntry
|
|
30
|
+
|
|
31
|
+
Score carrier used for deterministic ordering helpers.
|
|
32
|
+
|
|
33
|
+
## trainer/trainer.ts
|
|
34
|
+
|
|
35
|
+
### handleTrainerMainError
|
|
36
|
+
|
|
37
|
+
`(error: unknown) => void`
|
|
38
|
+
|
|
39
|
+
Handles fatal `main` rejection path.
|
|
40
|
+
|
|
41
|
+
### runTrainer
|
|
42
|
+
|
|
43
|
+
`() => Promise<void>`
|
|
44
|
+
|
|
45
|
+
Flappy Bird neuroevolution demo.
|
|
46
|
+
|
|
47
|
+
This script runs a small NEAT population where each genome controls a bird.
|
|
48
|
+
The network sees a temporal observation (38 floats) and outputs two competing
|
|
49
|
+
action scores (`no flap` vs `flap`).
|
|
50
|
+
|
|
51
|
+
Run (from repo root):
|
|
52
|
+
`npx ts-node test/examples/flappy_bird/trainFlappyBird.ts`
|
|
53
|
+
|
|
54
|
+
## trainer/trainer.errors.ts
|
|
55
|
+
|
|
56
|
+
### trainer.errors
|
|
57
|
+
|
|
58
|
+
Prefix used when rendering unexpected trainer failures to stderr.
|
|
59
|
+
|
|
60
|
+
### FLAPPY_TRAINER_UNEXPECTED_ERROR_PREFIX
|
|
61
|
+
|
|
62
|
+
### formatTrainerErrorMessage
|
|
63
|
+
|
|
64
|
+
`(error: unknown) => string`
|
|
65
|
+
|
|
66
|
+
Formats unknown trainer failures into a stable human-readable message.
|
|
67
|
+
|
|
68
|
+
Parameters:
|
|
69
|
+
|
|
70
|
+
- `error` - - Unknown rejection reason from trainer execution.
|
|
71
|
+
|
|
72
|
+
Returns: Formatted error string for CLI logging.
|
|
73
|
+
|
|
74
|
+
## trainer/trainer.constants.ts
|
|
75
|
+
|
|
76
|
+
### FLAPPY_TRAINER_DEFAULT_ELITISM_COUNT
|
|
77
|
+
|
|
78
|
+
### FLAPPY_TRAINER_DEFAULT_POPULATION_SIZE
|
|
79
|
+
|
|
80
|
+
### FLAPPY_TRAINER_DEFAULT_RNG_SEED
|
|
81
|
+
|
|
82
|
+
### FLAPPY_TRAINER_DUMMY_FLAP_OUTPUT
|
|
83
|
+
|
|
84
|
+
### FLAPPY_TRAINER_DUMMY_NETWORK_ID
|
|
85
|
+
|
|
86
|
+
### FLAPPY_TRAINER_DUMMY_NO_FLAP_OUTPUT
|
|
87
|
+
|
|
88
|
+
### FLAPPY_TRAINER_FRAME_PRIMARY_BASE_SCORE
|
|
89
|
+
|
|
90
|
+
### FLAPPY_TRAINER_FRAME_PRIMARY_PIPE_WEIGHT
|
|
91
|
+
|
|
92
|
+
### FLAPPY_TRAINER_FRAME_PRIMARY_SURVIVAL_WEIGHT
|
|
93
|
+
|
|
94
|
+
### FLAPPY_TRAINER_FRAME_STABILITY_STDDEV_WEIGHT
|
|
95
|
+
|
|
96
|
+
### FLAPPY_TRAINER_FULL_PASS_ELITISM_MULTIPLIER
|
|
97
|
+
|
|
98
|
+
### FLAPPY_TRAINER_FULL_PASS_POPULATION_FRACTION
|
|
99
|
+
|
|
100
|
+
### FLAPPY_TRAINER_FULL_ROLLOUT_EARLY_TERMINATION_CONSECUTIVE_FRAMES
|
|
101
|
+
|
|
102
|
+
### FLAPPY_TRAINER_FULL_ROLLOUT_EARLY_TERMINATION_GRACE_FRAMES
|
|
103
|
+
|
|
104
|
+
### FLAPPY_TRAINER_FULL_ROLLOUT_PIPE_PROGRESS_TARGET
|
|
105
|
+
|
|
106
|
+
### FLAPPY_TRAINER_LOG_PARTS_DELIMITER
|
|
107
|
+
|
|
108
|
+
### FLAPPY_TRAINER_MUTATION_AMOUNT_END
|
|
109
|
+
|
|
110
|
+
### FLAPPY_TRAINER_MUTATION_AMOUNT_START
|
|
111
|
+
|
|
112
|
+
### FLAPPY_TRAINER_MUTATION_ANNEAL_GENERATIONS
|
|
113
|
+
|
|
114
|
+
### FLAPPY_TRAINER_MUTATION_RATE_END
|
|
115
|
+
|
|
116
|
+
### FLAPPY_TRAINER_MUTATION_RATE_START
|
|
117
|
+
|
|
118
|
+
### FLAPPY_TRAINER_NEAT_INITIAL_MUTATION_AMOUNT
|
|
119
|
+
|
|
120
|
+
### FLAPPY_TRAINER_NEAT_INITIAL_MUTATION_RATE
|
|
121
|
+
|
|
122
|
+
### FLAPPY_TRAINER_PIPE_FALLBACK_PIPE_WEIGHT
|
|
123
|
+
|
|
124
|
+
### FLAPPY_TRAINER_PIPE_FILTER_TOLERANCE
|
|
125
|
+
|
|
126
|
+
### FLAPPY_TRAINER_QUICK_ROLLOUT_EARLY_TERMINATION_CONSECUTIVE_FRAMES
|
|
127
|
+
|
|
128
|
+
### FLAPPY_TRAINER_QUICK_ROLLOUT_EARLY_TERMINATION_GRACE_FRAMES
|
|
129
|
+
|
|
130
|
+
### FLAPPY_TRAINER_QUICK_ROLLOUT_MAX_FRAMES
|
|
131
|
+
|
|
132
|
+
### FLAPPY_TRAINER_QUICK_ROLLOUT_PIPE_PROGRESS_TARGET
|
|
133
|
+
|
|
134
|
+
### FLAPPY_TRAINER_REEVALUATION_MIN_CANDIDATE_COUNT
|
|
135
|
+
|
|
136
|
+
### FLAPPY_TRAINER_SCORE_MEDIAN_PERCENTILE
|
|
137
|
+
|
|
138
|
+
### FLAPPY_TRAINER_SCORE_P90_PERCENTILE
|
|
139
|
+
|
|
140
|
+
### FLAPPY_TRAINER_STOPPED_MESSAGE
|
|
141
|
+
|
|
142
|
+
## trainer/trainer.loop.service.ts
|
|
143
|
+
|
|
144
|
+
### applyMutationSchedule
|
|
145
|
+
|
|
146
|
+
`(neatController: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNeatController, mutationSchedule: import("test/examples/flappy_bird/trainer/trainer.evaluation-plan.utils").FlappyMutationSchedule) => void`
|
|
147
|
+
|
|
148
|
+
Applies mutation schedule values to the NEAT controller options.
|
|
149
|
+
|
|
150
|
+
Parameters:
|
|
151
|
+
|
|
152
|
+
- `neatController` - - Trainer NEAT controller.
|
|
153
|
+
- `mutationSchedule` - - Mutation schedule for current generation.
|
|
154
|
+
|
|
155
|
+
### LogGenerationSummaryCallback
|
|
156
|
+
|
|
157
|
+
`(generationLabel: number, mutationSchedule: import("test/examples/flappy_bird/trainer/trainer.evaluation-plan.utils").FlappyMutationSchedule, report: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationReport | undefined, fittestGenome: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, fallbackEpisode: import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyEpisodeResult) => void`
|
|
158
|
+
|
|
159
|
+
Callback signature for one-line generation logging.
|
|
160
|
+
|
|
161
|
+
### runTrainerEvolutionLoop
|
|
162
|
+
|
|
163
|
+
`(neatController: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNeatController, trainerRuntimeState: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState, logGenerationSummary: import("test/examples/flappy_bird/trainer/trainer.loop.service").LogGenerationSummaryCallback) => Promise<void>`
|
|
164
|
+
|
|
165
|
+
Runs the outer evolution loop until runtime stop is requested.
|
|
166
|
+
|
|
167
|
+
Parameters:
|
|
168
|
+
|
|
169
|
+
- `neatController` - - Trainer NEAT controller.
|
|
170
|
+
- `trainerRuntimeState` - - Mutable trainer runtime state.
|
|
171
|
+
- `logGenerationSummary` - - Callback that emits compact generation logs.
|
|
172
|
+
|
|
173
|
+
## trainer/trainer.setup.service.ts
|
|
174
|
+
|
|
175
|
+
### createNeatController
|
|
176
|
+
|
|
177
|
+
`(trainerSetup: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerSetup) => import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNeatController`
|
|
178
|
+
|
|
179
|
+
Builds the NEAT controller with baseline options.
|
|
180
|
+
|
|
181
|
+
Parameters:
|
|
182
|
+
|
|
183
|
+
- `trainerSetup` - - Immutable trainer setup values.
|
|
184
|
+
|
|
185
|
+
Returns: Typed NEAT controller used by the trainer loop.
|
|
186
|
+
|
|
187
|
+
### createTrainerRuntimeState
|
|
188
|
+
|
|
189
|
+
`() => import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState`
|
|
190
|
+
|
|
191
|
+
Creates mutable runtime state container.
|
|
192
|
+
|
|
193
|
+
Returns: Fresh runtime state used by loop orchestration.
|
|
194
|
+
|
|
195
|
+
### createTrainerSetup
|
|
196
|
+
|
|
197
|
+
`() => import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerSetup`
|
|
198
|
+
|
|
199
|
+
Creates immutable setup values for the trainer.
|
|
200
|
+
|
|
201
|
+
Returns: Default trainer setup values used for NEAT configuration.
|
|
202
|
+
|
|
203
|
+
### resolveNoopFitness
|
|
204
|
+
|
|
205
|
+
`() => number`
|
|
206
|
+
|
|
207
|
+
Trivial baseline fitness used before attaching population evaluator.
|
|
208
|
+
|
|
209
|
+
Returns: Constant zero fitness.
|
|
210
|
+
|
|
211
|
+
## trainer/trainer.report.service.ts
|
|
212
|
+
|
|
213
|
+
### buildGenerationReport
|
|
214
|
+
|
|
215
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], aggregateByGenome: ReadonlyMap<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, import("test/examples/flappy_bird/evaluation/evaluation.types").FlappySeedBatchEvaluation>, generationEvaluationPlan: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationEvaluationPlan) => import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationReport`
|
|
216
|
+
|
|
217
|
+
Builds a compact report for the current generation.
|
|
218
|
+
|
|
219
|
+
Parameters:
|
|
220
|
+
|
|
221
|
+
- `population` - - Current population.
|
|
222
|
+
- `aggregateByGenome` - - Aggregate evaluation results keyed by genome.
|
|
223
|
+
- `generationEvaluationPlan` - - Per-generation staged evaluation plan.
|
|
224
|
+
|
|
225
|
+
Returns: Aggregated generation report.
|
|
226
|
+
|
|
227
|
+
### logGenerationSummary
|
|
228
|
+
|
|
229
|
+
`(generationLabel: number, mutationSchedule: import("test/examples/flappy_bird/trainer/trainer.evaluation-plan.utils").FlappyMutationSchedule, report: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationReport | undefined, fittestGenome: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, fallbackEpisode: import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyEpisodeResult) => void`
|
|
230
|
+
|
|
231
|
+
Emits one compact generation log line.
|
|
232
|
+
|
|
233
|
+
Parameters:
|
|
234
|
+
|
|
235
|
+
- `generationLabel` - - Current generation label.
|
|
236
|
+
- `mutationSchedule` - - Active mutation schedule.
|
|
237
|
+
- `report` - - Optional aggregated generation report.
|
|
238
|
+
- `fittestGenome` - - Fittest genome returned by the NEAT controller.
|
|
239
|
+
- `fallbackEpisode` - - Fallback representative rollout episode.
|
|
240
|
+
|
|
241
|
+
Returns: Nothing.
|
|
242
|
+
|
|
243
|
+
## trainer/trainer.fitness.service.ts
|
|
244
|
+
|
|
245
|
+
### attachPopulationFitnessEvaluator
|
|
246
|
+
|
|
247
|
+
`(neatController: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNeatController, trainerRuntimeState: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState, elitismCount: number, dependencies: import("test/examples/flappy_bird/trainer/trainer.fitness.service").TrainerFitnessServiceDependencies) => void`
|
|
248
|
+
|
|
249
|
+
Attaches population-level staged evaluator to the NEAT controller.
|
|
250
|
+
|
|
251
|
+
Parameters:
|
|
252
|
+
|
|
253
|
+
- `neatController` - - Trainer NEAT controller.
|
|
254
|
+
- `trainerRuntimeState` - - Mutable trainer runtime state.
|
|
255
|
+
- `elitismCount` - - Number of elite genomes preserved each generation.
|
|
256
|
+
- `dependencies` - - Pure/impure helper callbacks used by the evaluator.
|
|
257
|
+
|
|
258
|
+
### createPopulationFitnessEvaluator
|
|
259
|
+
|
|
260
|
+
`(neatController: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNeatController, trainerRuntimeState: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState, elitismCount: number, dependencies: import("test/examples/flappy_bird/trainer/trainer.fitness.service").TrainerFitnessServiceDependencies) => (population: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[]) => Promise<void>`
|
|
261
|
+
|
|
262
|
+
Creates the asynchronous population fitness evaluator.
|
|
263
|
+
|
|
264
|
+
Parameters:
|
|
265
|
+
|
|
266
|
+
- `neatController` - - Trainer NEAT controller.
|
|
267
|
+
- `trainerRuntimeState` - - Mutable trainer runtime state.
|
|
268
|
+
- `elitismCount` - - Number of elite genomes preserved each generation.
|
|
269
|
+
- `dependencies` - - Pure/impure helper callbacks used by the evaluator.
|
|
270
|
+
|
|
271
|
+
Returns: Evaluator callback assigned to `neatController.fitness`.
|
|
272
|
+
|
|
273
|
+
### TrainerFitnessServiceDependencies
|
|
274
|
+
|
|
275
|
+
Callback dependencies required by the trainer fitness orchestration service.
|
|
276
|
+
|
|
277
|
+
## trainer/trainer.signals.service.ts
|
|
278
|
+
|
|
279
|
+
### handleTrainerStopSignal
|
|
280
|
+
|
|
281
|
+
`(trainerRuntimeState: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState) => void`
|
|
282
|
+
|
|
283
|
+
Handles one stop signal update.
|
|
284
|
+
|
|
285
|
+
Parameters:
|
|
286
|
+
|
|
287
|
+
- `trainerRuntimeState` - - Mutable trainer runtime state.
|
|
288
|
+
|
|
289
|
+
### registerTrainerStopSignals
|
|
290
|
+
|
|
291
|
+
`(trainerRuntimeState: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerRuntimeState) => void`
|
|
292
|
+
|
|
293
|
+
Registers graceful stop signal handlers.
|
|
294
|
+
|
|
295
|
+
Parameters:
|
|
296
|
+
|
|
297
|
+
- `trainerRuntimeState` - - Mutable trainer runtime state.
|
|
298
|
+
|
|
299
|
+
## trainer/trainer.evaluation.service.ts
|
|
300
|
+
|
|
301
|
+
### trainer.evaluation.service
|
|
302
|
+
|
|
303
|
+
Trainer evaluation compatibility facade.
|
|
304
|
+
|
|
305
|
+
The staged population-evaluation implementation now lives in the dedicated
|
|
306
|
+
`trainer/evaluation/` submodule so orchestration, scoring helpers, internal
|
|
307
|
+
contracts, and sub-services can evolve behind a focused boundary.
|
|
308
|
+
|
|
309
|
+
### commitPopulationScores
|
|
310
|
+
|
|
311
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], provisionalScoresByGenome: ReadonlyMap<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, number>) => void`
|
|
312
|
+
|
|
313
|
+
Commits provisional scores to genome score fields.
|
|
314
|
+
|
|
315
|
+
Parameters:
|
|
316
|
+
|
|
317
|
+
- `population` - - Current population.
|
|
318
|
+
- `provisionalScoresByGenome` - - Final provisional score map.
|
|
319
|
+
|
|
320
|
+
Returns: Nothing.
|
|
321
|
+
|
|
322
|
+
### evaluatePopulationFullStage
|
|
323
|
+
|
|
324
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], generationEvaluationPlan: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationEvaluationPlan, aggregateByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, import("test/examples/flappy_bird/evaluation/evaluation.types").FlappySeedBatchEvaluation>, provisionalScoresByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, number>, elitismCount: number) => void`
|
|
325
|
+
|
|
326
|
+
Executes the full evaluation stage over the top provisional candidates.
|
|
327
|
+
|
|
328
|
+
Parameters:
|
|
329
|
+
|
|
330
|
+
- `population` - - Current population.
|
|
331
|
+
- `generationEvaluationPlan` - - Per-generation staged evaluation plan.
|
|
332
|
+
- `aggregateByGenome` - - Mutable aggregate cache keyed by genome.
|
|
333
|
+
- `provisionalScoresByGenome` - - Mutable provisional score map.
|
|
334
|
+
- `elitismCount` - - Configured elitism count.
|
|
335
|
+
|
|
336
|
+
Returns: Nothing.
|
|
337
|
+
|
|
338
|
+
### evaluatePopulationQuickStage
|
|
339
|
+
|
|
340
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], generationEvaluationPlan: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationEvaluationPlan, aggregateByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, import("test/examples/flappy_bird/evaluation/evaluation.types").FlappySeedBatchEvaluation>, provisionalScoresByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, number>) => void`
|
|
341
|
+
|
|
342
|
+
Executes the quick evaluation stage over the full population.
|
|
343
|
+
|
|
344
|
+
Parameters:
|
|
345
|
+
|
|
346
|
+
- `population` - - Current population.
|
|
347
|
+
- `generationEvaluationPlan` - - Per-generation staged evaluation plan.
|
|
348
|
+
- `aggregateByGenome` - - Mutable aggregate cache keyed by genome.
|
|
349
|
+
- `provisionalScoresByGenome` - - Mutable provisional score map.
|
|
350
|
+
|
|
351
|
+
Returns: Nothing.
|
|
352
|
+
|
|
353
|
+
### evaluatePopulationReevaluationStage
|
|
354
|
+
|
|
355
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], generationEvaluationPlan: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationEvaluationPlan, aggregateByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, import("test/examples/flappy_bird/evaluation/evaluation.types").FlappySeedBatchEvaluation>, provisionalScoresByGenome: Map<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, number>, elitismCount: number) => void`
|
|
356
|
+
|
|
357
|
+
Executes the large-seed reevaluation stage over top candidates.
|
|
358
|
+
|
|
359
|
+
Parameters:
|
|
360
|
+
|
|
361
|
+
- `population` - - Current population.
|
|
362
|
+
- `generationEvaluationPlan` - - Per-generation staged evaluation plan.
|
|
363
|
+
- `aggregateByGenome` - - Mutable aggregate cache keyed by genome.
|
|
364
|
+
- `provisionalScoresByGenome` - - Mutable provisional score map.
|
|
365
|
+
- `elitismCount` - - Configured elitism count.
|
|
366
|
+
|
|
367
|
+
Returns: Nothing.
|
|
368
|
+
|
|
369
|
+
## trainer/trainer.report.service.services.ts
|
|
370
|
+
|
|
371
|
+
### collectFiniteGenomeScores
|
|
372
|
+
|
|
373
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[]) => number[]`
|
|
374
|
+
|
|
375
|
+
Collects only finite scores from the current population.
|
|
376
|
+
|
|
377
|
+
Unevaluated or invalid scores are intentionally skipped so percentile and
|
|
378
|
+
standard deviation calculations operate on stable numeric inputs only.
|
|
379
|
+
|
|
380
|
+
Parameters:
|
|
381
|
+
|
|
382
|
+
- `population` - - Current population.
|
|
383
|
+
|
|
384
|
+
Returns: Finite scores in population order.
|
|
385
|
+
|
|
386
|
+
### resolveBestGenerationDetails
|
|
387
|
+
|
|
388
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], bestGenome: import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork | undefined, aggregateByGenome: ReadonlyMap<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, import("test/examples/flappy_bird/evaluation/evaluation.types").FlappySeedBatchEvaluation>, fallbackSeeds: readonly number[], fallbackRolloutOptions: import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyRolloutOptions) => import("test/examples/flappy_bird/trainer/trainer.report.service.services").ResolvedBestGenerationDetails`
|
|
389
|
+
|
|
390
|
+
Resolves cached or fallback best-of-generation details for reporting.
|
|
391
|
+
|
|
392
|
+
The report layer needs both aggregate seed statistics and one representative
|
|
393
|
+
episode. This helper centralizes the fallback rules so the service facade can
|
|
394
|
+
remain a thin orchestration layer.
|
|
395
|
+
|
|
396
|
+
Parameters:
|
|
397
|
+
|
|
398
|
+
- `population` - - Current population.
|
|
399
|
+
- `bestGenome` - - Genome selected as generation best.
|
|
400
|
+
- `aggregateByGenome` - - Cached aggregate evaluations keyed by genome.
|
|
401
|
+
- `fallbackSeeds` - - Seeds used when the aggregate must be recomputed.
|
|
402
|
+
- `fallbackRolloutOptions` - - Rollout options for fallback evaluation.
|
|
403
|
+
|
|
404
|
+
Returns: Aggregate metrics and a representative best-genome episode.
|
|
405
|
+
|
|
406
|
+
### ResolvedBestGenerationDetails
|
|
407
|
+
|
|
408
|
+
Aggregate and representative rollout resolved for the best genome.
|
|
409
|
+
|
|
410
|
+
Keeping these values together lets the report facade stay focused on
|
|
411
|
+
orchestration while this helper module owns cache fallback behavior.
|
|
412
|
+
|
|
413
|
+
## trainer/trainer.reporting.utils.ts
|
|
414
|
+
|
|
415
|
+
### buildGenerationLogParts
|
|
416
|
+
|
|
417
|
+
`(generationLabel: number, bestFitness: number, bestPipesPassed: number, bestFramesSurvived: number, report: import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationReport | undefined, mutationSchedule: import("test/examples/flappy_bird/trainer/trainer.evaluation-plan.utils").FlappyMutationSchedule) => string[]`
|
|
418
|
+
|
|
419
|
+
Builds one-line generation log tokens.
|
|
420
|
+
|
|
421
|
+
Parameters:
|
|
422
|
+
|
|
423
|
+
- `generationLabel` - - Generation label shown in logs.
|
|
424
|
+
- `bestFitness` - - Best resolved fitness value for this generation.
|
|
425
|
+
- `bestPipesPassed` - - Best resolved pipes passed value.
|
|
426
|
+
- `bestFramesSurvived` - - Best resolved frames survived value.
|
|
427
|
+
- `report` - - Optional aggregated generation report.
|
|
428
|
+
- `mutationSchedule` - - Active mutation schedule for this generation.
|
|
429
|
+
|
|
430
|
+
Returns: Ordered log tokens for compact console output.
|
|
431
|
+
|
|
432
|
+
## trainer/trainer.selection.utils.ts
|
|
433
|
+
|
|
434
|
+
### resolveBestGenomeByScore
|
|
435
|
+
|
|
436
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[]) => import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork | undefined`
|
|
437
|
+
|
|
438
|
+
Resolves the best genome by current score.
|
|
439
|
+
|
|
440
|
+
Parameters:
|
|
441
|
+
|
|
442
|
+
- `population` - - Current trainer population.
|
|
443
|
+
|
|
444
|
+
Returns: Highest-scoring genome or `undefined` when population is empty.
|
|
445
|
+
|
|
446
|
+
### selectTopGenomesByScore
|
|
447
|
+
|
|
448
|
+
`(population: readonly import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[], provisionalScoresByGenome: ReadonlyMap<import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork, number>, targetCount: number) => import("test/examples/flappy_bird/trainer/trainer.types").FlappyTrainerNetwork[]`
|
|
449
|
+
|
|
450
|
+
Returns top genomes ordered by current provisional score.
|
|
451
|
+
|
|
452
|
+
Parameters:
|
|
453
|
+
|
|
454
|
+
- `population` - - Current trainer population.
|
|
455
|
+
- `provisionalScoresByGenome` - - Optional map of staged provisional scores.
|
|
456
|
+
- `targetCount` - - Maximum number of genomes to return.
|
|
457
|
+
|
|
458
|
+
Returns: Highest-scoring genomes in descending score order.
|
|
459
|
+
|
|
460
|
+
## trainer/trainer.evaluation-plan.utils.ts
|
|
461
|
+
|
|
462
|
+
### buildSharedSeedBatch
|
|
463
|
+
|
|
464
|
+
`(generationIndex: number, stageSalt: number, seedCount: number) => number[]`
|
|
465
|
+
|
|
466
|
+
Build deterministic shared seeds for one generation stage.
|
|
467
|
+
|
|
468
|
+
Parameters:
|
|
469
|
+
|
|
470
|
+
- `generationIndex` - - Zero-based generation index.
|
|
471
|
+
- `stageSalt` - - Constant stage-specific salt.
|
|
472
|
+
- `seedCount` - - Number of seeds to produce.
|
|
473
|
+
|
|
474
|
+
Returns: Deterministic shared seed list.
|
|
475
|
+
|
|
476
|
+
### createFullRolloutOptions
|
|
477
|
+
|
|
478
|
+
`(difficultyScale: number) => import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyRolloutOptions`
|
|
479
|
+
|
|
480
|
+
Builds full-stage rollout options.
|
|
481
|
+
|
|
482
|
+
Parameters:
|
|
483
|
+
|
|
484
|
+
- `difficultyScale` - - Difficulty scale for this generation.
|
|
485
|
+
|
|
486
|
+
Returns: Full stage rollout options.
|
|
487
|
+
|
|
488
|
+
### createQuickRolloutOptions
|
|
489
|
+
|
|
490
|
+
`(difficultyScale: number) => import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyRolloutOptions`
|
|
491
|
+
|
|
492
|
+
Builds quick-screen rollout options.
|
|
493
|
+
|
|
494
|
+
Parameters:
|
|
495
|
+
|
|
496
|
+
- `difficultyScale` - - Difficulty scale for this generation.
|
|
497
|
+
|
|
498
|
+
Returns: Quick stage rollout options.
|
|
499
|
+
|
|
500
|
+
### createReevaluationRolloutOptions
|
|
501
|
+
|
|
502
|
+
`(difficultyScale: number) => import("test/examples/flappy_bird/evaluation/evaluation.types").FlappyRolloutOptions`
|
|
503
|
+
|
|
504
|
+
Builds high-confidence reevaluation rollout options.
|
|
505
|
+
|
|
506
|
+
Parameters:
|
|
507
|
+
|
|
508
|
+
- `difficultyScale` - - Difficulty scale for this generation.
|
|
509
|
+
|
|
510
|
+
Returns: Reevaluation stage rollout options.
|
|
511
|
+
|
|
512
|
+
### FlappyMutationSchedule
|
|
513
|
+
|
|
514
|
+
Mutation schedule used by generation planning and outer loop logging.
|
|
515
|
+
|
|
516
|
+
### mixSeed
|
|
517
|
+
|
|
518
|
+
`(generationIndex: number, stageSalt: number) => number`
|
|
519
|
+
|
|
520
|
+
Mixes generation and stage salts into a deterministic uint32 RNG seed.
|
|
521
|
+
|
|
522
|
+
Parameters:
|
|
523
|
+
|
|
524
|
+
- `generationIndex` - - Current generation index.
|
|
525
|
+
- `stageSalt` - - Stage-specific salt.
|
|
526
|
+
|
|
527
|
+
Returns: Mixed uint32 seed.
|
|
528
|
+
|
|
529
|
+
### resolveCurriculumDifficultyScale
|
|
530
|
+
|
|
531
|
+
`(generationIndex: number) => number`
|
|
532
|
+
|
|
533
|
+
Resolve curriculum difficulty scale for the current generation.
|
|
534
|
+
|
|
535
|
+
Parameters:
|
|
536
|
+
|
|
537
|
+
- `generationIndex` - - Zero-based generation index.
|
|
538
|
+
|
|
539
|
+
Returns: Difficulty scale in [0, 1].
|
|
540
|
+
|
|
541
|
+
### resolveGenerationEvaluationPlan
|
|
542
|
+
|
|
543
|
+
`(generationIndex: number) => import("test/examples/flappy_bird/trainer/trainer.types").FlappyGenerationEvaluationPlan`
|
|
544
|
+
|
|
545
|
+
Resolves all per-generation evaluation controls.
|
|
546
|
+
|
|
547
|
+
Parameters:
|
|
548
|
+
|
|
549
|
+
- `generationIndex` - - Zero-based generation index.
|
|
550
|
+
|
|
551
|
+
Returns: Full staged evaluation plan for the generation.
|
|
552
|
+
|
|
553
|
+
### resolveMutationSchedule
|
|
554
|
+
|
|
555
|
+
`(generationIndex: number) => import("test/examples/flappy_bird/trainer/trainer.evaluation-plan.utils").FlappyMutationSchedule`
|
|
556
|
+
|
|
557
|
+
Resolve a smooth mutation annealing schedule.
|
|
558
|
+
|
|
559
|
+
Parameters:
|
|
560
|
+
|
|
561
|
+
- `generationIndex` - - Zero-based generation index.
|
|
562
|
+
|
|
563
|
+
Returns: Mutation rate and mutation amount for this generation.
|