@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
|
@@ -4,59 +4,61 @@ Output node discriminator used for standalone precondition checks.
|
|
|
4
4
|
|
|
5
5
|
## architecture/network/standalone/network.standalone.utils.types.ts
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### ACTIVATION_PRECISION_F32
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Precision token selecting Float32 activation/state buffers.
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### ARROW_TOKEN
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Arrow token used during function-source normalization.
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### BUILTIN_ACTIVATION_SNIPPETS
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Built-in activation snippets emitted as named JavaScript function declarations.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
Values are intentionally compact so emitted standalone source remains deterministic and small.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### COVERAGE_CALL_REGEX
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Regex stripping Istanbul function invocations from source snippets.
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
### COVERAGE_COUNTER_REGEX
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Regex stripping Istanbul counters from stringified functions.
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
### COVERAGE_REPLACEMENT
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
Empty replacement used while stripping coverage artifacts.
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
### EMPTY_TOKEN_REGEX
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Regex removing empty punctuation-only token lines.
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
### FALLBACK_IDENTITY_BODY
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Identity-function fallback body for invalid custom squash sources.
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
### FLOAT32_ARRAY_TYPE
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
Typed-array constructor names used in generated source.
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
### FLOAT64_ARRAY_TYPE
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
Typed-array constructor names used in generated source.
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
### FUNCTION_PREFIX
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
Prefix token used when normalizing function sources.
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
### INPUT_LOOP_LINE
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
Generated source line for copying external inputs into activation buffer.
|
|
56
|
+
|
|
57
|
+
### INVALID_INPUT_SIZE_ERROR_MIDDLE
|
|
56
58
|
|
|
57
59
|
Input-size validation message fragments for generated activate guards.
|
|
58
60
|
|
|
59
|
-
###
|
|
61
|
+
### INVALID_INPUT_SIZE_ERROR_PREFIX
|
|
60
62
|
|
|
61
63
|
Input-size validation message fragments for generated activate guards.
|
|
62
64
|
|
|
@@ -64,43 +66,33 @@ Input-size validation message fragments for generated activate guards.
|
|
|
64
66
|
|
|
65
67
|
Regex stripping Istanbul ignore blocks from stringified functions.
|
|
66
68
|
|
|
67
|
-
###
|
|
69
|
+
### MASK_MULTIPLIER_IDENTITY
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
Multiplicative identity used to omit redundant mask expressions.
|
|
70
72
|
|
|
71
|
-
###
|
|
73
|
+
### NO_OUTPUT_NODES_ERROR
|
|
72
74
|
|
|
73
|
-
|
|
75
|
+
Error message when attempting standalone generation without outputs.
|
|
74
76
|
|
|
75
|
-
###
|
|
77
|
+
### OUTPUT_NODE_TYPE
|
|
76
78
|
|
|
77
|
-
|
|
79
|
+
Output node discriminator used for standalone precondition checks.
|
|
78
80
|
|
|
79
|
-
###
|
|
81
|
+
### REPEATED_SEMICOLON_REGEX
|
|
80
82
|
|
|
81
|
-
Regex
|
|
83
|
+
Regex collapsing repeated semicolons.
|
|
82
84
|
|
|
83
|
-
###
|
|
85
|
+
### SINGLE_TERM_FALLBACK
|
|
84
86
|
|
|
85
|
-
|
|
87
|
+
Fallback literal used when a node has no incoming terms.
|
|
86
88
|
|
|
87
89
|
### SOLITARY_SEMICOLON_REGEX
|
|
88
90
|
|
|
89
91
|
Regex removing solitary semicolon lines created by instrumentation.
|
|
90
92
|
|
|
91
|
-
###
|
|
92
|
-
|
|
93
|
-
Regex collapsing repeated semicolons.
|
|
94
|
-
|
|
95
|
-
### EMPTY_TOKEN_REGEX
|
|
96
|
-
|
|
97
|
-
Regex removing empty punctuation-only token lines.
|
|
98
|
-
|
|
99
|
-
### BUILTIN_ACTIVATION_SNIPPETS
|
|
100
|
-
|
|
101
|
-
Built-in activation snippets emitted as named JavaScript function declarations.
|
|
93
|
+
### SOURCE_MAP_REGEX
|
|
102
94
|
|
|
103
|
-
|
|
95
|
+
Regex stripping sourceMappingURL comments from generated snippets.
|
|
104
96
|
|
|
105
97
|
### StandaloneSquashFunction
|
|
106
98
|
|
|
@@ -113,6 +105,14 @@ StandaloneSquashFunction(
|
|
|
113
105
|
|
|
114
106
|
Activation function shape used by standalone source generation helpers.
|
|
115
107
|
|
|
108
|
+
### STRAY_COMMA_CLOSE_REGEX
|
|
109
|
+
|
|
110
|
+
Regex normalizing stray commas near closing parentheses.
|
|
111
|
+
|
|
112
|
+
### STRAY_COMMA_OPEN_REGEX
|
|
113
|
+
|
|
114
|
+
Regex normalizing stray commas near opening parentheses.
|
|
115
|
+
|
|
116
116
|
## architecture/network/standalone/network.standalone.utils.ts
|
|
117
117
|
|
|
118
118
|
Standalone forward pass code generator.
|
|
@@ -169,18 +169,24 @@ Returns: Source string (ES5-compatible) – safe to eval in sandbox to obtain ac
|
|
|
169
169
|
|
|
170
170
|
## architecture/network/standalone/network.standalone.utils.loop.ts
|
|
171
171
|
|
|
172
|
-
###
|
|
172
|
+
### appendActivationLine
|
|
173
173
|
|
|
174
174
|
```ts
|
|
175
|
-
|
|
175
|
+
appendActivationLine(
|
|
176
176
|
generationContext: StandaloneGenerationContext,
|
|
177
|
+
nodeTraversalIndex: number,
|
|
178
|
+
activationFunctionIndex: number,
|
|
179
|
+
maskValue: number,
|
|
177
180
|
): void
|
|
178
181
|
```
|
|
179
182
|
|
|
180
|
-
Append
|
|
183
|
+
Append generated activation assignment line for one node.
|
|
181
184
|
|
|
182
185
|
Parameters:
|
|
183
186
|
- `generationContext` - Mutable generation context.
|
|
187
|
+
- `nodeTraversalIndex` - Node index.
|
|
188
|
+
- `activationFunctionIndex` - Function table index.
|
|
189
|
+
- `maskValue` - Multiplicative mask.
|
|
184
190
|
|
|
185
191
|
Returns: Void.
|
|
186
192
|
|
|
@@ -199,6 +205,21 @@ Parameters:
|
|
|
199
205
|
|
|
200
206
|
Returns: Void.
|
|
201
207
|
|
|
208
|
+
### appendInputSeedLine
|
|
209
|
+
|
|
210
|
+
```ts
|
|
211
|
+
appendInputSeedLine(
|
|
212
|
+
generationContext: StandaloneGenerationContext,
|
|
213
|
+
): void
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
Append the generated input-copy loop to the standalone body.
|
|
217
|
+
|
|
218
|
+
Parameters:
|
|
219
|
+
- `generationContext` - Mutable generation context.
|
|
220
|
+
|
|
221
|
+
Returns: Void.
|
|
222
|
+
|
|
202
223
|
### appendOutputReturnLine
|
|
203
224
|
|
|
204
225
|
```ts
|
|
@@ -254,43 +275,39 @@ Parameters:
|
|
|
254
275
|
|
|
255
276
|
Returns: Void.
|
|
256
277
|
|
|
257
|
-
###
|
|
278
|
+
### buildMaskSuffix
|
|
258
279
|
|
|
259
280
|
```ts
|
|
260
|
-
|
|
261
|
-
generationContext: StandaloneGenerationContext,
|
|
262
|
-
nodeTraversalIndex: number,
|
|
263
|
-
activationFunctionIndex: number,
|
|
281
|
+
buildMaskSuffix(
|
|
264
282
|
maskValue: number,
|
|
265
|
-
):
|
|
283
|
+
): string
|
|
266
284
|
```
|
|
267
285
|
|
|
268
|
-
|
|
286
|
+
Build optional activation mask suffix for generated assignment line.
|
|
269
287
|
|
|
270
288
|
Parameters:
|
|
271
|
-
- `
|
|
272
|
-
- `nodeTraversalIndex` - Node index.
|
|
273
|
-
- `activationFunctionIndex` - Function table index.
|
|
274
|
-
- `maskValue` - Multiplicative mask.
|
|
289
|
+
- `maskValue` - Multiplicative mask value.
|
|
275
290
|
|
|
276
|
-
Returns:
|
|
291
|
+
Returns: Empty suffix for identity, otherwise multiplicative fragment.
|
|
277
292
|
|
|
278
|
-
|
|
293
|
+
## architecture/network/standalone/network.standalone.utils.graph.ts
|
|
294
|
+
|
|
295
|
+
### appendGateMultiplier
|
|
279
296
|
|
|
280
297
|
```ts
|
|
281
|
-
|
|
282
|
-
|
|
298
|
+
appendGateMultiplier(
|
|
299
|
+
connectionTerm: string,
|
|
300
|
+
gateNode: default | null,
|
|
283
301
|
): string
|
|
284
302
|
```
|
|
285
303
|
|
|
286
|
-
|
|
304
|
+
Append a gate activation multiplier to a connection term when a gate exists.
|
|
287
305
|
|
|
288
306
|
Parameters:
|
|
289
|
-
- `
|
|
290
|
-
|
|
291
|
-
Returns: Empty suffix for identity, otherwise multiplicative fragment.
|
|
307
|
+
- `connectionTerm` - Base connection term.
|
|
308
|
+
- `gateNode` - Optional gate node.
|
|
292
309
|
|
|
293
|
-
|
|
310
|
+
Returns: Term with optional gate multiplier.
|
|
294
311
|
|
|
295
312
|
### buildNodeSumExpression
|
|
296
313
|
|
|
@@ -309,84 +326,82 @@ Parameters:
|
|
|
309
326
|
|
|
310
327
|
Returns: String expression used for generated `S[index]` assignment.
|
|
311
328
|
|
|
312
|
-
###
|
|
329
|
+
### collectIncomingTerms
|
|
313
330
|
|
|
314
331
|
```ts
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
):
|
|
332
|
+
collectIncomingTerms(
|
|
333
|
+
currentNode: default,
|
|
334
|
+
): string[]
|
|
318
335
|
```
|
|
319
336
|
|
|
320
|
-
Collect
|
|
337
|
+
Collect feed-forward inbound connection terms for a node.
|
|
321
338
|
|
|
322
339
|
Parameters:
|
|
323
|
-
- `
|
|
340
|
+
- `currentNode` - Current node.
|
|
324
341
|
|
|
325
|
-
Returns:
|
|
342
|
+
Returns: Weighted term expressions.
|
|
326
343
|
|
|
327
|
-
###
|
|
344
|
+
### collectOutputIndexes
|
|
328
345
|
|
|
329
346
|
```ts
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
):
|
|
347
|
+
collectOutputIndexes(
|
|
348
|
+
generationContext: StandaloneGenerationContext,
|
|
349
|
+
): number[]
|
|
333
350
|
```
|
|
334
351
|
|
|
335
|
-
|
|
352
|
+
Collect output node indexes from the output tail segment.
|
|
336
353
|
|
|
337
354
|
Parameters:
|
|
338
|
-
- `
|
|
355
|
+
- `generationContext` - Mutable generation context.
|
|
339
356
|
|
|
340
|
-
Returns:
|
|
357
|
+
Returns: Output indexes used for result array emission.
|
|
341
358
|
|
|
342
|
-
###
|
|
359
|
+
### collectSelfConnectionTerms
|
|
343
360
|
|
|
344
361
|
```ts
|
|
345
|
-
|
|
362
|
+
collectSelfConnectionTerms(
|
|
346
363
|
currentNode: default,
|
|
364
|
+
nodeTraversalIndex: number,
|
|
347
365
|
): string[]
|
|
348
366
|
```
|
|
349
367
|
|
|
350
|
-
Collect
|
|
368
|
+
Collect recurrent self-connection term for a node when present.
|
|
351
369
|
|
|
352
370
|
Parameters:
|
|
353
371
|
- `currentNode` - Current node.
|
|
372
|
+
- `nodeTraversalIndex` - Node index used for self-state reference.
|
|
354
373
|
|
|
355
|
-
Returns:
|
|
374
|
+
Returns: Zero or one recurrent term expressions.
|
|
356
375
|
|
|
357
|
-
###
|
|
376
|
+
### foldTermsIntoExpression
|
|
358
377
|
|
|
359
378
|
```ts
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
): string[]
|
|
379
|
+
foldTermsIntoExpression(
|
|
380
|
+
allTerms: string[],
|
|
381
|
+
): string
|
|
364
382
|
```
|
|
365
383
|
|
|
366
|
-
|
|
384
|
+
Fold a term collection into a summation expression.
|
|
367
385
|
|
|
368
386
|
Parameters:
|
|
369
|
-
- `
|
|
370
|
-
- `nodeTraversalIndex` - Node index used for self-state reference.
|
|
387
|
+
- `allTerms` - Term collection.
|
|
371
388
|
|
|
372
|
-
Returns:
|
|
389
|
+
Returns: Summation expression or fallback zero literal.
|
|
373
390
|
|
|
374
|
-
###
|
|
391
|
+
### formatOutputArrayValues
|
|
375
392
|
|
|
376
393
|
```ts
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
gateNode: default | null,
|
|
394
|
+
formatOutputArrayValues(
|
|
395
|
+
outputIndexes: number[],
|
|
380
396
|
): string
|
|
381
397
|
```
|
|
382
398
|
|
|
383
|
-
|
|
399
|
+
Format output activation selectors for generated return expression.
|
|
384
400
|
|
|
385
401
|
Parameters:
|
|
386
|
-
- `
|
|
387
|
-
- `gateNode` - Optional gate node.
|
|
402
|
+
- `outputIndexes` - Output node indexes.
|
|
388
403
|
|
|
389
|
-
Returns:
|
|
404
|
+
Returns: Comma-separated `A[index]` selector list.
|
|
390
405
|
|
|
391
406
|
### getOptionalNodeIndex
|
|
392
407
|
|
|
@@ -420,21 +435,6 @@ Parameters:
|
|
|
420
435
|
|
|
421
436
|
Returns: Combined term collection.
|
|
422
437
|
|
|
423
|
-
### foldTermsIntoExpression
|
|
424
|
-
|
|
425
|
-
```ts
|
|
426
|
-
foldTermsIntoExpression(
|
|
427
|
-
allTerms: string[],
|
|
428
|
-
): string
|
|
429
|
-
```
|
|
430
|
-
|
|
431
|
-
Fold a term collection into a summation expression.
|
|
432
|
-
|
|
433
|
-
Parameters:
|
|
434
|
-
- `allTerms` - Term collection.
|
|
435
|
-
|
|
436
|
-
Returns: Summation expression or fallback zero literal.
|
|
437
|
-
|
|
438
438
|
## architecture/network/standalone/network.standalone.utils.setup.ts
|
|
439
439
|
|
|
440
440
|
### asStandaloneProps
|
|
@@ -452,35 +452,35 @@ Parameters:
|
|
|
452
452
|
|
|
453
453
|
Returns: Internal network properties used by the standalone generator.
|
|
454
454
|
|
|
455
|
-
###
|
|
455
|
+
### createGenerationContext
|
|
456
456
|
|
|
457
457
|
```ts
|
|
458
|
-
|
|
458
|
+
createGenerationContext(
|
|
459
459
|
standaloneProps: NetworkStandaloneProps,
|
|
460
|
-
):
|
|
460
|
+
): StandaloneGenerationContext
|
|
461
461
|
```
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
Create a fresh generation context used across orchestration steps.
|
|
464
464
|
|
|
465
465
|
Parameters:
|
|
466
466
|
- `standaloneProps` - Internal standalone network view.
|
|
467
467
|
|
|
468
|
-
Returns:
|
|
468
|
+
Returns: Initialized generation context.
|
|
469
469
|
|
|
470
|
-
###
|
|
470
|
+
### ensureOutputNodesExist
|
|
471
471
|
|
|
472
472
|
```ts
|
|
473
|
-
|
|
473
|
+
ensureOutputNodesExist(
|
|
474
474
|
standaloneProps: NetworkStandaloneProps,
|
|
475
|
-
):
|
|
475
|
+
): void
|
|
476
476
|
```
|
|
477
477
|
|
|
478
|
-
|
|
478
|
+
Validate that the network has at least one output node.
|
|
479
479
|
|
|
480
480
|
Parameters:
|
|
481
481
|
- `standaloneProps` - Internal standalone network view.
|
|
482
482
|
|
|
483
|
-
Returns:
|
|
483
|
+
Returns: Void.
|
|
484
484
|
|
|
485
485
|
### seedNodeIndexesAndState
|
|
486
486
|
|
|
@@ -546,54 +546,54 @@ Parameters:
|
|
|
546
546
|
|
|
547
547
|
Returns: Comma-separated activation function names.
|
|
548
548
|
|
|
549
|
-
###
|
|
549
|
+
### buildInputGuardLine
|
|
550
550
|
|
|
551
551
|
```ts
|
|
552
|
-
|
|
553
|
-
|
|
552
|
+
buildInputGuardLine(
|
|
553
|
+
expectedInputSize: number,
|
|
554
554
|
): string
|
|
555
555
|
```
|
|
556
556
|
|
|
557
|
-
|
|
557
|
+
Build generated input length guard line.
|
|
558
558
|
|
|
559
559
|
Parameters:
|
|
560
|
-
- `
|
|
560
|
+
- `expectedInputSize` - Required input vector size.
|
|
561
561
|
|
|
562
|
-
Returns:
|
|
562
|
+
Returns: Guard statement line including trailing newline.
|
|
563
563
|
|
|
564
|
-
###
|
|
564
|
+
### resolveActivationArrayType
|
|
565
565
|
|
|
566
566
|
```ts
|
|
567
|
-
|
|
568
|
-
|
|
567
|
+
resolveActivationArrayType(
|
|
568
|
+
generationContext: StandaloneGenerationContext,
|
|
569
569
|
): string
|
|
570
570
|
```
|
|
571
571
|
|
|
572
|
-
|
|
572
|
+
Resolve typed-array constructor name based on configured activation precision.
|
|
573
573
|
|
|
574
574
|
Parameters:
|
|
575
|
-
- `
|
|
575
|
+
- `generationContext` - Mutable generation context.
|
|
576
576
|
|
|
577
|
-
Returns:
|
|
577
|
+
Returns: Constructor name used in generated source.
|
|
578
578
|
|
|
579
579
|
## architecture/network/standalone/network.standalone.utils.activation.ts
|
|
580
580
|
|
|
581
|
-
###
|
|
581
|
+
### convertArrowToNamedFunction
|
|
582
582
|
|
|
583
583
|
```ts
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
584
|
+
convertArrowToNamedFunction(
|
|
585
|
+
sourceCode: string,
|
|
586
|
+
squashName: string,
|
|
587
587
|
): string
|
|
588
588
|
```
|
|
589
589
|
|
|
590
|
-
|
|
590
|
+
Convert an arrow-function source string into a named function declaration source.
|
|
591
591
|
|
|
592
592
|
Parameters:
|
|
593
|
-
- `
|
|
594
|
-
- `
|
|
593
|
+
- `sourceCode` - Arrow-function source.
|
|
594
|
+
- `squashName` - Required function name.
|
|
595
595
|
|
|
596
|
-
Returns:
|
|
596
|
+
Returns: Named function source.
|
|
597
597
|
|
|
598
598
|
### ensureActivationFunctionIndex
|
|
599
599
|
|
|
@@ -616,140 +616,140 @@ Parameters:
|
|
|
616
616
|
|
|
617
617
|
Returns: Activation function index within generated `F` array.
|
|
618
618
|
|
|
619
|
-
###
|
|
619
|
+
### ensureNamedFunctionSource
|
|
620
620
|
|
|
621
621
|
```ts
|
|
622
|
-
|
|
622
|
+
ensureNamedFunctionSource(
|
|
623
|
+
sourceCode: string,
|
|
623
624
|
squashName: string,
|
|
624
|
-
squashFunction: StandaloneSquashFunction,
|
|
625
|
-
nodeTraversalIndex: number,
|
|
626
625
|
): string
|
|
627
626
|
```
|
|
628
627
|
|
|
629
|
-
|
|
628
|
+
Ensure generated function source starts with the required named signature.
|
|
630
629
|
|
|
631
630
|
Parameters:
|
|
632
|
-
- `
|
|
633
|
-
- `
|
|
634
|
-
- `nodeTraversalIndex` - Current node index for fallback flow.
|
|
631
|
+
- `sourceCode` - Function source.
|
|
632
|
+
- `squashName` - Required function name.
|
|
635
633
|
|
|
636
|
-
Returns: Named function source
|
|
634
|
+
Returns: Named function source.
|
|
637
635
|
|
|
638
|
-
###
|
|
636
|
+
### normalizeArrowBody
|
|
639
637
|
|
|
640
638
|
```ts
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
squashName: string,
|
|
639
|
+
normalizeArrowBody(
|
|
640
|
+
bodySegment: string,
|
|
644
641
|
): string
|
|
645
642
|
```
|
|
646
643
|
|
|
647
|
-
Normalize
|
|
644
|
+
Normalize arrow body into a function-body block.
|
|
648
645
|
|
|
649
646
|
Parameters:
|
|
650
|
-
- `
|
|
651
|
-
- `squashName` - Required function name.
|
|
647
|
+
- `bodySegment` - Raw arrow body segment.
|
|
652
648
|
|
|
653
|
-
Returns:
|
|
649
|
+
Returns: Function body block string.
|
|
654
650
|
|
|
655
|
-
###
|
|
651
|
+
### normalizeArrowParameters
|
|
656
652
|
|
|
657
653
|
```ts
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
squashName: string,
|
|
661
|
-
nodeTraversalIndex: number,
|
|
654
|
+
normalizeArrowParameters(
|
|
655
|
+
parameterSegment: string,
|
|
662
656
|
): string
|
|
663
657
|
```
|
|
664
658
|
|
|
665
|
-
Normalize
|
|
659
|
+
Normalize arrow parameter segment into comma-separated parameter list content.
|
|
666
660
|
|
|
667
661
|
Parameters:
|
|
668
|
-
- `
|
|
669
|
-
- `squashName` - Required function name.
|
|
670
|
-
- `nodeTraversalIndex` - Current node index for traversal-context parity.
|
|
662
|
+
- `parameterSegment` - Raw arrow parameter segment.
|
|
671
663
|
|
|
672
|
-
Returns:
|
|
664
|
+
Returns: Parameter list body (without surrounding parentheses).
|
|
673
665
|
|
|
674
|
-
###
|
|
666
|
+
### normalizeBuiltinSource
|
|
675
667
|
|
|
676
668
|
```ts
|
|
677
|
-
|
|
669
|
+
normalizeBuiltinSource(
|
|
678
670
|
sourceCode: string,
|
|
679
671
|
squashName: string,
|
|
680
672
|
): string
|
|
681
673
|
```
|
|
682
674
|
|
|
683
|
-
|
|
675
|
+
Normalize built-in activation source to a named function and strip coverage artifacts.
|
|
684
676
|
|
|
685
677
|
Parameters:
|
|
686
|
-
- `sourceCode` -
|
|
678
|
+
- `sourceCode` - Built-in function source.
|
|
687
679
|
- `squashName` - Required function name.
|
|
688
680
|
|
|
689
|
-
Returns:
|
|
681
|
+
Returns: Cleaned named function source.
|
|
690
682
|
|
|
691
|
-
###
|
|
683
|
+
### normalizeCustomSource
|
|
692
684
|
|
|
693
685
|
```ts
|
|
694
|
-
|
|
686
|
+
normalizeCustomSource(
|
|
695
687
|
sourceCode: string,
|
|
696
688
|
squashName: string,
|
|
689
|
+
nodeTraversalIndex: number,
|
|
697
690
|
): string
|
|
698
691
|
```
|
|
699
692
|
|
|
700
|
-
|
|
693
|
+
Normalize custom activation source with function/arrow/fallback handling.
|
|
701
694
|
|
|
702
695
|
Parameters:
|
|
703
|
-
- `sourceCode` -
|
|
696
|
+
- `sourceCode` - Custom function source.
|
|
704
697
|
- `squashName` - Required function name.
|
|
698
|
+
- `nodeTraversalIndex` - Current node index for traversal-context parity.
|
|
705
699
|
|
|
706
|
-
Returns:
|
|
700
|
+
Returns: Cleaned named function source.
|
|
707
701
|
|
|
708
|
-
###
|
|
702
|
+
### registerActivationFunction
|
|
709
703
|
|
|
710
704
|
```ts
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
705
|
+
registerActivationFunction(
|
|
706
|
+
generationContext: StandaloneGenerationContext,
|
|
707
|
+
squashName: string,
|
|
708
|
+
functionSource: string,
|
|
709
|
+
): void
|
|
714
710
|
```
|
|
715
711
|
|
|
716
|
-
|
|
712
|
+
Register a function source and allocate its numeric index.
|
|
717
713
|
|
|
718
714
|
Parameters:
|
|
719
|
-
- `
|
|
715
|
+
- `generationContext` - Mutable generation context.
|
|
716
|
+
- `squashName` - Activation function name.
|
|
717
|
+
- `functionSource` - Named function source to store.
|
|
720
718
|
|
|
721
|
-
Returns:
|
|
719
|
+
Returns: Void.
|
|
722
720
|
|
|
723
|
-
###
|
|
721
|
+
### resolveActivationFunctionSource
|
|
724
722
|
|
|
725
723
|
```ts
|
|
726
|
-
|
|
727
|
-
|
|
724
|
+
resolveActivationFunctionSource(
|
|
725
|
+
squashName: string,
|
|
726
|
+
squashFunction: StandaloneSquashFunction,
|
|
727
|
+
nodeTraversalIndex: number,
|
|
728
728
|
): string
|
|
729
729
|
```
|
|
730
730
|
|
|
731
|
-
|
|
731
|
+
Resolve emitted source for built-in or custom activation functions.
|
|
732
732
|
|
|
733
733
|
Parameters:
|
|
734
|
-
- `
|
|
734
|
+
- `squashName` - Activation function name.
|
|
735
|
+
- `squashFunction` - Activation function implementation.
|
|
736
|
+
- `nodeTraversalIndex` - Current node index for fallback flow.
|
|
735
737
|
|
|
736
|
-
Returns:
|
|
738
|
+
Returns: Named function source string.
|
|
737
739
|
|
|
738
|
-
###
|
|
740
|
+
### resolveSquashName
|
|
739
741
|
|
|
740
742
|
```ts
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
): void
|
|
743
|
+
resolveSquashName(
|
|
744
|
+
currentNode: default,
|
|
745
|
+
nodeTraversalIndex: number,
|
|
746
|
+
): string
|
|
746
747
|
```
|
|
747
748
|
|
|
748
|
-
|
|
749
|
+
Resolve a stable activation function name for emission.
|
|
749
750
|
|
|
750
751
|
Parameters:
|
|
751
|
-
- `
|
|
752
|
-
- `
|
|
753
|
-
- `functionSource` - Named function source to store.
|
|
752
|
+
- `currentNode` - Current node.
|
|
753
|
+
- `nodeTraversalIndex` - Node index for anonymous-name fallback.
|
|
754
754
|
|
|
755
|
-
Returns:
|
|
755
|
+
Returns: Activation function identifier.
|