@reicek/neataptic-ts 0.1.25 → 0.1.26
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 +11 -0
- package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
- package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
- package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
- package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
- package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
- package/package.json +19 -13
- package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
- package/plans/README.md +24 -0
- package/plans/Roadmap.md +62 -40
- package/plans/analyze-trace-solid-split.plans.md +66 -0
- package/plans/architecture-solid-split.plans.md +9 -15
- package/plans/asciiMaze-typescript-repair.plans.md +1 -1
- package/plans/generate-docs-solid-split.plans.md +87 -0
- package/plans/methods-docs.plans.md +25 -1
- package/plans/methods-solid-split.plans.md +14 -14
- package/plans/neat-docs.plans.md +9 -1
- package/plans/neat-test-surface-repair.plans.md +1 -1
- package/plans/render-docs-html-solid-split.plans.md +68 -0
- package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
- package/plans/utils-docs.plans.md +6 -1
- package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
- package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
- package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
- package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
- package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
- package/scripts/analyze-trace/analyze-trace.ts +45 -0
- package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
- package/scripts/assets/theme.css +80 -23
- package/scripts/copy-examples.ts +239 -0
- package/scripts/export-onnx.ts +223 -0
- package/scripts/generate-bench-tables.ts +378 -37
- package/scripts/generate-docs/generate-docs.constants.ts +107 -0
- package/scripts/generate-docs/generate-docs.order.ts +355 -0
- package/scripts/generate-docs/generate-docs.state.ts +31 -0
- package/scripts/generate-docs/generate-docs.targets.ts +165 -0
- package/scripts/generate-docs/generate-docs.ts +63 -0
- package/scripts/generate-docs/generate-docs.types.ts +112 -0
- package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
- package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
- package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
- package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
- package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
- package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
- package/scripts/mermaid-cli.mjs +102 -22
- package/scripts/mermaid-cli.ts +736 -0
- package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
- package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
- package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
- package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
- package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
- package/scripts/render-docs-html.ts +23 -587
- package/scripts/run-docs.ts +238 -0
- package/scripts/write-dist-docs-pkg.ts +40 -0
- package/src/README.md +75 -75
- package/src/architecture/connection/README.md +5 -5
- package/src/architecture/layer/README.md +508 -508
- package/src/architecture/network/README.md +1458 -1458
- package/src/architecture/network/activate/README.md +694 -694
- package/src/architecture/network/bootstrap/README.md +77 -77
- package/src/architecture/network/connect/README.md +74 -74
- package/src/architecture/network/deterministic/README.md +135 -135
- package/src/architecture/network/evolve/README.md +364 -364
- package/src/architecture/network/gating/README.md +130 -130
- package/src/architecture/network/genetic/README.md +399 -399
- package/src/architecture/network/mutate/README.md +897 -897
- package/src/architecture/network/onnx/README.md +720 -720
- package/src/architecture/network/onnx/export/README.md +728 -728
- package/src/architecture/network/onnx/export/layers/README.md +450 -450
- package/src/architecture/network/onnx/import/README.md +618 -618
- package/src/architecture/network/onnx/schema/README.md +32 -32
- package/src/architecture/network/prune/README.md +245 -245
- package/src/architecture/network/remove/README.md +135 -135
- package/src/architecture/network/runtime/README.md +106 -106
- package/src/architecture/network/serialize/README.md +542 -542
- package/src/architecture/network/slab/README.md +608 -608
- package/src/architecture/network/standalone/README.md +212 -212
- package/src/architecture/network/stats/README.md +84 -84
- package/src/architecture/network/topology/README.md +465 -465
- package/src/architecture/network/training/README.md +200 -200
- package/src/architecture/node/README.md +5 -5
- package/src/architecture/nodePool/README.md +14 -14
- package/src/methods/README.md +99 -99
- package/src/methods/activation/README.md +189 -189
- package/src/methods/cost/README.md +131 -131
- package/src/methods/rate/README.md +86 -86
- package/src/multithreading/README.md +77 -77
- package/src/multithreading/workers/browser/README.md +8 -8
- package/src/multithreading/workers/node/README.md +8 -8
- package/src/neat/README.md +148 -148
- package/src/neat/adaptive/README.md +120 -120
- package/src/neat/adaptive/acceptance/README.md +40 -40
- package/src/neat/adaptive/complexity/README.md +137 -137
- package/src/neat/adaptive/core/README.md +197 -197
- package/src/neat/adaptive/lineage/README.md +90 -90
- package/src/neat/adaptive/mutation/README.md +284 -284
- package/src/neat/compat/README.md +43 -43
- package/src/neat/compat/core/README.md +90 -90
- package/src/neat/diversity/README.md +35 -35
- package/src/neat/diversity/core/README.md +88 -88
- package/src/neat/evaluate/README.md +85 -85
- package/src/neat/evaluate/auto-distance/README.md +75 -75
- package/src/neat/evaluate/entropy-compat/README.md +37 -37
- package/src/neat/evaluate/entropy-sharing/README.md +43 -43
- package/src/neat/evaluate/fitness/README.md +23 -23
- package/src/neat/evaluate/novelty/README.md +120 -120
- package/src/neat/evaluate/objectives/README.md +17 -17
- package/src/neat/evaluate/shared/README.md +94 -94
- package/src/neat/evolve/README.md +96 -96
- package/src/neat/evolve/adaptive/README.md +60 -60
- package/src/neat/evolve/objectives/README.md +63 -63
- package/src/neat/evolve/offspring/README.md +56 -56
- package/src/neat/evolve/population/README.md +171 -171
- package/src/neat/evolve/runtime/README.md +79 -79
- package/src/neat/evolve/speciation/README.md +74 -74
- package/src/neat/evolve/warnings/README.md +10 -10
- package/src/neat/export/README.md +114 -114
- package/src/neat/helpers/README.md +50 -50
- package/src/neat/init/README.md +9 -9
- package/src/neat/lineage/core/README.md +101 -101
- package/src/neat/multiobjective/category/README.md +74 -74
- package/src/neat/multiobjective/crowding/README.md +272 -272
- package/src/neat/multiobjective/dominance/README.md +171 -171
- package/src/neat/multiobjective/fronts/README.md +68 -68
- package/src/neat/multiobjective/metrics/README.md +43 -43
- package/src/neat/multiobjective/objectives/README.md +31 -31
- package/src/neat/multiobjective/shared/README.md +27 -27
- package/src/neat/mutation/README.md +97 -97
- package/src/neat/mutation/add-conn/README.md +115 -115
- package/src/neat/mutation/add-node/README.md +126 -126
- package/src/neat/mutation/flow/README.md +149 -149
- package/src/neat/mutation/repair/README.md +185 -185
- package/src/neat/mutation/select/README.md +117 -117
- package/src/neat/mutation/shared/README.md +32 -32
- package/src/neat/objectives/README.md +25 -25
- package/src/neat/objectives/core/README.md +67 -67
- package/src/neat/pruning/README.md +40 -40
- package/src/neat/pruning/core/README.md +171 -171
- package/src/neat/pruning/facade/README.md +32 -32
- package/src/neat/rng/README.md +104 -104
- package/src/neat/rng/core/README.md +137 -137
- package/src/neat/rng/facade/README.md +50 -50
- package/src/neat/selection/README.md +111 -111
- package/src/neat/selection/core/README.md +227 -227
- package/src/neat/selection/facade/README.md +61 -61
- package/src/neat/shared/README.md +163 -163
- package/src/neat/speciation/README.md +31 -31
- package/src/neat/speciation/threshold/README.md +35 -35
- package/src/neat/species/README.md +25 -25
- package/src/neat/species/core/README.md +20 -20
- package/src/neat/species/core/shared/README.md +18 -18
- package/src/neat/species/history/context/README.md +22 -22
- package/src/neat/telemetry/accessors/README.md +58 -58
- package/src/neat/telemetry/exports/README.md +233 -233
- package/src/neat/telemetry/facade/README.md +252 -252
- package/src/neat/telemetry/facade/archive/README.md +57 -57
- package/src/neat/telemetry/facade/buffer/README.md +43 -43
- package/src/neat/telemetry/facade/lineage/README.md +12 -12
- package/src/neat/telemetry/facade/objectives/README.md +44 -44
- package/src/neat/telemetry/facade/runtime/README.md +26 -26
- package/src/neat/telemetry/facade/species/README.md +27 -27
- package/src/neat/telemetry/metrics/README.md +696 -696
- package/src/neat/telemetry/recorder/README.md +57 -57
- package/src/neat/telemetry/types/README.md +32 -32
- package/src/neat/topology-intent/README.md +75 -75
- package/src/utils/README.md +193 -193
- package/test/examples/asciiMaze/browser-entry/README.md +92 -92
- package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
- package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
- package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
- package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
- package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
- package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
- package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
- package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
- package/test/examples/flappy_bird/browser-entry/README.md +508 -508
- package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
- package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
- package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
- package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
- package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
- package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
- package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
- package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
- package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
- package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
- package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
- package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
- package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
- package/test/examples/flappy_bird/constants/README.md +1070 -1070
- package/test/examples/flappy_bird/environment/README.md +22 -22
- package/test/examples/flappy_bird/evaluation/README.md +32 -32
- package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
- package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
- package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
- package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
- package/test/examples/flappy_bird/trainer/README.md +325 -325
- package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
- package/scripts/analyze-trace.ts +0 -590
- package/scripts/copy-examples.mjs +0 -114
- package/scripts/export-onnx.mjs +0 -86
- package/scripts/generate-bench-tables.mjs +0 -182
- package/scripts/generate-docs.ts +0 -2900
- package/scripts/write-dist-docs-pkg.mjs +0 -16
|
@@ -12,89 +12,89 @@ high-level control surface for mutation flow.
|
|
|
12
12
|
|
|
13
13
|
## architecture/network/mutate/network.mutate.utils.types.ts
|
|
14
14
|
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
Canonical node-type literal for input nodes.
|
|
18
|
-
|
|
19
|
-
### NODE_TYPE_OUTPUT
|
|
15
|
+
### BATCH_NORM_FLAG_KEY
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
Internal node field used to enable batch normalization.
|
|
22
18
|
|
|
23
|
-
###
|
|
19
|
+
### DEFAULT_MUTATION_MAX
|
|
24
20
|
|
|
25
|
-
|
|
21
|
+
Default maximum mutation value when no method override is provided.
|
|
26
22
|
|
|
27
|
-
###
|
|
23
|
+
### DEFAULT_MUTATION_MIN
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
Default minimum mutation value when no method override is provided.
|
|
30
26
|
|
|
31
|
-
###
|
|
27
|
+
### ERROR_NO_MUTATE_METHOD
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
Error emitted when mutate is called without a valid method.
|
|
34
30
|
|
|
35
|
-
###
|
|
31
|
+
### GATE_REASSIGN_THRESHOLD
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
Threshold used for random 50/50 gating decisions.
|
|
38
34
|
|
|
39
|
-
###
|
|
35
|
+
### MIN_REDUNDANT_CONNECTION_COUNT
|
|
40
36
|
|
|
41
|
-
|
|
37
|
+
Minimum redundant in/out degree required before removing a connection.
|
|
42
38
|
|
|
43
|
-
###
|
|
39
|
+
### MIN_SWAPPABLE_NODE_COUNT
|
|
44
40
|
|
|
45
|
-
|
|
41
|
+
Minimum node count required to perform swap-node mutation.
|
|
46
42
|
|
|
47
|
-
###
|
|
43
|
+
### NODE_TYPE_HIDDEN
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
Canonical node-type literal for hidden nodes.
|
|
50
46
|
|
|
51
|
-
###
|
|
47
|
+
### NODE_TYPE_INPUT
|
|
52
48
|
|
|
53
|
-
|
|
49
|
+
Canonical node-type literal for input nodes.
|
|
54
50
|
|
|
55
|
-
###
|
|
51
|
+
### NODE_TYPE_OUTPUT
|
|
56
52
|
|
|
57
|
-
|
|
53
|
+
Canonical node-type literal for output nodes.
|
|
58
54
|
|
|
59
|
-
###
|
|
55
|
+
### RECURRENT_BLOCK_GRU
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
Canonical recurrent block literal for GRU expansion.
|
|
62
58
|
|
|
63
|
-
###
|
|
59
|
+
### RECURRENT_BLOCK_LSTM
|
|
64
60
|
|
|
65
|
-
|
|
61
|
+
Canonical recurrent block literal for LSTM expansion.
|
|
66
62
|
|
|
67
|
-
###
|
|
63
|
+
### SINGLE_UNIT_RECURRENT_BLOCK_WIDTH
|
|
68
64
|
|
|
69
|
-
|
|
65
|
+
Width used when creating a minimal recurrent block.
|
|
70
66
|
|
|
71
|
-
###
|
|
67
|
+
### SUB_NODE_STABILITY_WEIGHT_DELTA
|
|
72
68
|
|
|
73
|
-
|
|
69
|
+
Weight delta used to keep mutation side effects numerically observable.
|
|
74
70
|
|
|
75
|
-
###
|
|
71
|
+
### UNKNOWN_MUTATION_WARNING_PREFIX
|
|
76
72
|
|
|
77
|
-
|
|
73
|
+
Prefix for unknown-mutation warning logs.
|
|
78
74
|
|
|
79
75
|
### WARNING_ALL_CONNECTIONS_GATED
|
|
80
76
|
|
|
81
77
|
Message emitted when gating cannot be added because all are already gated.
|
|
82
78
|
|
|
79
|
+
### WARNING_NO_ACTIVATION_MUTATION_TARGETS
|
|
80
|
+
|
|
81
|
+
Message emitted when activation mutation has no eligible nodes.
|
|
82
|
+
|
|
83
83
|
### WARNING_NO_GATED_CONNECTIONS_TO_REMOVE
|
|
84
84
|
|
|
85
85
|
Message emitted when no gate exists to remove.
|
|
86
86
|
|
|
87
|
-
###
|
|
87
|
+
### WARNING_NO_HIDDEN_NODES_TO_REMOVE
|
|
88
88
|
|
|
89
|
-
|
|
89
|
+
Message emitted when no hidden node can be removed.
|
|
90
90
|
|
|
91
|
-
###
|
|
91
|
+
### WARNING_NO_SELF_CONNECTIONS_TO_REMOVE
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
Message emitted when no self-connections are available to remove.
|
|
94
94
|
|
|
95
|
-
###
|
|
95
|
+
### WARNING_SELF_CONNECTIONS_ALREADY_PRESENT
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
Message emitted when all self-connection candidates are already occupied.
|
|
98
98
|
|
|
99
99
|
## architecture/network/mutate/network.mutate.utils.ts
|
|
100
100
|
|
|
@@ -172,49 +172,20 @@ Responsibilities:
|
|
|
172
172
|
The helpers in this module are intentionally side-effect-light, except for optional
|
|
173
173
|
warning emission, so orchestration code can remain deterministic and easy to inspect.
|
|
174
174
|
|
|
175
|
-
###
|
|
175
|
+
### findMutationKeyByIdentityReference
|
|
176
176
|
|
|
177
177
|
```ts
|
|
178
|
-
|
|
178
|
+
findMutationKeyByIdentityReference(
|
|
179
179
|
method: MutationMethod,
|
|
180
180
|
): string | undefined
|
|
181
181
|
```
|
|
182
182
|
|
|
183
|
-
Resolves a mutation
|
|
184
|
-
|
|
185
|
-
Resolution order:
|
|
186
|
-
1. Use string input directly.
|
|
187
|
-
2. Use direct object identity fields (`name`, `type`, `identity`).
|
|
188
|
-
3. Fall back to identity-reference comparison against known mutation objects.
|
|
189
|
-
|
|
190
|
-
Parameters:
|
|
191
|
-
- `method` - - Mutation method input.
|
|
192
|
-
|
|
193
|
-
Returns: Dispatch key or undefined.
|
|
194
|
-
|
|
195
|
-
Example:
|
|
196
|
-
|
|
197
|
-
```ts
|
|
198
|
-
const key = resolveMutationKey('ADD_NODE');
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
### warnUnknownMutation
|
|
202
|
-
|
|
203
|
-
```ts
|
|
204
|
-
warnUnknownMutation(
|
|
205
|
-
mutationKey: string | undefined,
|
|
206
|
-
): void
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
Emits unknown-mutation warning when configured.
|
|
210
|
-
|
|
211
|
-
This helper intentionally no-ops when warnings are disabled so callers can invoke it
|
|
212
|
-
without repeating feature-flag checks.
|
|
183
|
+
Resolves a mutation key by direct identity-reference comparison.
|
|
213
184
|
|
|
214
185
|
Parameters:
|
|
215
|
-
- `
|
|
186
|
+
- `method` - - Mutation object reference.
|
|
216
187
|
|
|
217
|
-
Returns:
|
|
188
|
+
Returns: Matching mutation key or undefined.
|
|
218
189
|
|
|
219
190
|
### isMutationMethodKeyString
|
|
220
191
|
|
|
@@ -231,50 +202,79 @@ Parameters:
|
|
|
231
202
|
|
|
232
203
|
Returns: True when method is a key string.
|
|
233
204
|
|
|
234
|
-
###
|
|
205
|
+
### resolveDirectMutationKey
|
|
235
206
|
|
|
236
207
|
```ts
|
|
237
|
-
|
|
208
|
+
resolveDirectMutationKey(
|
|
238
209
|
methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
|
|
239
210
|
): string | undefined
|
|
240
211
|
```
|
|
241
212
|
|
|
242
|
-
Resolves
|
|
213
|
+
Resolves direct object fields that can represent a mutation key.
|
|
243
214
|
|
|
244
215
|
Parameters:
|
|
245
216
|
- `methodObject` - - Mutation method object.
|
|
246
217
|
|
|
218
|
+
Returns: Direct key or undefined.
|
|
219
|
+
|
|
220
|
+
### resolveMutationKey
|
|
221
|
+
|
|
222
|
+
```ts
|
|
223
|
+
resolveMutationKey(
|
|
224
|
+
method: MutationMethod,
|
|
225
|
+
): string | undefined
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Resolves a mutation dispatch key from user-provided method input.
|
|
229
|
+
|
|
230
|
+
Resolution order:
|
|
231
|
+
1. Use string input directly.
|
|
232
|
+
2. Use direct object identity fields (`name`, `type`, `identity`).
|
|
233
|
+
3. Fall back to identity-reference comparison against known mutation objects.
|
|
234
|
+
|
|
235
|
+
Parameters:
|
|
236
|
+
- `method` - - Mutation method input.
|
|
237
|
+
|
|
247
238
|
Returns: Dispatch key or undefined.
|
|
248
239
|
|
|
249
|
-
|
|
240
|
+
Example:
|
|
250
241
|
|
|
251
242
|
```ts
|
|
252
|
-
|
|
243
|
+
const key = resolveMutationKey('ADD_NODE');
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### resolveMutationKeyFromObject
|
|
247
|
+
|
|
248
|
+
```ts
|
|
249
|
+
resolveMutationKeyFromObject(
|
|
253
250
|
methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
|
|
254
251
|
): string | undefined
|
|
255
252
|
```
|
|
256
253
|
|
|
257
|
-
Resolves
|
|
254
|
+
Resolves mutation key from object-form descriptor.
|
|
258
255
|
|
|
259
256
|
Parameters:
|
|
260
257
|
- `methodObject` - - Mutation method object.
|
|
261
258
|
|
|
262
|
-
Returns:
|
|
259
|
+
Returns: Dispatch key or undefined.
|
|
263
260
|
|
|
264
|
-
###
|
|
261
|
+
### warnUnknownMutation
|
|
265
262
|
|
|
266
263
|
```ts
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
):
|
|
264
|
+
warnUnknownMutation(
|
|
265
|
+
mutationKey: string | undefined,
|
|
266
|
+
): void
|
|
270
267
|
```
|
|
271
268
|
|
|
272
|
-
|
|
269
|
+
Emits unknown-mutation warning when configured.
|
|
270
|
+
|
|
271
|
+
This helper intentionally no-ops when warnings are disabled so callers can invoke it
|
|
272
|
+
without repeating feature-flag checks.
|
|
273
273
|
|
|
274
274
|
Parameters:
|
|
275
|
-
- `
|
|
275
|
+
- `mutationKey` - - Resolved mutation key.
|
|
276
276
|
|
|
277
|
-
Returns:
|
|
277
|
+
Returns: Nothing.
|
|
278
278
|
|
|
279
279
|
## architecture/network/mutate/network.mutate.handlers.utils.ts
|
|
280
280
|
|
|
@@ -291,911 +291,894 @@ Behavioral notes:
|
|
|
291
291
|
- Acyclic mode checks are enforced in handlers that could introduce recurrence.
|
|
292
292
|
- Randomness is sourced from network mutation internals for reproducible deterministic flows.
|
|
293
293
|
|
|
294
|
-
###
|
|
294
|
+
### addBackConn
|
|
295
295
|
|
|
296
296
|
```ts
|
|
297
|
-
|
|
297
|
+
addBackConn(): void
|
|
298
298
|
```
|
|
299
299
|
|
|
300
|
-
Adds one
|
|
300
|
+
Adds one backward (recurrent) connection between eligible node pairs.
|
|
301
301
|
|
|
302
|
-
|
|
303
|
-
- Deterministic chain mode grows a linear input→...→output chain.
|
|
304
|
-
- Standard mode splits a randomly selected forward connection.
|
|
302
|
+
This operation is skipped in acyclic mode.
|
|
305
303
|
|
|
306
304
|
Parameters:
|
|
307
305
|
- `this` - - Bound network.
|
|
308
306
|
|
|
309
307
|
Returns: Nothing.
|
|
310
308
|
|
|
311
|
-
###
|
|
309
|
+
### addConn
|
|
312
310
|
|
|
313
311
|
```ts
|
|
314
|
-
|
|
312
|
+
addConn(): void
|
|
315
313
|
```
|
|
316
314
|
|
|
317
|
-
|
|
315
|
+
Adds one forward connection between currently unconnected eligible node pairs.
|
|
318
316
|
|
|
319
|
-
|
|
320
|
-
where node removal substantially changes effective signal flow.
|
|
317
|
+
Candidate generation respects node ordering so the added edge is feed-forward.
|
|
321
318
|
|
|
322
319
|
Parameters:
|
|
323
320
|
- `this` - - Bound network.
|
|
324
321
|
|
|
325
322
|
Returns: Nothing.
|
|
326
323
|
|
|
327
|
-
###
|
|
324
|
+
### addGate
|
|
328
325
|
|
|
329
326
|
```ts
|
|
330
|
-
|
|
327
|
+
addGate(): void
|
|
331
328
|
```
|
|
332
329
|
|
|
333
|
-
|
|
330
|
+
Assigns a random eligible node as gater for a random ungated connection.
|
|
334
331
|
|
|
335
|
-
Candidate
|
|
332
|
+
Candidate pool includes normal and self-connections.
|
|
336
333
|
|
|
337
334
|
Parameters:
|
|
338
335
|
- `this` - - Bound network.
|
|
339
336
|
|
|
340
337
|
Returns: Nothing.
|
|
341
338
|
|
|
342
|
-
###
|
|
339
|
+
### addGRUNode
|
|
343
340
|
|
|
344
341
|
```ts
|
|
345
|
-
|
|
342
|
+
addGRUNode(): void
|
|
346
343
|
```
|
|
347
344
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
Constraints require endpoint redundancy and avoid disconnecting peer-layer groups.
|
|
345
|
+
Replaces one connection by inserting a minimal GRU recurrent block.
|
|
351
346
|
|
|
352
347
|
Parameters:
|
|
353
348
|
- `this` - - Bound network.
|
|
354
349
|
|
|
355
350
|
Returns: Nothing.
|
|
356
351
|
|
|
357
|
-
###
|
|
352
|
+
### addLSTMNode
|
|
358
353
|
|
|
359
354
|
```ts
|
|
360
|
-
|
|
361
|
-
method: MutationMethod | undefined,
|
|
362
|
-
): void
|
|
355
|
+
addLSTMNode(): void
|
|
363
356
|
```
|
|
364
357
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
The candidate pool includes standard and self-connections.
|
|
358
|
+
Replaces one connection by inserting a minimal LSTM recurrent block.
|
|
368
359
|
|
|
369
360
|
Parameters:
|
|
370
361
|
- `this` - - Bound network.
|
|
371
|
-
- `method` - - Optional method descriptor.
|
|
372
362
|
|
|
373
363
|
Returns: Nothing.
|
|
374
364
|
|
|
375
|
-
###
|
|
365
|
+
### addNode
|
|
376
366
|
|
|
377
367
|
```ts
|
|
378
|
-
|
|
379
|
-
method: MutationMethod | undefined,
|
|
380
|
-
): void
|
|
368
|
+
addNode(): void
|
|
381
369
|
```
|
|
382
370
|
|
|
383
|
-
|
|
371
|
+
Adds one hidden node by splitting an existing connection.
|
|
384
372
|
|
|
385
|
-
|
|
373
|
+
Execution modes:
|
|
374
|
+
- Deterministic chain mode grows a linear input→...→output chain.
|
|
375
|
+
- Standard mode splits a randomly selected forward connection.
|
|
386
376
|
|
|
387
377
|
Parameters:
|
|
388
378
|
- `this` - - Bound network.
|
|
389
|
-
- `method` - - Optional method descriptor.
|
|
390
379
|
|
|
391
380
|
Returns: Nothing.
|
|
392
381
|
|
|
393
|
-
###
|
|
382
|
+
### addNodeDeterministicChain
|
|
394
383
|
|
|
395
384
|
```ts
|
|
396
|
-
|
|
397
|
-
|
|
385
|
+
addNodeDeterministicChain(
|
|
386
|
+
network: default,
|
|
387
|
+
mutationProps: NetworkMutationProps,
|
|
398
388
|
): void
|
|
399
389
|
```
|
|
400
390
|
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
Output-node eligibility is controlled by `method.mutateOutput` when provided.
|
|
391
|
+
Applies deterministic chain-growth ADD_NODE mutation.
|
|
404
392
|
|
|
405
393
|
Parameters:
|
|
406
|
-
- `
|
|
407
|
-
- `
|
|
394
|
+
- `network` - - Target network.
|
|
395
|
+
- `mutationProps` - - Runtime mutation props.
|
|
408
396
|
|
|
409
397
|
Returns: Nothing.
|
|
410
398
|
|
|
411
|
-
###
|
|
399
|
+
### addNodeRandomSplit
|
|
412
400
|
|
|
413
401
|
```ts
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
402
|
+
addNodeRandomSplit(
|
|
403
|
+
network: default,
|
|
404
|
+
mutationProps: NetworkMutationProps,
|
|
405
|
+
): void
|
|
406
|
+
```
|
|
418
407
|
|
|
419
|
-
|
|
408
|
+
Applies non-deterministic ADD_NODE by splitting a random connection.
|
|
420
409
|
|
|
421
410
|
Parameters:
|
|
422
|
-
- `
|
|
411
|
+
- `network` - - Target network.
|
|
412
|
+
- `mutationProps` - - Runtime mutation props.
|
|
423
413
|
|
|
424
414
|
Returns: Nothing.
|
|
425
415
|
|
|
426
|
-
###
|
|
416
|
+
### addRecurrentNode
|
|
427
417
|
|
|
428
418
|
```ts
|
|
429
|
-
|
|
419
|
+
addRecurrentNode(
|
|
420
|
+
network: default,
|
|
421
|
+
blockType: "lstm" | "gru",
|
|
422
|
+
): void
|
|
430
423
|
```
|
|
431
424
|
|
|
432
|
-
|
|
425
|
+
Shared orchestrator for recurrent-node mutation variants.
|
|
433
426
|
|
|
434
427
|
Parameters:
|
|
435
|
-
- `
|
|
428
|
+
- `network` - - Target network.
|
|
429
|
+
- `blockType` - - Recurrent block type.
|
|
436
430
|
|
|
437
431
|
Returns: Nothing.
|
|
438
432
|
|
|
439
|
-
###
|
|
433
|
+
### addSelfConn
|
|
440
434
|
|
|
441
435
|
```ts
|
|
442
|
-
|
|
436
|
+
addSelfConn(): void
|
|
443
437
|
```
|
|
444
438
|
|
|
445
|
-
|
|
439
|
+
Adds one self-connection on an eligible node that does not already have one.
|
|
446
440
|
|
|
447
|
-
|
|
441
|
+
This operation is skipped in acyclic mode.
|
|
448
442
|
|
|
449
443
|
Parameters:
|
|
450
444
|
- `this` - - Bound network.
|
|
451
445
|
|
|
452
446
|
Returns: Nothing.
|
|
453
447
|
|
|
454
|
-
###
|
|
448
|
+
### appendRecurrentLayerNodes
|
|
455
449
|
|
|
456
450
|
```ts
|
|
457
|
-
|
|
451
|
+
appendRecurrentLayerNodes(
|
|
452
|
+
network: default,
|
|
453
|
+
layerNodes: default[],
|
|
454
|
+
): void
|
|
458
455
|
```
|
|
459
456
|
|
|
460
|
-
|
|
457
|
+
Appends recurrent layer nodes as hidden nodes.
|
|
461
458
|
|
|
462
459
|
Parameters:
|
|
463
|
-
- `
|
|
460
|
+
- `network` - - Target network.
|
|
461
|
+
- `layerNodes` - - Layer nodes.
|
|
464
462
|
|
|
465
463
|
Returns: Nothing.
|
|
466
464
|
|
|
467
|
-
###
|
|
465
|
+
### applyFirstConnectionStabilityNudge
|
|
468
466
|
|
|
469
467
|
```ts
|
|
470
|
-
|
|
468
|
+
applyFirstConnectionStabilityNudge(
|
|
469
|
+
network: default,
|
|
470
|
+
): void
|
|
471
471
|
```
|
|
472
472
|
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
This operation is skipped in acyclic mode.
|
|
473
|
+
Applies tiny stability nudge to the first remaining connection.
|
|
476
474
|
|
|
477
475
|
Parameters:
|
|
478
|
-
- `
|
|
476
|
+
- `network` - - Target network.
|
|
479
477
|
|
|
480
478
|
Returns: Nothing.
|
|
481
479
|
|
|
482
|
-
###
|
|
480
|
+
### asMutationProps
|
|
483
481
|
|
|
484
482
|
```ts
|
|
485
|
-
|
|
483
|
+
asMutationProps(
|
|
484
|
+
network: default,
|
|
485
|
+
): NetworkMutationProps
|
|
486
486
|
```
|
|
487
487
|
|
|
488
|
-
|
|
488
|
+
Converts a network to its internal mutation runtime shape.
|
|
489
489
|
|
|
490
490
|
Parameters:
|
|
491
|
-
- `
|
|
491
|
+
- `network` - - Network to convert.
|
|
492
492
|
|
|
493
|
-
Returns:
|
|
493
|
+
Returns: Runtime mutation props.
|
|
494
494
|
|
|
495
|
-
###
|
|
495
|
+
### batchNorm
|
|
496
496
|
|
|
497
497
|
```ts
|
|
498
|
-
|
|
499
|
-
method: MutationMethod | undefined,
|
|
500
|
-
): void
|
|
498
|
+
batchNorm(): void
|
|
501
499
|
```
|
|
502
500
|
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
This provides a lightweight structural-parameter recombination without changing
|
|
506
|
-
graph connectivity.
|
|
501
|
+
Enables the internal batch-normalization flag on one random hidden node.
|
|
507
502
|
|
|
508
503
|
Parameters:
|
|
509
504
|
- `this` - - Bound network.
|
|
510
|
-
- `method` - - Optional method descriptor.
|
|
511
505
|
|
|
512
506
|
Returns: Nothing.
|
|
513
507
|
|
|
514
|
-
###
|
|
508
|
+
### collectAllConnections
|
|
515
509
|
|
|
516
510
|
```ts
|
|
517
|
-
|
|
511
|
+
collectAllConnections(
|
|
512
|
+
network: default,
|
|
513
|
+
): default[]
|
|
518
514
|
```
|
|
519
515
|
|
|
520
|
-
|
|
516
|
+
Collects normal and self connections.
|
|
521
517
|
|
|
522
518
|
Parameters:
|
|
523
|
-
- `
|
|
519
|
+
- `network` - - Target network.
|
|
524
520
|
|
|
525
|
-
Returns:
|
|
521
|
+
Returns: Combined connections.
|
|
526
522
|
|
|
527
|
-
###
|
|
523
|
+
### collectBackwardCandidatesForLaterNode
|
|
528
524
|
|
|
529
525
|
```ts
|
|
530
|
-
|
|
526
|
+
collectBackwardCandidatesForLaterNode(
|
|
527
|
+
traversalContext: BackwardCandidateTraversalContext,
|
|
528
|
+
): NodePair[]
|
|
531
529
|
```
|
|
532
530
|
|
|
533
|
-
|
|
531
|
+
Collects all backward candidates for one later-node traversal context.
|
|
534
532
|
|
|
535
533
|
Parameters:
|
|
536
|
-
- `
|
|
534
|
+
- `traversalContext` - - Later-node traversal context.
|
|
537
535
|
|
|
538
|
-
Returns:
|
|
536
|
+
Returns: Candidate source/target pairs.
|
|
539
537
|
|
|
540
|
-
###
|
|
538
|
+
### collectBackwardCandidatesFromContext
|
|
541
539
|
|
|
542
540
|
```ts
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
541
|
+
collectBackwardCandidatesFromContext(
|
|
542
|
+
backwardConnectionCandidates: NodePair[],
|
|
543
|
+
traversalContext: BackwardCandidateTraversalContext,
|
|
544
|
+
): NodePair[]
|
|
546
545
|
```
|
|
547
546
|
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
Weight sampling bounds come from method overrides or default mutation bounds.
|
|
547
|
+
Reduces one backward traversal context into candidate connection pairs.
|
|
551
548
|
|
|
552
549
|
Parameters:
|
|
553
|
-
- `
|
|
554
|
-
- `
|
|
550
|
+
- `backwardConnectionCandidates` - - Existing candidate pairs.
|
|
551
|
+
- `traversalContext` - - Later-node traversal context.
|
|
555
552
|
|
|
556
|
-
Returns:
|
|
553
|
+
Returns: Updated candidate pairs.
|
|
557
554
|
|
|
558
|
-
###
|
|
555
|
+
### collectBackwardConnectionCandidates
|
|
559
556
|
|
|
560
557
|
```ts
|
|
561
|
-
|
|
558
|
+
collectBackwardConnectionCandidates(
|
|
559
|
+
network: default,
|
|
560
|
+
): NodePair[]
|
|
562
561
|
```
|
|
563
562
|
|
|
564
|
-
|
|
563
|
+
Collects backward (recurrent) connection candidates.
|
|
565
564
|
|
|
566
565
|
Parameters:
|
|
567
|
-
- `
|
|
566
|
+
- `network` - - Target network.
|
|
568
567
|
|
|
569
|
-
Returns:
|
|
568
|
+
Returns: Candidate source/target pairs.
|
|
570
569
|
|
|
571
|
-
###
|
|
570
|
+
### collectBackwardTraversalContexts
|
|
572
571
|
|
|
573
572
|
```ts
|
|
574
|
-
|
|
573
|
+
collectBackwardTraversalContexts(
|
|
575
574
|
network: default,
|
|
576
|
-
):
|
|
575
|
+
): BackwardCandidateTraversalContext[]
|
|
577
576
|
```
|
|
578
577
|
|
|
579
|
-
|
|
578
|
+
Collects backward traversal contexts for all eligible later nodes.
|
|
580
579
|
|
|
581
580
|
Parameters:
|
|
582
|
-
- `network` - -
|
|
581
|
+
- `network` - - Target network.
|
|
583
582
|
|
|
584
|
-
Returns:
|
|
583
|
+
Returns: Backward traversal contexts.
|
|
585
584
|
|
|
586
|
-
###
|
|
585
|
+
### collectConnectionGroupsForReinit
|
|
587
586
|
|
|
588
587
|
```ts
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
):
|
|
588
|
+
collectConnectionGroupsForReinit(
|
|
589
|
+
targetNode: default,
|
|
590
|
+
): default[][]
|
|
592
591
|
```
|
|
593
592
|
|
|
594
|
-
|
|
593
|
+
Collects all connection groups affected by REINIT_WEIGHT.
|
|
595
594
|
|
|
596
595
|
Parameters:
|
|
597
|
-
- `
|
|
596
|
+
- `targetNode` - - Node receiving the reinitialization.
|
|
598
597
|
|
|
599
|
-
Returns:
|
|
598
|
+
Returns: Mutable connection groups.
|
|
600
599
|
|
|
601
|
-
###
|
|
600
|
+
### collectDistinctNodeCandidates
|
|
602
601
|
|
|
603
602
|
```ts
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
): default
|
|
603
|
+
collectDistinctNodeCandidates(
|
|
604
|
+
nodeCandidates: default[],
|
|
605
|
+
excludedNode: default,
|
|
606
|
+
): default[]
|
|
608
607
|
```
|
|
609
608
|
|
|
610
|
-
|
|
609
|
+
Collects candidates that are distinct from an excluded node.
|
|
611
610
|
|
|
612
611
|
Parameters:
|
|
613
|
-
- `
|
|
614
|
-
- `
|
|
612
|
+
- `nodeCandidates` - - Candidate nodes.
|
|
613
|
+
- `excludedNode` - - Node to exclude.
|
|
615
614
|
|
|
616
|
-
Returns:
|
|
615
|
+
Returns: Distinct candidates.
|
|
617
616
|
|
|
618
|
-
###
|
|
617
|
+
### collectForwardCandidatesForSource
|
|
619
618
|
|
|
620
619
|
```ts
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
): T | undefined
|
|
620
|
+
collectForwardCandidatesForSource(
|
|
621
|
+
traversalContext: ForwardCandidateTraversalContext,
|
|
622
|
+
): NodePair[]
|
|
625
623
|
```
|
|
626
624
|
|
|
627
|
-
|
|
625
|
+
Collects all forward candidates for one source traversal context.
|
|
628
626
|
|
|
629
627
|
Parameters:
|
|
630
|
-
- `
|
|
631
|
-
- `randomValue` - - Random generator.
|
|
628
|
+
- `traversalContext` - - Source traversal context.
|
|
632
629
|
|
|
633
|
-
Returns:
|
|
630
|
+
Returns: Candidate source/target pairs.
|
|
634
631
|
|
|
635
|
-
###
|
|
632
|
+
### collectForwardCandidatesFromContext
|
|
636
633
|
|
|
637
634
|
```ts
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
635
|
+
collectForwardCandidatesFromContext(
|
|
636
|
+
forwardConnectionCandidates: NodePair[],
|
|
637
|
+
traversalContext: ForwardCandidateTraversalContext,
|
|
638
|
+
): NodePair[]
|
|
641
639
|
```
|
|
642
640
|
|
|
643
|
-
|
|
641
|
+
Reduces one forward traversal context into candidate connection pairs.
|
|
644
642
|
|
|
645
643
|
Parameters:
|
|
646
|
-
- `
|
|
644
|
+
- `forwardConnectionCandidates` - - Existing candidate pairs.
|
|
645
|
+
- `traversalContext` - - Source traversal context.
|
|
647
646
|
|
|
648
|
-
Returns:
|
|
647
|
+
Returns: Updated candidate pairs.
|
|
649
648
|
|
|
650
|
-
###
|
|
649
|
+
### collectForwardConnectionCandidates
|
|
651
650
|
|
|
652
651
|
```ts
|
|
653
|
-
|
|
652
|
+
collectForwardConnectionCandidates(
|
|
654
653
|
network: default,
|
|
655
|
-
|
|
656
|
-
targetNode: default,
|
|
657
|
-
mutationProps: NetworkMutationProps,
|
|
658
|
-
): void
|
|
654
|
+
): NodePair[]
|
|
659
655
|
```
|
|
660
656
|
|
|
661
|
-
|
|
657
|
+
Collects forward connection candidates.
|
|
662
658
|
|
|
663
659
|
Parameters:
|
|
664
660
|
- `network` - - Target network.
|
|
665
|
-
- `nodeToInsert` - - Node to insert.
|
|
666
|
-
- `targetNode` - - Target node for insertion alignment.
|
|
667
|
-
- `mutationProps` - - Runtime mutation props.
|
|
668
661
|
|
|
669
|
-
Returns:
|
|
662
|
+
Returns: Candidate source/target pairs.
|
|
670
663
|
|
|
671
|
-
###
|
|
664
|
+
### collectForwardTraversalContexts
|
|
672
665
|
|
|
673
666
|
```ts
|
|
674
|
-
|
|
667
|
+
collectForwardTraversalContexts(
|
|
675
668
|
network: default,
|
|
676
|
-
|
|
677
|
-
toNode: default,
|
|
678
|
-
): default | undefined
|
|
669
|
+
): ForwardCandidateTraversalContext[]
|
|
679
670
|
```
|
|
680
671
|
|
|
681
|
-
|
|
672
|
+
Collects forward traversal contexts for all eligible source nodes.
|
|
682
673
|
|
|
683
674
|
Parameters:
|
|
684
675
|
- `network` - - Target network.
|
|
685
|
-
- `fromNode` - - Source node.
|
|
686
|
-
- `toNode` - - Target node.
|
|
687
676
|
|
|
688
|
-
Returns:
|
|
677
|
+
Returns: Forward traversal contexts.
|
|
689
678
|
|
|
690
|
-
###
|
|
679
|
+
### collectMutableNonInputNodes
|
|
691
680
|
|
|
692
681
|
```ts
|
|
693
|
-
|
|
682
|
+
collectMutableNonInputNodes(
|
|
694
683
|
network: default,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
): default | undefined
|
|
684
|
+
excludeOutputNodes: boolean,
|
|
685
|
+
): default[]
|
|
698
686
|
```
|
|
699
687
|
|
|
700
|
-
|
|
688
|
+
Collects mutable non-input nodes.
|
|
701
689
|
|
|
702
690
|
Parameters:
|
|
703
691
|
- `network` - - Target network.
|
|
704
|
-
- `
|
|
705
|
-
- `toNode` - - Target node.
|
|
692
|
+
- `excludeOutputNodes` - - True to exclude output nodes.
|
|
706
693
|
|
|
707
|
-
Returns:
|
|
694
|
+
Returns: Mutable nodes.
|
|
708
695
|
|
|
709
|
-
###
|
|
696
|
+
### collectNodesByType
|
|
710
697
|
|
|
711
698
|
```ts
|
|
712
|
-
|
|
699
|
+
collectNodesByType(
|
|
713
700
|
network: default,
|
|
714
|
-
|
|
715
|
-
):
|
|
701
|
+
nodeType: string,
|
|
702
|
+
): default[]
|
|
716
703
|
```
|
|
717
704
|
|
|
718
|
-
|
|
705
|
+
Collects nodes by type.
|
|
719
706
|
|
|
720
707
|
Parameters:
|
|
721
|
-
- `network` - -
|
|
722
|
-
- `
|
|
708
|
+
- `network` - - Source network.
|
|
709
|
+
- `nodeType` - - Desired node type.
|
|
723
710
|
|
|
724
|
-
Returns:
|
|
711
|
+
Returns: Matching nodes.
|
|
725
712
|
|
|
726
|
-
###
|
|
713
|
+
### collectNodesWithoutSelfLoop
|
|
727
714
|
|
|
728
715
|
```ts
|
|
729
|
-
|
|
716
|
+
collectNodesWithoutSelfLoop(
|
|
730
717
|
network: default,
|
|
731
|
-
|
|
732
|
-
): void
|
|
718
|
+
): default[]
|
|
733
719
|
```
|
|
734
720
|
|
|
735
|
-
|
|
721
|
+
Collects non-input nodes that do not have self loops.
|
|
736
722
|
|
|
737
723
|
Parameters:
|
|
738
724
|
- `network` - - Target network.
|
|
739
|
-
- `mutationProps` - - Runtime mutation props.
|
|
740
725
|
|
|
741
|
-
Returns:
|
|
726
|
+
Returns: Eligible nodes.
|
|
742
727
|
|
|
743
|
-
###
|
|
728
|
+
### collectRemovableBackwardConnections
|
|
744
729
|
|
|
745
730
|
```ts
|
|
746
|
-
|
|
731
|
+
collectRemovableBackwardConnections(
|
|
747
732
|
network: default,
|
|
748
|
-
|
|
749
|
-
): DeterministicChainMutationContext | undefined
|
|
733
|
+
): default[]
|
|
750
734
|
```
|
|
751
735
|
|
|
752
|
-
|
|
736
|
+
Collects removable backward connections using redundancy constraints.
|
|
753
737
|
|
|
754
738
|
Parameters:
|
|
755
739
|
- `network` - - Target network.
|
|
756
|
-
- `mutationProps` - - Runtime mutation props.
|
|
757
740
|
|
|
758
|
-
Returns:
|
|
741
|
+
Returns: Removable backward connections.
|
|
759
742
|
|
|
760
|
-
###
|
|
743
|
+
### collectRemovableForwardConnections
|
|
761
744
|
|
|
762
745
|
```ts
|
|
763
|
-
|
|
746
|
+
collectRemovableForwardConnections(
|
|
764
747
|
network: default,
|
|
765
|
-
):
|
|
748
|
+
): default[]
|
|
766
749
|
```
|
|
767
750
|
|
|
768
|
-
|
|
751
|
+
Collects removable forward connections using redundancy constraints.
|
|
769
752
|
|
|
770
753
|
Parameters:
|
|
771
754
|
- `network` - - Target network.
|
|
772
755
|
|
|
773
|
-
Returns:
|
|
756
|
+
Returns: Removable forward connections.
|
|
774
757
|
|
|
775
|
-
###
|
|
758
|
+
### collectSwappableNodesForMutation
|
|
776
759
|
|
|
777
760
|
```ts
|
|
778
|
-
|
|
761
|
+
collectSwappableNodesForMutation(
|
|
779
762
|
network: default,
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
outputNode: default,
|
|
783
|
-
): void
|
|
763
|
+
method: MutationMethod | undefined,
|
|
764
|
+
): default[]
|
|
784
765
|
```
|
|
785
766
|
|
|
786
|
-
|
|
767
|
+
Collects swap-eligible nodes based on mutation configuration.
|
|
787
768
|
|
|
788
769
|
Parameters:
|
|
789
770
|
- `network` - - Target network.
|
|
790
|
-
- `
|
|
791
|
-
- `inputNode` - - Input node.
|
|
792
|
-
- `outputNode` - - Output node.
|
|
771
|
+
- `method` - - Optional method descriptor.
|
|
793
772
|
|
|
794
|
-
Returns:
|
|
773
|
+
Returns: Swap-eligible nodes.
|
|
795
774
|
|
|
796
|
-
###
|
|
775
|
+
### collectTargetLayerPeers
|
|
797
776
|
|
|
798
777
|
```ts
|
|
799
|
-
|
|
778
|
+
collectTargetLayerPeers(
|
|
800
779
|
network: default,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
): void
|
|
780
|
+
targetNode: default,
|
|
781
|
+
): default[]
|
|
804
782
|
```
|
|
805
783
|
|
|
806
|
-
|
|
784
|
+
Collects peers around a target node in the same type/layer neighborhood.
|
|
807
785
|
|
|
808
786
|
Parameters:
|
|
809
787
|
- `network` - - Target network.
|
|
810
|
-
- `
|
|
811
|
-
- `outputNode` - - Output node.
|
|
788
|
+
- `targetNode` - - Node whose peers are collected.
|
|
812
789
|
|
|
813
|
-
Returns:
|
|
790
|
+
Returns: Peer nodes.
|
|
814
791
|
|
|
815
|
-
###
|
|
792
|
+
### collectUngatedConnections
|
|
816
793
|
|
|
817
794
|
```ts
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
outputNode: default,
|
|
822
|
-
): default
|
|
795
|
+
collectUngatedConnections(
|
|
796
|
+
network: default,
|
|
797
|
+
): default[]
|
|
823
798
|
```
|
|
824
799
|
|
|
825
|
-
|
|
800
|
+
Collects ungated connections including self-connections.
|
|
826
801
|
|
|
827
802
|
Parameters:
|
|
828
|
-
- `
|
|
829
|
-
- `chainNodeIndex` - - Current chain index.
|
|
830
|
-
- `outputNode` - - Terminal output node.
|
|
803
|
+
- `network` - - Target network.
|
|
831
804
|
|
|
832
|
-
Returns:
|
|
805
|
+
Returns: Ungated connections.
|
|
833
806
|
|
|
834
|
-
###
|
|
807
|
+
### connectPair
|
|
835
808
|
|
|
836
809
|
```ts
|
|
837
|
-
|
|
810
|
+
connectPair(
|
|
838
811
|
network: default,
|
|
839
|
-
|
|
840
|
-
expectedTargetNode: default,
|
|
812
|
+
selectedConnectionPair: NodePair,
|
|
841
813
|
): void
|
|
842
814
|
```
|
|
843
815
|
|
|
844
|
-
|
|
816
|
+
Connects source/target node pair.
|
|
845
817
|
|
|
846
818
|
Parameters:
|
|
847
819
|
- `network` - - Target network.
|
|
848
|
-
- `
|
|
849
|
-
- `expectedTargetNode` - - Allowed outgoing target.
|
|
820
|
+
- `selectedConnectionPair` - - Source/target pair.
|
|
850
821
|
|
|
851
822
|
Returns: Nothing.
|
|
852
823
|
|
|
853
|
-
###
|
|
824
|
+
### containsNode
|
|
854
825
|
|
|
855
826
|
```ts
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
):
|
|
827
|
+
containsNode(
|
|
828
|
+
nodes: default[],
|
|
829
|
+
node: default,
|
|
830
|
+
): boolean
|
|
860
831
|
```
|
|
861
832
|
|
|
862
|
-
|
|
833
|
+
Checks whether a node list contains a node reference.
|
|
863
834
|
|
|
864
835
|
Parameters:
|
|
865
|
-
- `
|
|
866
|
-
- `
|
|
836
|
+
- `nodes` - - Node list.
|
|
837
|
+
- `node` - - Node reference.
|
|
867
838
|
|
|
868
|
-
Returns:
|
|
839
|
+
Returns: True when contained.
|
|
869
840
|
|
|
870
|
-
###
|
|
841
|
+
### countConnectionWhenSourceTargetsPeer
|
|
871
842
|
|
|
872
843
|
```ts
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
):
|
|
844
|
+
countConnectionWhenSourceTargetsPeer(
|
|
845
|
+
peerConnectionsFromSource: number,
|
|
846
|
+
existingConnection: default,
|
|
847
|
+
countContext: SourcePeerConnectionCountContext,
|
|
848
|
+
): number
|
|
878
849
|
```
|
|
879
850
|
|
|
880
|
-
|
|
851
|
+
Counts one connection when it originates from source and targets a peer.
|
|
881
852
|
|
|
882
853
|
Parameters:
|
|
883
|
-
- `
|
|
884
|
-
- `
|
|
885
|
-
- `
|
|
854
|
+
- `peerConnectionsFromSource` - - Current count.
|
|
855
|
+
- `existingConnection` - - Existing network connection.
|
|
856
|
+
- `countContext` - - Count context.
|
|
886
857
|
|
|
887
|
-
Returns:
|
|
858
|
+
Returns: Updated count.
|
|
888
859
|
|
|
889
|
-
###
|
|
860
|
+
### countSourceConnectionsIntoPeerSet
|
|
890
861
|
|
|
891
862
|
```ts
|
|
892
|
-
|
|
863
|
+
countSourceConnectionsIntoPeerSet(
|
|
893
864
|
network: default,
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
):
|
|
865
|
+
candidateConnection: default,
|
|
866
|
+
targetLayerPeers: default[],
|
|
867
|
+
): number
|
|
897
868
|
```
|
|
898
869
|
|
|
899
|
-
|
|
870
|
+
Counts source-originated connections that end inside the target peer set.
|
|
900
871
|
|
|
901
872
|
Parameters:
|
|
902
873
|
- `network` - - Target network.
|
|
903
|
-
- `
|
|
904
|
-
- `
|
|
874
|
+
- `candidateConnection` - - Candidate connection.
|
|
875
|
+
- `targetLayerPeers` - - Peer-set nodes.
|
|
905
876
|
|
|
906
|
-
Returns:
|
|
877
|
+
Returns: Number of source-to-peer connections.
|
|
907
878
|
|
|
908
|
-
###
|
|
879
|
+
### createBackwardCandidateTraversalContext
|
|
909
880
|
|
|
910
881
|
```ts
|
|
911
|
-
|
|
882
|
+
createBackwardCandidateTraversalContext(
|
|
912
883
|
network: default,
|
|
913
|
-
|
|
884
|
+
laterNodeIndex: number,
|
|
885
|
+
): BackwardCandidateTraversalContext
|
|
914
886
|
```
|
|
915
887
|
|
|
916
|
-
|
|
888
|
+
Creates context for one backward-candidate traversal pass.
|
|
917
889
|
|
|
918
890
|
Parameters:
|
|
919
891
|
- `network` - - Target network.
|
|
892
|
+
- `laterNodeIndex` - - Current later-node index.
|
|
920
893
|
|
|
921
|
-
Returns:
|
|
894
|
+
Returns: Immutable traversal context.
|
|
922
895
|
|
|
923
|
-
###
|
|
896
|
+
### createConnectionGroupReinitContext
|
|
924
897
|
|
|
925
898
|
```ts
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
):
|
|
899
|
+
createConnectionGroupReinitContext(
|
|
900
|
+
randomValue: () => number,
|
|
901
|
+
methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
|
|
902
|
+
): ConnectionGroupReinitContext
|
|
930
903
|
```
|
|
931
904
|
|
|
932
|
-
|
|
905
|
+
Creates immutable context for connection-group reinitialization.
|
|
933
906
|
|
|
934
907
|
Parameters:
|
|
935
|
-
- `
|
|
936
|
-
- `
|
|
908
|
+
- `randomValue` - - Random generator.
|
|
909
|
+
- `methodObject` - - Method override object.
|
|
937
910
|
|
|
938
|
-
Returns:
|
|
911
|
+
Returns: Reinitialization context.
|
|
939
912
|
|
|
940
|
-
###
|
|
913
|
+
### createDirectionalConnectionContext
|
|
941
914
|
|
|
942
915
|
```ts
|
|
943
|
-
|
|
916
|
+
createDirectionalConnectionContext(
|
|
944
917
|
network: default,
|
|
945
|
-
|
|
946
|
-
):
|
|
918
|
+
candidateConnection: default,
|
|
919
|
+
): DirectionalConnectionContext
|
|
947
920
|
```
|
|
948
921
|
|
|
949
|
-
|
|
922
|
+
Creates indexed directional context for a connection candidate.
|
|
950
923
|
|
|
951
924
|
Parameters:
|
|
952
925
|
- `network` - - Target network.
|
|
953
|
-
- `
|
|
926
|
+
- `candidateConnection` - - Candidate connection.
|
|
954
927
|
|
|
955
|
-
Returns:
|
|
928
|
+
Returns: Directional context.
|
|
956
929
|
|
|
957
|
-
###
|
|
930
|
+
### createForwardCandidateTraversalContext
|
|
958
931
|
|
|
959
932
|
```ts
|
|
960
|
-
|
|
933
|
+
createForwardCandidateTraversalContext(
|
|
961
934
|
network: default,
|
|
962
|
-
|
|
935
|
+
sourceNodeIndex: number,
|
|
936
|
+
): ForwardCandidateTraversalContext
|
|
963
937
|
```
|
|
964
938
|
|
|
965
|
-
|
|
939
|
+
Creates context for one forward-candidate source traversal pass.
|
|
966
940
|
|
|
967
941
|
Parameters:
|
|
968
942
|
- `network` - - Target network.
|
|
943
|
+
- `sourceNodeIndex` - - Current source index.
|
|
969
944
|
|
|
970
|
-
Returns:
|
|
945
|
+
Returns: Immutable traversal context.
|
|
971
946
|
|
|
972
|
-
###
|
|
947
|
+
### createHiddenNode
|
|
973
948
|
|
|
974
949
|
```ts
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
): default[]
|
|
950
|
+
createHiddenNode(
|
|
951
|
+
randomValue: () => number,
|
|
952
|
+
): default
|
|
979
953
|
```
|
|
980
954
|
|
|
981
|
-
|
|
955
|
+
Creates a hidden node with random activation mutation.
|
|
982
956
|
|
|
983
957
|
Parameters:
|
|
984
|
-
- `
|
|
985
|
-
- `nodeType` - - Desired node type.
|
|
958
|
+
- `randomValue` - - Random generator.
|
|
986
959
|
|
|
987
|
-
Returns:
|
|
960
|
+
Returns: Hidden node.
|
|
988
961
|
|
|
989
|
-
###
|
|
962
|
+
### createRecurrentLayer
|
|
990
963
|
|
|
991
964
|
```ts
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
):
|
|
965
|
+
createRecurrentLayer(
|
|
966
|
+
blockType: "lstm" | "gru",
|
|
967
|
+
): RecurrentLayerShape
|
|
995
968
|
```
|
|
996
969
|
|
|
997
|
-
|
|
970
|
+
Creates recurrent layer by type.
|
|
998
971
|
|
|
999
972
|
Parameters:
|
|
1000
|
-
- `
|
|
973
|
+
- `blockType` - - Recurrent block type.
|
|
1001
974
|
|
|
1002
|
-
Returns:
|
|
975
|
+
Returns: Created recurrent layer.
|
|
1003
976
|
|
|
1004
|
-
###
|
|
977
|
+
### createSourcePeerConnectionCountContext
|
|
1005
978
|
|
|
1006
979
|
```ts
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
):
|
|
980
|
+
createSourcePeerConnectionCountContext(
|
|
981
|
+
candidateConnection: default,
|
|
982
|
+
targetLayerPeers: default[],
|
|
983
|
+
): SourcePeerConnectionCountContext
|
|
1011
984
|
```
|
|
1012
985
|
|
|
1013
|
-
|
|
986
|
+
Creates immutable context for source-to-peer connection counting.
|
|
1014
987
|
|
|
1015
988
|
Parameters:
|
|
1016
|
-
- `
|
|
1017
|
-
- `
|
|
989
|
+
- `candidateConnection` - - Candidate connection.
|
|
990
|
+
- `targetLayerPeers` - - Peer-set nodes.
|
|
1018
991
|
|
|
1019
|
-
Returns:
|
|
992
|
+
Returns: Count context.
|
|
1020
993
|
|
|
1021
|
-
###
|
|
994
|
+
### createTargetLayerPeerContext
|
|
1022
995
|
|
|
1023
996
|
```ts
|
|
1024
|
-
|
|
997
|
+
createTargetLayerPeerContext(
|
|
1025
998
|
network: default,
|
|
1026
|
-
|
|
999
|
+
targetNode: default,
|
|
1000
|
+
): TargetLayerPeerContext
|
|
1027
1001
|
```
|
|
1028
1002
|
|
|
1029
|
-
|
|
1003
|
+
Creates immutable context for peer-layer collection.
|
|
1030
1004
|
|
|
1031
1005
|
Parameters:
|
|
1032
1006
|
- `network` - - Target network.
|
|
1007
|
+
- `targetNode` - - Peer anchor node.
|
|
1033
1008
|
|
|
1034
|
-
Returns:
|
|
1009
|
+
Returns: Peer traversal context.
|
|
1035
1010
|
|
|
1036
|
-
###
|
|
1011
|
+
### createWeightSamplingRangeContext
|
|
1037
1012
|
|
|
1038
1013
|
```ts
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
):
|
|
1014
|
+
createWeightSamplingRangeContext(
|
|
1015
|
+
reinitContext: ConnectionGroupReinitContext,
|
|
1016
|
+
): WeightSamplingRangeContext
|
|
1042
1017
|
```
|
|
1043
1018
|
|
|
1044
|
-
|
|
1019
|
+
Creates immutable sampling range context.
|
|
1045
1020
|
|
|
1046
1021
|
Parameters:
|
|
1047
|
-
- `
|
|
1022
|
+
- `reinitContext` - - Reinitialization context.
|
|
1048
1023
|
|
|
1049
|
-
Returns:
|
|
1024
|
+
Returns: Sampling range context.
|
|
1050
1025
|
|
|
1051
|
-
###
|
|
1026
|
+
### disconnectConnectionAndGetGater
|
|
1052
1027
|
|
|
1053
1028
|
```ts
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
):
|
|
1029
|
+
disconnectConnectionAndGetGater(
|
|
1030
|
+
network: default,
|
|
1031
|
+
connectionToExpand: default,
|
|
1032
|
+
): default | null
|
|
1058
1033
|
```
|
|
1059
1034
|
|
|
1060
|
-
|
|
1035
|
+
Disconnects a connection and returns its previous gater.
|
|
1061
1036
|
|
|
1062
1037
|
Parameters:
|
|
1063
|
-
- `
|
|
1064
|
-
- `
|
|
1038
|
+
- `network` - - Target network.
|
|
1039
|
+
- `connectionToExpand` - - Connection being expanded.
|
|
1065
1040
|
|
|
1066
|
-
Returns:
|
|
1041
|
+
Returns: Previous gater reference.
|
|
1067
1042
|
|
|
1068
|
-
###
|
|
1043
|
+
### disconnectConnectionPair
|
|
1069
1044
|
|
|
1070
1045
|
```ts
|
|
1071
|
-
|
|
1046
|
+
disconnectConnectionPair(
|
|
1072
1047
|
network: default,
|
|
1073
|
-
|
|
1074
|
-
):
|
|
1048
|
+
selectedConnection: default,
|
|
1049
|
+
): void
|
|
1075
1050
|
```
|
|
1076
1051
|
|
|
1077
|
-
|
|
1052
|
+
Disconnects selected connection by endpoints.
|
|
1078
1053
|
|
|
1079
1054
|
Parameters:
|
|
1080
1055
|
- `network` - - Target network.
|
|
1081
|
-
- `
|
|
1056
|
+
- `selectedConnection` - - Connection to disconnect.
|
|
1082
1057
|
|
|
1083
|
-
Returns:
|
|
1058
|
+
Returns: Nothing.
|
|
1084
1059
|
|
|
1085
|
-
###
|
|
1060
|
+
### disconnectUnexpectedOutgoingConnections
|
|
1086
1061
|
|
|
1087
1062
|
```ts
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1063
|
+
disconnectUnexpectedOutgoingConnections(
|
|
1064
|
+
network: default,
|
|
1065
|
+
chainNode: default,
|
|
1066
|
+
expectedTargetNode: default,
|
|
1067
|
+
): void
|
|
1091
1068
|
```
|
|
1092
1069
|
|
|
1093
|
-
|
|
1070
|
+
Removes outgoing connections that do not match the expected chain target.
|
|
1094
1071
|
|
|
1095
1072
|
Parameters:
|
|
1096
|
-
- `
|
|
1073
|
+
- `network` - - Target network.
|
|
1074
|
+
- `chainNode` - - Node whose outgoing edges are validated.
|
|
1075
|
+
- `expectedTargetNode` - - Allowed outgoing target.
|
|
1097
1076
|
|
|
1098
|
-
Returns:
|
|
1077
|
+
Returns: Nothing.
|
|
1099
1078
|
|
|
1100
|
-
###
|
|
1079
|
+
### enableNodeBatchNorm
|
|
1101
1080
|
|
|
1102
1081
|
```ts
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
): boolean
|
|
1082
|
+
enableNodeBatchNorm(
|
|
1083
|
+
node: default,
|
|
1084
|
+
): void
|
|
1107
1085
|
```
|
|
1108
1086
|
|
|
1109
|
-
|
|
1087
|
+
Enables internal batch-norm flag on a node.
|
|
1110
1088
|
|
|
1111
1089
|
Parameters:
|
|
1112
|
-
- `
|
|
1113
|
-
- `targetNode` - - Candidate target node.
|
|
1090
|
+
- `node` - - Node to flag.
|
|
1114
1091
|
|
|
1115
|
-
Returns:
|
|
1092
|
+
Returns: Nothing.
|
|
1116
1093
|
|
|
1117
|
-
###
|
|
1094
|
+
### ensureConnection
|
|
1118
1095
|
|
|
1119
1096
|
```ts
|
|
1120
|
-
|
|
1097
|
+
ensureConnection(
|
|
1121
1098
|
network: default,
|
|
1122
|
-
|
|
1123
|
-
|
|
1099
|
+
fromNode: default,
|
|
1100
|
+
toNode: default,
|
|
1101
|
+
): default | undefined
|
|
1124
1102
|
```
|
|
1125
1103
|
|
|
1126
|
-
|
|
1104
|
+
Ensures a connection exists and returns it.
|
|
1127
1105
|
|
|
1128
1106
|
Parameters:
|
|
1129
1107
|
- `network` - - Target network.
|
|
1130
|
-
- `
|
|
1108
|
+
- `fromNode` - - Source node.
|
|
1109
|
+
- `toNode` - - Target node.
|
|
1131
1110
|
|
|
1132
|
-
Returns:
|
|
1111
|
+
Returns: Existing or created connection.
|
|
1133
1112
|
|
|
1134
|
-
###
|
|
1113
|
+
### ensureSeedForwardConnectionWhenEmpty
|
|
1135
1114
|
|
|
1136
1115
|
```ts
|
|
1137
|
-
|
|
1116
|
+
ensureSeedForwardConnectionWhenEmpty(
|
|
1138
1117
|
network: default,
|
|
1139
|
-
):
|
|
1118
|
+
): boolean
|
|
1140
1119
|
```
|
|
1141
1120
|
|
|
1142
|
-
|
|
1121
|
+
Ensures a seed input->output connection exists when connection list is empty.
|
|
1143
1122
|
|
|
1144
1123
|
Parameters:
|
|
1145
1124
|
- `network` - - Target network.
|
|
1146
1125
|
|
|
1147
|
-
Returns:
|
|
1126
|
+
Returns: True when mutation may continue.
|
|
1148
1127
|
|
|
1149
|
-
###
|
|
1128
|
+
### expandConnectionWithRecurrentBlock
|
|
1150
1129
|
|
|
1151
1130
|
```ts
|
|
1152
|
-
|
|
1131
|
+
expandConnectionWithRecurrentBlock(
|
|
1153
1132
|
network: default,
|
|
1154
|
-
|
|
1155
|
-
|
|
1133
|
+
connectionToExpand: default,
|
|
1134
|
+
blockType: "lstm" | "gru",
|
|
1135
|
+
): void
|
|
1156
1136
|
```
|
|
1157
1137
|
|
|
1158
|
-
|
|
1138
|
+
Replaces one connection with a minimal recurrent block.
|
|
1159
1139
|
|
|
1160
1140
|
Parameters:
|
|
1161
1141
|
- `network` - - Target network.
|
|
1162
|
-
- `
|
|
1142
|
+
- `connectionToExpand` - - Connection to replace.
|
|
1143
|
+
- `blockType` - - Recurrent block type.
|
|
1163
1144
|
|
|
1164
|
-
Returns:
|
|
1145
|
+
Returns: Nothing.
|
|
1165
1146
|
|
|
1166
|
-
###
|
|
1147
|
+
### findConnection
|
|
1167
1148
|
|
|
1168
1149
|
```ts
|
|
1169
|
-
|
|
1150
|
+
findConnection(
|
|
1170
1151
|
network: default,
|
|
1171
|
-
|
|
1172
|
-
|
|
1152
|
+
fromNode: default,
|
|
1153
|
+
toNode: default,
|
|
1154
|
+
): default | undefined
|
|
1173
1155
|
```
|
|
1174
1156
|
|
|
1175
|
-
|
|
1157
|
+
Gets a connection between two nodes when it exists.
|
|
1176
1158
|
|
|
1177
1159
|
Parameters:
|
|
1178
1160
|
- `network` - - Target network.
|
|
1179
|
-
- `
|
|
1161
|
+
- `fromNode` - - Source node.
|
|
1162
|
+
- `toNode` - - Target node.
|
|
1180
1163
|
|
|
1181
|
-
Returns:
|
|
1164
|
+
Returns: Matching connection or undefined.
|
|
1182
1165
|
|
|
1183
|
-
###
|
|
1166
|
+
### findFirstNodeByType
|
|
1184
1167
|
|
|
1185
1168
|
```ts
|
|
1186
|
-
|
|
1169
|
+
findFirstNodeByType(
|
|
1187
1170
|
network: default,
|
|
1188
|
-
|
|
1189
|
-
):
|
|
1171
|
+
nodeType: string,
|
|
1172
|
+
): default | undefined
|
|
1190
1173
|
```
|
|
1191
1174
|
|
|
1192
|
-
|
|
1175
|
+
Returns the first node by type.
|
|
1193
1176
|
|
|
1194
1177
|
Parameters:
|
|
1195
1178
|
- `network` - - Target network.
|
|
1196
|
-
- `
|
|
1179
|
+
- `nodeType` - - Node type to match.
|
|
1197
1180
|
|
|
1198
|
-
Returns:
|
|
1181
|
+
Returns: Matching node or undefined.
|
|
1199
1182
|
|
|
1200
1183
|
### hasRedundantEndpoints
|
|
1201
1184
|
|
|
@@ -1212,145 +1195,196 @@ Parameters:
|
|
|
1212
1195
|
|
|
1213
1196
|
Returns: True when endpoint redundancy exists.
|
|
1214
1197
|
|
|
1215
|
-
###
|
|
1198
|
+
### initializeDeterministicChain
|
|
1216
1199
|
|
|
1217
1200
|
```ts
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1201
|
+
initializeDeterministicChain(
|
|
1202
|
+
network: default,
|
|
1203
|
+
mutationProps: NetworkMutationProps,
|
|
1204
|
+
inputNode: default,
|
|
1205
|
+
outputNode: default,
|
|
1206
|
+
): void
|
|
1221
1207
|
```
|
|
1222
1208
|
|
|
1223
|
-
|
|
1209
|
+
Initializes deterministic chain storage and seed edge.
|
|
1224
1210
|
|
|
1225
1211
|
Parameters:
|
|
1226
|
-
- `
|
|
1212
|
+
- `network` - - Target network.
|
|
1213
|
+
- `mutationProps` - - Runtime mutation props.
|
|
1214
|
+
- `inputNode` - - Input node.
|
|
1215
|
+
- `outputNode` - - Output node.
|
|
1227
1216
|
|
|
1228
|
-
Returns:
|
|
1217
|
+
Returns: Nothing.
|
|
1229
1218
|
|
|
1230
|
-
###
|
|
1219
|
+
### insertNodeBeforeOutputTail
|
|
1231
1220
|
|
|
1232
1221
|
```ts
|
|
1233
|
-
|
|
1222
|
+
insertNodeBeforeOutputTail(
|
|
1234
1223
|
network: default,
|
|
1235
|
-
|
|
1236
|
-
|
|
1224
|
+
nodeToInsert: default,
|
|
1225
|
+
targetNode: default,
|
|
1226
|
+
mutationProps: NetworkMutationProps,
|
|
1227
|
+
): void
|
|
1237
1228
|
```
|
|
1238
1229
|
|
|
1239
|
-
|
|
1230
|
+
Inserts a node before output tail while preserving output block ordering.
|
|
1240
1231
|
|
|
1241
1232
|
Parameters:
|
|
1242
1233
|
- `network` - - Target network.
|
|
1243
|
-
- `
|
|
1234
|
+
- `nodeToInsert` - - Node to insert.
|
|
1235
|
+
- `targetNode` - - Target node for insertion alignment.
|
|
1236
|
+
- `mutationProps` - - Runtime mutation props.
|
|
1244
1237
|
|
|
1245
|
-
Returns:
|
|
1238
|
+
Returns: Nothing.
|
|
1246
1239
|
|
|
1247
|
-
###
|
|
1240
|
+
### isBackwardCandidateTargetAvailable
|
|
1248
1241
|
|
|
1249
1242
|
```ts
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
): number
|
|
1243
|
+
isBackwardCandidateTargetAvailable(
|
|
1244
|
+
laterNode: default,
|
|
1245
|
+
earlierNode: default,
|
|
1246
|
+
): boolean
|
|
1255
1247
|
```
|
|
1256
1248
|
|
|
1257
|
-
|
|
1249
|
+
Checks whether a backward candidate target is not already projected.
|
|
1258
1250
|
|
|
1259
1251
|
Parameters:
|
|
1260
|
-
- `
|
|
1261
|
-
- `
|
|
1262
|
-
- `targetLayerPeers` - - Peer-set nodes.
|
|
1252
|
+
- `laterNode` - - Candidate source node.
|
|
1253
|
+
- `earlierNode` - - Candidate target node.
|
|
1263
1254
|
|
|
1264
|
-
Returns:
|
|
1255
|
+
Returns: True when connection may be added.
|
|
1265
1256
|
|
|
1266
|
-
###
|
|
1257
|
+
### isBackwardDirectionalContext
|
|
1267
1258
|
|
|
1268
1259
|
```ts
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
): SourcePeerConnectionCountContext
|
|
1260
|
+
isBackwardDirectionalContext(
|
|
1261
|
+
directionContext: DirectionalConnectionContext,
|
|
1262
|
+
): boolean
|
|
1273
1263
|
```
|
|
1274
1264
|
|
|
1275
|
-
|
|
1265
|
+
Checks whether a directional context represents a backward edge.
|
|
1276
1266
|
|
|
1277
1267
|
Parameters:
|
|
1278
|
-
- `
|
|
1279
|
-
- `targetLayerPeers` - - Peer-set nodes.
|
|
1268
|
+
- `directionContext` - - Directional context.
|
|
1280
1269
|
|
|
1281
|
-
Returns:
|
|
1270
|
+
Returns: True when backward.
|
|
1282
1271
|
|
|
1283
|
-
###
|
|
1272
|
+
### isForwardCandidateTargetAvailable
|
|
1284
1273
|
|
|
1285
1274
|
```ts
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
): number
|
|
1275
|
+
isForwardCandidateTargetAvailable(
|
|
1276
|
+
sourceNode: default,
|
|
1277
|
+
targetNode: default,
|
|
1278
|
+
): boolean
|
|
1291
1279
|
```
|
|
1292
1280
|
|
|
1293
|
-
|
|
1281
|
+
Checks whether a forward candidate target is not already projected.
|
|
1294
1282
|
|
|
1295
1283
|
Parameters:
|
|
1296
|
-
- `
|
|
1297
|
-
- `
|
|
1298
|
-
- `countContext` - - Count context.
|
|
1284
|
+
- `sourceNode` - - Candidate source node.
|
|
1285
|
+
- `targetNode` - - Candidate target node.
|
|
1299
1286
|
|
|
1300
|
-
Returns:
|
|
1287
|
+
Returns: True when connection may be added.
|
|
1301
1288
|
|
|
1302
|
-
###
|
|
1289
|
+
### isForwardConnectionStructurallyRemovable
|
|
1303
1290
|
|
|
1304
1291
|
```ts
|
|
1305
|
-
|
|
1292
|
+
isForwardConnectionStructurallyRemovable(
|
|
1306
1293
|
network: default,
|
|
1307
|
-
|
|
1308
|
-
):
|
|
1294
|
+
candidateConnection: default,
|
|
1295
|
+
): boolean
|
|
1309
1296
|
```
|
|
1310
1297
|
|
|
1311
|
-
|
|
1298
|
+
Checks structural preconditions for removable forward connections.
|
|
1312
1299
|
|
|
1313
1300
|
Parameters:
|
|
1314
1301
|
- `network` - - Target network.
|
|
1315
|
-
- `
|
|
1302
|
+
- `candidateConnection` - - Candidate connection.
|
|
1316
1303
|
|
|
1317
|
-
Returns:
|
|
1304
|
+
Returns: True when the connection is a forward edge with redundant endpoints.
|
|
1318
1305
|
|
|
1319
|
-
###
|
|
1306
|
+
### isForwardDirectionalContext
|
|
1320
1307
|
|
|
1321
1308
|
```ts
|
|
1322
|
-
|
|
1309
|
+
isForwardDirectionalContext(
|
|
1310
|
+
directionContext: DirectionalConnectionContext,
|
|
1311
|
+
): boolean
|
|
1312
|
+
```
|
|
1313
|
+
|
|
1314
|
+
Checks whether a directional context represents a forward edge.
|
|
1315
|
+
|
|
1316
|
+
Parameters:
|
|
1317
|
+
- `directionContext` - - Directional context.
|
|
1318
|
+
|
|
1319
|
+
Returns: True when forward.
|
|
1320
|
+
|
|
1321
|
+
### isNodeWithoutSelfLoop
|
|
1322
|
+
|
|
1323
|
+
```ts
|
|
1324
|
+
isNodeWithoutSelfLoop(
|
|
1323
1325
|
candidateNode: default,
|
|
1324
|
-
candidateNodeIndex: number,
|
|
1325
|
-
peerContext: TargetLayerPeerContext,
|
|
1326
1326
|
): boolean
|
|
1327
1327
|
```
|
|
1328
1328
|
|
|
1329
|
-
Checks whether
|
|
1329
|
+
Checks whether a node currently has no self-loop connections.
|
|
1330
1330
|
|
|
1331
1331
|
Parameters:
|
|
1332
|
-
- `candidateNode` - -
|
|
1333
|
-
- `candidateNodeIndex` - - Candidate node index.
|
|
1334
|
-
- `peerContext` - - Peer traversal context.
|
|
1332
|
+
- `candidateNode` - - Node under evaluation.
|
|
1335
1333
|
|
|
1336
|
-
Returns: True when
|
|
1334
|
+
Returns: True when the node has no self-loop.
|
|
1337
1335
|
|
|
1338
|
-
###
|
|
1336
|
+
### isRemovableBackwardConnection
|
|
1339
1337
|
|
|
1340
1338
|
```ts
|
|
1341
|
-
|
|
1339
|
+
isRemovableBackwardConnection(
|
|
1342
1340
|
network: default,
|
|
1343
|
-
|
|
1344
|
-
):
|
|
1341
|
+
candidateConnection: default,
|
|
1342
|
+
): boolean
|
|
1345
1343
|
```
|
|
1346
1344
|
|
|
1347
|
-
|
|
1345
|
+
Evaluates whether a backward connection is safe to remove.
|
|
1348
1346
|
|
|
1349
1347
|
Parameters:
|
|
1350
1348
|
- `network` - - Target network.
|
|
1351
|
-
- `
|
|
1349
|
+
- `candidateConnection` - - Connection under evaluation.
|
|
1352
1350
|
|
|
1353
|
-
Returns:
|
|
1351
|
+
Returns: True when removable.
|
|
1352
|
+
|
|
1353
|
+
### isRemovableForwardConnection
|
|
1354
|
+
|
|
1355
|
+
```ts
|
|
1356
|
+
isRemovableForwardConnection(
|
|
1357
|
+
network: default,
|
|
1358
|
+
candidateConnection: default,
|
|
1359
|
+
): boolean
|
|
1360
|
+
```
|
|
1361
|
+
|
|
1362
|
+
Evaluates whether a forward connection is safe to remove.
|
|
1363
|
+
|
|
1364
|
+
Parameters:
|
|
1365
|
+
- `network` - - Target network.
|
|
1366
|
+
- `candidateConnection` - - Connection under evaluation.
|
|
1367
|
+
|
|
1368
|
+
Returns: True when removable.
|
|
1369
|
+
|
|
1370
|
+
### isTargetLayerPeer
|
|
1371
|
+
|
|
1372
|
+
```ts
|
|
1373
|
+
isTargetLayerPeer(
|
|
1374
|
+
candidateNode: default,
|
|
1375
|
+
candidateNodeIndex: number,
|
|
1376
|
+
peerContext: TargetLayerPeerContext,
|
|
1377
|
+
): boolean
|
|
1378
|
+
```
|
|
1379
|
+
|
|
1380
|
+
Checks whether candidate node belongs to the target peer-layer set.
|
|
1381
|
+
|
|
1382
|
+
Parameters:
|
|
1383
|
+
- `candidateNode` - - Candidate node.
|
|
1384
|
+
- `candidateNodeIndex` - - Candidate node index.
|
|
1385
|
+
- `peerContext` - - Peer traversal context.
|
|
1386
|
+
|
|
1387
|
+
Returns: True when candidate is an eligible peer.
|
|
1354
1388
|
|
|
1355
1389
|
### isTargetLayerPeerTypeMatch
|
|
1356
1390
|
|
|
@@ -1386,683 +1420,649 @@ Parameters:
|
|
|
1386
1420
|
|
|
1387
1421
|
Returns: True when within distance.
|
|
1388
1422
|
|
|
1389
|
-
###
|
|
1423
|
+
### isUngatedConnection
|
|
1390
1424
|
|
|
1391
1425
|
```ts
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
node: default,
|
|
1426
|
+
isUngatedConnection(
|
|
1427
|
+
candidateConnection: default,
|
|
1395
1428
|
): boolean
|
|
1396
1429
|
```
|
|
1397
1430
|
|
|
1398
|
-
Checks whether a
|
|
1431
|
+
Checks whether a connection has no gater attached.
|
|
1399
1432
|
|
|
1400
1433
|
Parameters:
|
|
1401
|
-
- `
|
|
1402
|
-
- `node` - - Node reference.
|
|
1434
|
+
- `candidateConnection` - - Connection under evaluation.
|
|
1403
1435
|
|
|
1404
|
-
Returns: True when
|
|
1436
|
+
Returns: True when ungated.
|
|
1405
1437
|
|
|
1406
|
-
###
|
|
1438
|
+
### markTopoDirtyIfAcyclic
|
|
1407
1439
|
|
|
1408
1440
|
```ts
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
):
|
|
1441
|
+
markTopoDirtyIfAcyclic(
|
|
1442
|
+
mutationProps: NetworkMutationProps,
|
|
1443
|
+
): void
|
|
1412
1444
|
```
|
|
1413
1445
|
|
|
1414
|
-
|
|
1446
|
+
Marks topology caches dirty when acyclic mode is enforced.
|
|
1415
1447
|
|
|
1416
1448
|
Parameters:
|
|
1417
|
-
- `
|
|
1449
|
+
- `mutationProps` - - Runtime mutation props.
|
|
1418
1450
|
|
|
1419
|
-
Returns:
|
|
1451
|
+
Returns: Nothing.
|
|
1420
1452
|
|
|
1421
|
-
###
|
|
1453
|
+
### modActivation
|
|
1422
1454
|
|
|
1423
1455
|
```ts
|
|
1424
|
-
|
|
1456
|
+
modActivation(
|
|
1425
1457
|
method: MutationMethod | undefined,
|
|
1426
|
-
):
|
|
1458
|
+
): void
|
|
1427
1459
|
```
|
|
1428
1460
|
|
|
1429
|
-
|
|
1461
|
+
Mutates activation function on one random non-input node.
|
|
1462
|
+
|
|
1463
|
+
Output-node eligibility is controlled by `method.mutateOutput` when provided.
|
|
1430
1464
|
|
|
1431
1465
|
Parameters:
|
|
1432
|
-
- `
|
|
1466
|
+
- `this` - - Bound network.
|
|
1467
|
+
- `method` - - Optional method descriptor.
|
|
1433
1468
|
|
|
1434
|
-
Returns:
|
|
1469
|
+
Returns: Nothing.
|
|
1435
1470
|
|
|
1436
|
-
###
|
|
1471
|
+
### modBias
|
|
1437
1472
|
|
|
1438
1473
|
```ts
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
maxValue: number,
|
|
1443
|
-
): number
|
|
1474
|
+
modBias(
|
|
1475
|
+
method: MutationMethod | undefined,
|
|
1476
|
+
): void
|
|
1444
1477
|
```
|
|
1445
1478
|
|
|
1446
|
-
|
|
1479
|
+
Mutates bias parameters on one random non-input node.
|
|
1480
|
+
|
|
1481
|
+
Output nodes remain eligible for this operator.
|
|
1447
1482
|
|
|
1448
1483
|
Parameters:
|
|
1449
|
-
- `
|
|
1450
|
-
- `
|
|
1451
|
-
- `maxValue` - - Maximum value.
|
|
1484
|
+
- `this` - - Bound network.
|
|
1485
|
+
- `method` - - Optional method descriptor.
|
|
1452
1486
|
|
|
1453
|
-
Returns:
|
|
1487
|
+
Returns: Nothing.
|
|
1454
1488
|
|
|
1455
|
-
###
|
|
1489
|
+
### modWeight
|
|
1456
1490
|
|
|
1457
1491
|
```ts
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
randomValue: () => number,
|
|
1462
|
-
): default | undefined
|
|
1492
|
+
modWeight(
|
|
1493
|
+
method: MutationMethod | undefined,
|
|
1494
|
+
): void
|
|
1463
1495
|
```
|
|
1464
1496
|
|
|
1465
|
-
|
|
1497
|
+
Perturbs one connection weight using a uniform delta sampled from configured bounds.
|
|
1498
|
+
|
|
1499
|
+
The candidate pool includes standard and self-connections.
|
|
1466
1500
|
|
|
1467
1501
|
Parameters:
|
|
1468
|
-
- `
|
|
1469
|
-
- `
|
|
1470
|
-
- `randomValue` - - Random generator.
|
|
1502
|
+
- `this` - - Bound network.
|
|
1503
|
+
- `method` - - Optional method descriptor.
|
|
1471
1504
|
|
|
1472
|
-
Returns:
|
|
1505
|
+
Returns: Nothing.
|
|
1473
1506
|
|
|
1474
|
-
###
|
|
1507
|
+
### pickDistinctNodePair
|
|
1475
1508
|
|
|
1476
1509
|
```ts
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
):
|
|
1510
|
+
pickDistinctNodePair(
|
|
1511
|
+
swappableNodes: default[],
|
|
1512
|
+
randomValue: () => number,
|
|
1513
|
+
): DistinctNodePair | undefined
|
|
1481
1514
|
```
|
|
1482
1515
|
|
|
1483
|
-
|
|
1516
|
+
Picks two distinct nodes from a candidate set.
|
|
1484
1517
|
|
|
1485
1518
|
Parameters:
|
|
1486
|
-
- `
|
|
1487
|
-
- `
|
|
1519
|
+
- `swappableNodes` - - Swap candidate nodes.
|
|
1520
|
+
- `randomValue` - - Random generator.
|
|
1488
1521
|
|
|
1489
|
-
Returns:
|
|
1522
|
+
Returns: Distinct pair or undefined.
|
|
1490
1523
|
|
|
1491
|
-
###
|
|
1524
|
+
### pickDistinctRandomNode
|
|
1492
1525
|
|
|
1493
1526
|
```ts
|
|
1494
|
-
|
|
1495
|
-
|
|
1527
|
+
pickDistinctRandomNode(
|
|
1528
|
+
nodeCandidates: default[],
|
|
1529
|
+
excludedNode: default,
|
|
1496
1530
|
randomValue: () => number,
|
|
1497
1531
|
): default | undefined
|
|
1498
1532
|
```
|
|
1499
1533
|
|
|
1500
|
-
|
|
1534
|
+
Picks a random node distinct from a given reference.
|
|
1501
1535
|
|
|
1502
1536
|
Parameters:
|
|
1503
|
-
- `
|
|
1537
|
+
- `nodeCandidates` - - Candidate nodes.
|
|
1538
|
+
- `excludedNode` - - Node to exclude.
|
|
1504
1539
|
- `randomValue` - - Random generator.
|
|
1505
1540
|
|
|
1506
|
-
Returns:
|
|
1541
|
+
Returns: Distinct node or undefined.
|
|
1507
1542
|
|
|
1508
|
-
###
|
|
1543
|
+
### pickRandomEntry
|
|
1509
1544
|
|
|
1510
1545
|
```ts
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1546
|
+
pickRandomEntry(
|
|
1547
|
+
entries: T[],
|
|
1548
|
+
randomValue: () => number,
|
|
1549
|
+
): T | undefined
|
|
1514
1550
|
```
|
|
1515
1551
|
|
|
1516
|
-
|
|
1552
|
+
Selects a random array element.
|
|
1517
1553
|
|
|
1518
1554
|
Parameters:
|
|
1519
|
-
- `
|
|
1555
|
+
- `entries` - - Source entries.
|
|
1556
|
+
- `randomValue` - - Random generator.
|
|
1520
1557
|
|
|
1521
|
-
Returns:
|
|
1558
|
+
Returns: Random entry or undefined when empty.
|
|
1522
1559
|
|
|
1523
|
-
###
|
|
1560
|
+
### pickRandomNonInputNode
|
|
1524
1561
|
|
|
1525
1562
|
```ts
|
|
1526
|
-
|
|
1527
|
-
candidateNode: default,
|
|
1528
|
-
): boolean
|
|
1529
|
-
```
|
|
1530
|
-
|
|
1531
|
-
Checks whether a node currently has no self-loop connections.
|
|
1532
|
-
|
|
1533
|
-
Parameters:
|
|
1534
|
-
- `candidateNode` - - Node under evaluation.
|
|
1535
|
-
|
|
1536
|
-
Returns: True when the node has no self-loop.
|
|
1537
|
-
|
|
1538
|
-
### collectUngatedConnections
|
|
1539
|
-
|
|
1540
|
-
```ts
|
|
1541
|
-
collectUngatedConnections(
|
|
1563
|
+
pickRandomNonInputNode(
|
|
1542
1564
|
network: default,
|
|
1543
|
-
|
|
1565
|
+
excludeOutputNodes: boolean,
|
|
1566
|
+
randomValue: () => number,
|
|
1567
|
+
): default | undefined
|
|
1544
1568
|
```
|
|
1545
1569
|
|
|
1546
|
-
|
|
1570
|
+
Selects a random mutable non-input node.
|
|
1547
1571
|
|
|
1548
1572
|
Parameters:
|
|
1549
1573
|
- `network` - - Target network.
|
|
1574
|
+
- `excludeOutputNodes` - - True to exclude outputs.
|
|
1575
|
+
- `randomValue` - - Random generator.
|
|
1550
1576
|
|
|
1551
|
-
Returns:
|
|
1577
|
+
Returns: Selected mutable node.
|
|
1552
1578
|
|
|
1553
|
-
###
|
|
1579
|
+
### pruneDeterministicChainExtraEdges
|
|
1554
1580
|
|
|
1555
1581
|
```ts
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1582
|
+
pruneDeterministicChainExtraEdges(
|
|
1583
|
+
network: default,
|
|
1584
|
+
deterministicChain: default[],
|
|
1585
|
+
outputNode: default,
|
|
1586
|
+
): void
|
|
1559
1587
|
```
|
|
1560
1588
|
|
|
1561
|
-
|
|
1589
|
+
Prunes side edges from chain nodes to preserve linear deterministic depth.
|
|
1562
1590
|
|
|
1563
1591
|
Parameters:
|
|
1564
|
-
- `
|
|
1592
|
+
- `network` - - Target network.
|
|
1593
|
+
- `deterministicChain` - - Chain node list.
|
|
1594
|
+
- `outputNode` - - Output node.
|
|
1565
1595
|
|
|
1566
|
-
Returns:
|
|
1596
|
+
Returns: Nothing.
|
|
1567
1597
|
|
|
1568
|
-
###
|
|
1598
|
+
### reconnectThroughRecurrentLayer
|
|
1569
1599
|
|
|
1570
1600
|
```ts
|
|
1571
|
-
|
|
1601
|
+
reconnectThroughRecurrentLayer(
|
|
1572
1602
|
network: default,
|
|
1573
|
-
|
|
1574
|
-
|
|
1603
|
+
connectionToExpand: default,
|
|
1604
|
+
recurrentLayer: RecurrentLayerShape,
|
|
1605
|
+
): default | undefined
|
|
1575
1606
|
```
|
|
1576
1607
|
|
|
1577
|
-
|
|
1608
|
+
Reconnects a source/target pair through a recurrent layer.
|
|
1578
1609
|
|
|
1579
1610
|
Parameters:
|
|
1580
1611
|
- `network` - - Target network.
|
|
1581
|
-
- `
|
|
1612
|
+
- `connectionToExpand` - - Original connection.
|
|
1613
|
+
- `recurrentLayer` - - Recurrent-layer shape.
|
|
1582
1614
|
|
|
1583
|
-
Returns:
|
|
1615
|
+
Returns: Latest newly created connection or undefined.
|
|
1584
1616
|
|
|
1585
|
-
###
|
|
1617
|
+
### reinitializeConnectionGroupWeights
|
|
1586
1618
|
|
|
1587
1619
|
```ts
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1620
|
+
reinitializeConnectionGroupWeights(
|
|
1621
|
+
connections: default[],
|
|
1622
|
+
reinitContext: ConnectionGroupReinitContext,
|
|
1623
|
+
): void
|
|
1591
1624
|
```
|
|
1592
1625
|
|
|
1593
|
-
|
|
1626
|
+
Reinitializes all weights in a connection group.
|
|
1594
1627
|
|
|
1595
1628
|
Parameters:
|
|
1596
|
-
- `
|
|
1629
|
+
- `connections` - - Connection group.
|
|
1630
|
+
- `randomValue` - - Random generator.
|
|
1631
|
+
- `minWeight` - - Minimum sampled weight.
|
|
1632
|
+
- `maxWeight` - - Maximum sampled weight.
|
|
1597
1633
|
|
|
1598
|
-
Returns:
|
|
1634
|
+
Returns: Nothing.
|
|
1599
1635
|
|
|
1600
|
-
###
|
|
1636
|
+
### reinitWeight
|
|
1601
1637
|
|
|
1602
1638
|
```ts
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
):
|
|
1639
|
+
reinitWeight(
|
|
1640
|
+
method: MutationMethod | undefined,
|
|
1641
|
+
): void
|
|
1606
1642
|
```
|
|
1607
1643
|
|
|
1608
|
-
|
|
1644
|
+
Reinitializes incoming, outgoing, and self-connection weights for one target node.
|
|
1645
|
+
|
|
1646
|
+
Weight sampling bounds come from method overrides or default mutation bounds.
|
|
1609
1647
|
|
|
1610
1648
|
Parameters:
|
|
1611
|
-
- `
|
|
1649
|
+
- `this` - - Bound network.
|
|
1650
|
+
- `method` - - Optional method descriptor.
|
|
1612
1651
|
|
|
1613
|
-
Returns:
|
|
1652
|
+
Returns: Nothing.
|
|
1614
1653
|
|
|
1615
|
-
###
|
|
1654
|
+
### removeHiddenNodeAndApplyStabilityNudge
|
|
1616
1655
|
|
|
1617
1656
|
```ts
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
):
|
|
1657
|
+
removeHiddenNodeAndApplyStabilityNudge(
|
|
1658
|
+
network: default,
|
|
1659
|
+
hiddenNode: default,
|
|
1660
|
+
): void
|
|
1622
1661
|
```
|
|
1623
1662
|
|
|
1624
|
-
|
|
1663
|
+
Removes selected hidden node and applies stability nudge.
|
|
1625
1664
|
|
|
1626
1665
|
Parameters:
|
|
1627
|
-
- `
|
|
1628
|
-
- `
|
|
1666
|
+
- `network` - - Target network.
|
|
1667
|
+
- `hiddenNode` - - Hidden node to remove.
|
|
1629
1668
|
|
|
1630
|
-
Returns:
|
|
1669
|
+
Returns: Nothing.
|
|
1631
1670
|
|
|
1632
|
-
###
|
|
1671
|
+
### resolveDeterministicChainMutationContext
|
|
1633
1672
|
|
|
1634
1673
|
```ts
|
|
1635
|
-
|
|
1674
|
+
resolveDeterministicChainMutationContext(
|
|
1636
1675
|
network: default,
|
|
1637
|
-
|
|
1638
|
-
):
|
|
1676
|
+
mutationProps: NetworkMutationProps,
|
|
1677
|
+
): DeterministicChainMutationContext | undefined
|
|
1639
1678
|
```
|
|
1640
1679
|
|
|
1641
|
-
|
|
1680
|
+
Resolves all deterministic add-node prerequisites into one context object.
|
|
1642
1681
|
|
|
1643
1682
|
Parameters:
|
|
1644
1683
|
- `network` - - Target network.
|
|
1645
|
-
- `
|
|
1684
|
+
- `mutationProps` - - Runtime mutation props.
|
|
1646
1685
|
|
|
1647
|
-
Returns:
|
|
1686
|
+
Returns: Deterministic context or undefined when one or more prerequisites fail.
|
|
1648
1687
|
|
|
1649
|
-
###
|
|
1688
|
+
### resolveDistinctPairWithKnownFirstNode
|
|
1650
1689
|
|
|
1651
1690
|
```ts
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1691
|
+
resolveDistinctPairWithKnownFirstNode(
|
|
1692
|
+
swappableNodes: default[],
|
|
1693
|
+
firstNode: default,
|
|
1694
|
+
randomValue: () => number,
|
|
1695
|
+
): DistinctNodePair | undefined
|
|
1655
1696
|
```
|
|
1656
1697
|
|
|
1657
|
-
|
|
1698
|
+
Resolves a distinct pair when first node is already known.
|
|
1658
1699
|
|
|
1659
1700
|
Parameters:
|
|
1660
|
-
- `
|
|
1701
|
+
- `swappableNodes` - - Swap candidate nodes.
|
|
1702
|
+
- `firstNode` - - Chosen first node.
|
|
1703
|
+
- `randomValue` - - Random generator.
|
|
1661
1704
|
|
|
1662
|
-
Returns:
|
|
1705
|
+
Returns: Distinct pair or undefined.
|
|
1663
1706
|
|
|
1664
|
-
###
|
|
1707
|
+
### resolveExpectedChainTarget
|
|
1665
1708
|
|
|
1666
1709
|
```ts
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1710
|
+
resolveExpectedChainTarget(
|
|
1711
|
+
deterministicChain: default[],
|
|
1712
|
+
chainNodeIndex: number,
|
|
1713
|
+
outputNode: default,
|
|
1714
|
+
): default
|
|
1671
1715
|
```
|
|
1672
1716
|
|
|
1673
|
-
|
|
1717
|
+
Resolves the expected outgoing target for a chain node position.
|
|
1674
1718
|
|
|
1675
1719
|
Parameters:
|
|
1676
|
-
- `
|
|
1677
|
-
- `
|
|
1720
|
+
- `deterministicChain` - - Chain node list.
|
|
1721
|
+
- `chainNodeIndex` - - Current chain index.
|
|
1722
|
+
- `outputNode` - - Terminal output node.
|
|
1678
1723
|
|
|
1679
|
-
Returns:
|
|
1724
|
+
Returns: Expected successor target.
|
|
1680
1725
|
|
|
1681
|
-
###
|
|
1726
|
+
### resolveInputOutputEndpoints
|
|
1682
1727
|
|
|
1683
1728
|
```ts
|
|
1684
|
-
|
|
1729
|
+
resolveInputOutputEndpoints(
|
|
1685
1730
|
network: default,
|
|
1686
|
-
|
|
1687
|
-
): void
|
|
1731
|
+
): InputOutputEndpoints | undefined
|
|
1688
1732
|
```
|
|
1689
1733
|
|
|
1690
|
-
|
|
1734
|
+
Resolves input/output endpoints required for seed and deterministic flows.
|
|
1691
1735
|
|
|
1692
1736
|
Parameters:
|
|
1693
1737
|
- `network` - - Target network.
|
|
1694
|
-
- `selectedConnectionPair` - - Source/target pair.
|
|
1695
1738
|
|
|
1696
|
-
Returns:
|
|
1739
|
+
Returns: Endpoint nodes or undefined when missing.
|
|
1697
1740
|
|
|
1698
|
-
###
|
|
1741
|
+
### resolveMethodObject
|
|
1699
1742
|
|
|
1700
1743
|
```ts
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
):
|
|
1744
|
+
resolveMethodObject(
|
|
1745
|
+
method: MutationMethod | undefined,
|
|
1746
|
+
): { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; }
|
|
1704
1747
|
```
|
|
1705
1748
|
|
|
1706
|
-
|
|
1749
|
+
Extracts method-object form when provided.
|
|
1707
1750
|
|
|
1708
1751
|
Parameters:
|
|
1709
|
-
- `
|
|
1752
|
+
- `method` - - Optional mutation method.
|
|
1710
1753
|
|
|
1711
|
-
Returns:
|
|
1754
|
+
Returns: Method object view.
|
|
1712
1755
|
|
|
1713
|
-
###
|
|
1756
|
+
### resolveSelectedBackwardConnectionPair
|
|
1714
1757
|
|
|
1715
1758
|
```ts
|
|
1716
|
-
|
|
1759
|
+
resolveSelectedBackwardConnectionPair(
|
|
1717
1760
|
network: default,
|
|
1718
|
-
|
|
1719
|
-
):
|
|
1761
|
+
randomValue: () => number,
|
|
1762
|
+
): NodePair | undefined
|
|
1720
1763
|
```
|
|
1721
1764
|
|
|
1722
|
-
|
|
1765
|
+
Resolves random selected backward connection pair.
|
|
1723
1766
|
|
|
1724
1767
|
Parameters:
|
|
1725
1768
|
- `network` - - Target network.
|
|
1726
|
-
- `
|
|
1769
|
+
- `randomValue` - - Random generator.
|
|
1727
1770
|
|
|
1728
|
-
Returns:
|
|
1771
|
+
Returns: Selected source/target pair.
|
|
1729
1772
|
|
|
1730
|
-
###
|
|
1773
|
+
### resolveSelectedForwardConnectionPair
|
|
1731
1774
|
|
|
1732
1775
|
```ts
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1776
|
+
resolveSelectedForwardConnectionPair(
|
|
1777
|
+
network: default,
|
|
1778
|
+
randomValue: () => number,
|
|
1779
|
+
): NodePair | undefined
|
|
1736
1780
|
```
|
|
1737
1781
|
|
|
1738
|
-
|
|
1782
|
+
Resolves random selected forward connection pair.
|
|
1739
1783
|
|
|
1740
1784
|
Parameters:
|
|
1741
|
-
- `
|
|
1785
|
+
- `network` - - Target network.
|
|
1786
|
+
- `randomValue` - - Random generator.
|
|
1742
1787
|
|
|
1743
|
-
Returns:
|
|
1788
|
+
Returns: Selected source/target pair.
|
|
1744
1789
|
|
|
1745
|
-
###
|
|
1790
|
+
### resolveSelfConnectionTargetNode
|
|
1746
1791
|
|
|
1747
1792
|
```ts
|
|
1748
|
-
|
|
1793
|
+
resolveSelfConnectionTargetNode(
|
|
1749
1794
|
network: default,
|
|
1750
|
-
|
|
1751
|
-
): default
|
|
1795
|
+
randomValue: () => number,
|
|
1796
|
+
): default | undefined
|
|
1752
1797
|
```
|
|
1753
1798
|
|
|
1754
|
-
|
|
1799
|
+
Resolves random node eligible for self-connection creation.
|
|
1755
1800
|
|
|
1756
1801
|
Parameters:
|
|
1757
1802
|
- `network` - - Target network.
|
|
1758
|
-
- `
|
|
1803
|
+
- `randomValue` - - Random generator.
|
|
1759
1804
|
|
|
1760
|
-
Returns:
|
|
1805
|
+
Returns: Selected node.
|
|
1761
1806
|
|
|
1762
|
-
###
|
|
1807
|
+
### sampleUniform
|
|
1763
1808
|
|
|
1764
1809
|
```ts
|
|
1765
|
-
|
|
1766
|
-
swappableNodes: default[],
|
|
1810
|
+
sampleUniform(
|
|
1767
1811
|
randomValue: () => number,
|
|
1768
|
-
|
|
1812
|
+
minValue: number,
|
|
1813
|
+
maxValue: number,
|
|
1814
|
+
): number
|
|
1769
1815
|
```
|
|
1770
1816
|
|
|
1771
|
-
|
|
1817
|
+
Samples a uniform value from [minValue, maxValue].
|
|
1772
1818
|
|
|
1773
1819
|
Parameters:
|
|
1774
|
-
- `swappableNodes` - - Swap candidate nodes.
|
|
1775
1820
|
- `randomValue` - - Random generator.
|
|
1821
|
+
- `minValue` - - Minimum value.
|
|
1822
|
+
- `maxValue` - - Maximum value.
|
|
1776
1823
|
|
|
1777
|
-
Returns:
|
|
1824
|
+
Returns: Sampled value.
|
|
1778
1825
|
|
|
1779
|
-
###
|
|
1826
|
+
### sampleUniformFromContext
|
|
1780
1827
|
|
|
1781
1828
|
```ts
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
randomValue: () => number,
|
|
1786
|
-
): DistinctNodePair | undefined
|
|
1829
|
+
sampleUniformFromContext(
|
|
1830
|
+
samplingContext: WeightSamplingRangeContext,
|
|
1831
|
+
): number
|
|
1787
1832
|
```
|
|
1788
1833
|
|
|
1789
|
-
|
|
1834
|
+
Samples one weight using a prebuilt range context.
|
|
1790
1835
|
|
|
1791
1836
|
Parameters:
|
|
1792
|
-
- `
|
|
1793
|
-
- `firstNode` - - Chosen first node.
|
|
1794
|
-
- `randomValue` - - Random generator.
|
|
1837
|
+
- `samplingContext` - - Sampling range context.
|
|
1795
1838
|
|
|
1796
|
-
Returns:
|
|
1839
|
+
Returns: Sampled weight.
|
|
1797
1840
|
|
|
1798
|
-
###
|
|
1841
|
+
### selectHiddenNodeForRemoval
|
|
1799
1842
|
|
|
1800
1843
|
```ts
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
randomValue: () => number,
|
|
1844
|
+
selectHiddenNodeForRemoval(
|
|
1845
|
+
network: default,
|
|
1846
|
+
hiddenNodes: default[],
|
|
1805
1847
|
): default | undefined
|
|
1806
1848
|
```
|
|
1807
1849
|
|
|
1808
|
-
|
|
1850
|
+
Selects a hidden node candidate for SUB_NODE mutation.
|
|
1809
1851
|
|
|
1810
1852
|
Parameters:
|
|
1811
|
-
- `
|
|
1812
|
-
- `
|
|
1813
|
-
- `randomValue` - - Random generator.
|
|
1853
|
+
- `network` - - Target network.
|
|
1854
|
+
- `hiddenNodes` - - Hidden nodes.
|
|
1814
1855
|
|
|
1815
|
-
Returns:
|
|
1856
|
+
Returns: Selected hidden node.
|
|
1816
1857
|
|
|
1817
|
-
###
|
|
1858
|
+
### splitConnectionThroughHiddenNode
|
|
1818
1859
|
|
|
1819
1860
|
```ts
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1861
|
+
splitConnectionThroughHiddenNode(
|
|
1862
|
+
network: default,
|
|
1863
|
+
mutationProps: NetworkMutationProps,
|
|
1864
|
+
connectionToSplit: default,
|
|
1865
|
+
): ConnectionSplitResult
|
|
1824
1866
|
```
|
|
1825
1867
|
|
|
1826
|
-
|
|
1868
|
+
Replaces one connection by inserting a hidden node and reconnecting edges.
|
|
1827
1869
|
|
|
1828
1870
|
Parameters:
|
|
1829
|
-
- `
|
|
1830
|
-
- `
|
|
1871
|
+
- `network` - - Target network.
|
|
1872
|
+
- `mutationProps` - - Runtime mutation props.
|
|
1873
|
+
- `connectionToSplit` - - Connection to split.
|
|
1831
1874
|
|
|
1832
|
-
Returns:
|
|
1875
|
+
Returns: Split result values.
|
|
1833
1876
|
|
|
1834
|
-
###
|
|
1877
|
+
### subBackConn
|
|
1835
1878
|
|
|
1836
1879
|
```ts
|
|
1837
|
-
|
|
1838
|
-
firstNode: default,
|
|
1839
|
-
secondNode: default,
|
|
1840
|
-
): void
|
|
1880
|
+
subBackConn(): void
|
|
1841
1881
|
```
|
|
1842
1882
|
|
|
1843
|
-
|
|
1883
|
+
Removes one backward connection that satisfies redundancy constraints.
|
|
1844
1884
|
|
|
1845
1885
|
Parameters:
|
|
1846
|
-
- `
|
|
1847
|
-
- `secondNode` - - Second node.
|
|
1886
|
+
- `this` - - Bound network.
|
|
1848
1887
|
|
|
1849
1888
|
Returns: Nothing.
|
|
1850
1889
|
|
|
1851
|
-
###
|
|
1890
|
+
### subConn
|
|
1852
1891
|
|
|
1853
1892
|
```ts
|
|
1854
|
-
|
|
1855
|
-
network: default,
|
|
1856
|
-
blockType: "lstm" | "gru",
|
|
1857
|
-
): void
|
|
1893
|
+
subConn(): void
|
|
1858
1894
|
```
|
|
1859
1895
|
|
|
1860
|
-
|
|
1896
|
+
Removes one forward connection when structural redundancy constraints are satisfied.
|
|
1897
|
+
|
|
1898
|
+
Constraints require endpoint redundancy and avoid disconnecting peer-layer groups.
|
|
1861
1899
|
|
|
1862
1900
|
Parameters:
|
|
1863
|
-
- `
|
|
1864
|
-
- `blockType` - - Recurrent block type.
|
|
1901
|
+
- `this` - - Bound network.
|
|
1865
1902
|
|
|
1866
1903
|
Returns: Nothing.
|
|
1867
1904
|
|
|
1868
|
-
###
|
|
1905
|
+
### subGate
|
|
1869
1906
|
|
|
1870
1907
|
```ts
|
|
1871
|
-
|
|
1872
|
-
network: default,
|
|
1873
|
-
connectionToExpand: default,
|
|
1874
|
-
blockType: "lstm" | "gru",
|
|
1875
|
-
): void
|
|
1908
|
+
subGate(): void
|
|
1876
1909
|
```
|
|
1877
1910
|
|
|
1878
|
-
|
|
1911
|
+
Removes gating from one randomly selected gated connection.
|
|
1879
1912
|
|
|
1880
1913
|
Parameters:
|
|
1881
|
-
- `
|
|
1882
|
-
- `connectionToExpand` - - Connection to replace.
|
|
1883
|
-
- `blockType` - - Recurrent block type.
|
|
1914
|
+
- `this` - - Bound network.
|
|
1884
1915
|
|
|
1885
1916
|
Returns: Nothing.
|
|
1886
1917
|
|
|
1887
|
-
###
|
|
1918
|
+
### subNode
|
|
1888
1919
|
|
|
1889
1920
|
```ts
|
|
1890
|
-
|
|
1891
|
-
network: default,
|
|
1892
|
-
connectionToExpand: default,
|
|
1893
|
-
): default | null
|
|
1921
|
+
subNode(): void
|
|
1894
1922
|
```
|
|
1895
1923
|
|
|
1896
|
-
|
|
1924
|
+
Removes one hidden node and applies a tiny weight nudge for numerical continuity.
|
|
1925
|
+
|
|
1926
|
+
The stability nudge helps keep downstream mutation effects observable in edge cases
|
|
1927
|
+
where node removal substantially changes effective signal flow.
|
|
1897
1928
|
|
|
1898
1929
|
Parameters:
|
|
1899
|
-
- `
|
|
1900
|
-
- `connectionToExpand` - - Connection being expanded.
|
|
1930
|
+
- `this` - - Bound network.
|
|
1901
1931
|
|
|
1902
|
-
Returns:
|
|
1932
|
+
Returns: Nothing.
|
|
1903
1933
|
|
|
1904
|
-
###
|
|
1934
|
+
### subSelfConn
|
|
1905
1935
|
|
|
1906
1936
|
```ts
|
|
1907
|
-
|
|
1908
|
-
network: default,
|
|
1909
|
-
connectionToExpand: default,
|
|
1910
|
-
recurrentLayer: RecurrentLayerShape,
|
|
1911
|
-
): default | undefined
|
|
1937
|
+
subSelfConn(): void
|
|
1912
1938
|
```
|
|
1913
1939
|
|
|
1914
|
-
|
|
1940
|
+
Removes one existing self-connection chosen at random.
|
|
1915
1941
|
|
|
1916
1942
|
Parameters:
|
|
1917
|
-
- `
|
|
1918
|
-
- `connectionToExpand` - - Original connection.
|
|
1919
|
-
- `recurrentLayer` - - Recurrent-layer shape.
|
|
1943
|
+
- `this` - - Bound network.
|
|
1920
1944
|
|
|
1921
|
-
Returns:
|
|
1945
|
+
Returns: Nothing.
|
|
1922
1946
|
|
|
1923
|
-
###
|
|
1947
|
+
### swapNodeBiasAndSquash
|
|
1924
1948
|
|
|
1925
1949
|
```ts
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
latestConnection: default | undefined,
|
|
1950
|
+
swapNodeBiasAndSquash(
|
|
1951
|
+
firstNode: default,
|
|
1952
|
+
secondNode: default,
|
|
1930
1953
|
): void
|
|
1931
1954
|
```
|
|
1932
1955
|
|
|
1933
|
-
|
|
1956
|
+
Swaps bias and squash values between two nodes.
|
|
1934
1957
|
|
|
1935
1958
|
Parameters:
|
|
1936
|
-
- `
|
|
1937
|
-
- `
|
|
1938
|
-
- `latestConnection` - - Connection to receive the gater.
|
|
1959
|
+
- `firstNode` - - First node.
|
|
1960
|
+
- `secondNode` - - Second node.
|
|
1939
1961
|
|
|
1940
1962
|
Returns: Nothing.
|
|
1941
1963
|
|
|
1942
|
-
###
|
|
1964
|
+
### swapNodes
|
|
1943
1965
|
|
|
1944
1966
|
```ts
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
):
|
|
1967
|
+
swapNodes(
|
|
1968
|
+
method: MutationMethod | undefined,
|
|
1969
|
+
): void
|
|
1948
1970
|
```
|
|
1949
1971
|
|
|
1950
|
-
|
|
1972
|
+
Swaps bias and activation squash functions between two distinct mutable nodes.
|
|
1973
|
+
|
|
1974
|
+
This provides a lightweight structural-parameter recombination without changing
|
|
1975
|
+
graph connectivity.
|
|
1951
1976
|
|
|
1952
1977
|
Parameters:
|
|
1953
|
-
- `
|
|
1978
|
+
- `this` - - Bound network.
|
|
1979
|
+
- `method` - - Optional method descriptor.
|
|
1954
1980
|
|
|
1955
|
-
Returns:
|
|
1981
|
+
Returns: Nothing.
|
|
1956
1982
|
|
|
1957
|
-
###
|
|
1983
|
+
### tryDisconnectConnection
|
|
1958
1984
|
|
|
1959
1985
|
```ts
|
|
1960
|
-
|
|
1986
|
+
tryDisconnectConnection(
|
|
1961
1987
|
network: default,
|
|
1962
|
-
|
|
1988
|
+
connection: default,
|
|
1963
1989
|
): void
|
|
1964
1990
|
```
|
|
1965
1991
|
|
|
1966
|
-
|
|
1992
|
+
Disconnects a connection pair while suppressing errors.
|
|
1967
1993
|
|
|
1968
1994
|
Parameters:
|
|
1969
1995
|
- `network` - - Target network.
|
|
1970
|
-
- `
|
|
1996
|
+
- `connection` - - Connection to remove.
|
|
1971
1997
|
|
|
1972
1998
|
Returns: Nothing.
|
|
1973
1999
|
|
|
1974
|
-
###
|
|
1975
|
-
|
|
1976
|
-
```ts
|
|
1977
|
-
createConnectionGroupReinitContext(
|
|
1978
|
-
randomValue: () => number,
|
|
1979
|
-
methodObject: { [key: string]: unknown; name?: string | undefined; type?: string | undefined; identity?: string | undefined; max?: number | undefined; min?: number | undefined; mutateOutput?: boolean | undefined; },
|
|
1980
|
-
): ConnectionGroupReinitContext
|
|
1981
|
-
```
|
|
1982
|
-
|
|
1983
|
-
Creates immutable context for connection-group reinitialization.
|
|
1984
|
-
|
|
1985
|
-
Parameters:
|
|
1986
|
-
- `randomValue` - - Random generator.
|
|
1987
|
-
- `methodObject` - - Method override object.
|
|
1988
|
-
|
|
1989
|
-
Returns: Reinitialization context.
|
|
1990
|
-
|
|
1991
|
-
### collectConnectionGroupsForReinit
|
|
2000
|
+
### tryGateLatestConnection
|
|
1992
2001
|
|
|
1993
2002
|
```ts
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
2003
|
+
tryGateLatestConnection(
|
|
2004
|
+
network: default,
|
|
2005
|
+
previousGater: default | null,
|
|
2006
|
+
latestConnection: default | undefined,
|
|
2007
|
+
): void
|
|
1997
2008
|
```
|
|
1998
2009
|
|
|
1999
|
-
|
|
2010
|
+
Gates the latest connection when both previous gater and target exist.
|
|
2000
2011
|
|
|
2001
2012
|
Parameters:
|
|
2002
|
-
- `
|
|
2013
|
+
- `network` - - Target network.
|
|
2014
|
+
- `previousGater` - - Previously assigned gater.
|
|
2015
|
+
- `latestConnection` - - Connection to receive the gater.
|
|
2003
2016
|
|
|
2004
|
-
Returns:
|
|
2017
|
+
Returns: Nothing.
|
|
2005
2018
|
|
|
2006
|
-
###
|
|
2019
|
+
### tryReassignGateAfterSplit
|
|
2007
2020
|
|
|
2008
2021
|
```ts
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2022
|
+
tryReassignGateAfterSplit(
|
|
2023
|
+
network: default,
|
|
2024
|
+
randomValue: () => number,
|
|
2025
|
+
splitResult: ConnectionSplitResult,
|
|
2012
2026
|
): void
|
|
2013
2027
|
```
|
|
2014
2028
|
|
|
2015
|
-
|
|
2029
|
+
Reassigns prior gater to one of the new split connections when possible.
|
|
2016
2030
|
|
|
2017
2031
|
Parameters:
|
|
2018
|
-
- `
|
|
2032
|
+
- `network` - - Target network.
|
|
2019
2033
|
- `randomValue` - - Random generator.
|
|
2020
|
-
- `
|
|
2021
|
-
- `maxWeight` - - Maximum sampled weight.
|
|
2034
|
+
- `splitResult` - - Split result values.
|
|
2022
2035
|
|
|
2023
2036
|
Returns: Nothing.
|
|
2024
2037
|
|
|
2025
|
-
###
|
|
2026
|
-
|
|
2027
|
-
```ts
|
|
2028
|
-
createWeightSamplingRangeContext(
|
|
2029
|
-
reinitContext: ConnectionGroupReinitContext,
|
|
2030
|
-
): WeightSamplingRangeContext
|
|
2031
|
-
```
|
|
2032
|
-
|
|
2033
|
-
Creates immutable sampling range context.
|
|
2034
|
-
|
|
2035
|
-
Parameters:
|
|
2036
|
-
- `reinitContext` - - Reinitialization context.
|
|
2037
|
-
|
|
2038
|
-
Returns: Sampling range context.
|
|
2039
|
-
|
|
2040
|
-
### sampleUniformFromContext
|
|
2038
|
+
### warnWhenEnabled
|
|
2041
2039
|
|
|
2042
2040
|
```ts
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
):
|
|
2041
|
+
warnWhenEnabled(
|
|
2042
|
+
message: string,
|
|
2043
|
+
): void
|
|
2046
2044
|
```
|
|
2047
2045
|
|
|
2048
|
-
|
|
2046
|
+
Emits a warning when warning mode is enabled.
|
|
2049
2047
|
|
|
2050
2048
|
Parameters:
|
|
2051
|
-
- `
|
|
2049
|
+
- `message` - - Warning message.
|
|
2052
2050
|
|
|
2053
|
-
Returns:
|
|
2051
|
+
Returns: Nothing.
|
|
2054
2052
|
|
|
2055
|
-
###
|
|
2053
|
+
### wouldDisconnectTargetPeerLayerGroup
|
|
2056
2054
|
|
|
2057
2055
|
```ts
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2056
|
+
wouldDisconnectTargetPeerLayerGroup(
|
|
2057
|
+
network: default,
|
|
2058
|
+
candidateConnection: default,
|
|
2059
|
+
): boolean
|
|
2061
2060
|
```
|
|
2062
2061
|
|
|
2063
|
-
|
|
2062
|
+
Determines whether removal would disconnect a target peer-layer group.
|
|
2064
2063
|
|
|
2065
2064
|
Parameters:
|
|
2066
|
-
- `
|
|
2065
|
+
- `network` - - Target network.
|
|
2066
|
+
- `candidateConnection` - - Connection under evaluation.
|
|
2067
2067
|
|
|
2068
|
-
Returns:
|
|
2068
|
+
Returns: True when peer group would be disconnected.
|