@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.
Files changed (210) hide show
  1. package/.github/copilot-instructions.md +11 -0
  2. package/.github/skills/trace-analyzer-extension/SKILL.md +3 -3
  3. package/.github/skills/trace-analyzer-extension/assets/extension-checklist.md +1 -1
  4. package/.github/skills/trace-analyzer-extension/references/analyzer-extension-workflow.md +1 -1
  5. package/.github/skills/trace-audit-reporting/SKILL.md +3 -3
  6. package/.github/skills/trace-audit-reporting/references/trace-analysis-workflow.md +1 -1
  7. package/package.json +19 -13
  8. package/plans/Flappy_Bird_Folder_Documentation_Pass.md +4 -4
  9. package/plans/README.md +24 -0
  10. package/plans/Roadmap.md +62 -40
  11. package/plans/analyze-trace-solid-split.plans.md +66 -0
  12. package/plans/architecture-solid-split.plans.md +9 -15
  13. package/plans/asciiMaze-typescript-repair.plans.md +1 -1
  14. package/plans/generate-docs-solid-split.plans.md +87 -0
  15. package/plans/methods-docs.plans.md +25 -1
  16. package/plans/methods-solid-split.plans.md +14 -14
  17. package/plans/neat-docs.plans.md +9 -1
  18. package/plans/neat-test-surface-repair.plans.md +1 -1
  19. package/plans/render-docs-html-solid-split.plans.md +68 -0
  20. package/plans/src-no-explicit-any-cleanup.plans.md +1 -1
  21. package/plans/utils-docs.plans.md +6 -1
  22. package/scripts/analyze-trace/analyze-trace.analysis.ts +479 -0
  23. package/scripts/analyze-trace/analyze-trace.constants.ts +35 -0
  24. package/scripts/analyze-trace/analyze-trace.io.ts +69 -0
  25. package/scripts/analyze-trace/analyze-trace.report.ts +100 -0
  26. package/scripts/analyze-trace/analyze-trace.shared.ts +116 -0
  27. package/scripts/analyze-trace/analyze-trace.ts +45 -0
  28. package/scripts/analyze-trace/analyze-trace.types.ts +72 -0
  29. package/scripts/assets/theme.css +80 -23
  30. package/scripts/copy-examples.ts +239 -0
  31. package/scripts/export-onnx.ts +223 -0
  32. package/scripts/generate-bench-tables.ts +378 -37
  33. package/scripts/generate-docs/generate-docs.constants.ts +107 -0
  34. package/scripts/generate-docs/generate-docs.order.ts +355 -0
  35. package/scripts/generate-docs/generate-docs.state.ts +31 -0
  36. package/scripts/generate-docs/generate-docs.targets.ts +165 -0
  37. package/scripts/generate-docs/generate-docs.ts +63 -0
  38. package/scripts/generate-docs/generate-docs.types.ts +112 -0
  39. package/scripts/generate-docs/output/generate-docs.output.folder-index.utils.ts +167 -0
  40. package/scripts/generate-docs/output/generate-docs.output.ordering.utils.ts +353 -0
  41. package/scripts/generate-docs/output/generate-docs.output.readme.utils.ts +420 -0
  42. package/scripts/generate-docs/output/generate-docs.output.ts +123 -0
  43. package/scripts/generate-docs/output/generate-docs.output.warnings.utils.ts +219 -0
  44. package/scripts/generate-docs/symbols/generate-docs.symbols.collection.utils.ts +365 -0
  45. package/scripts/generate-docs/symbols/generate-docs.symbols.jsdoc.utils.ts +373 -0
  46. package/scripts/generate-docs/symbols/generate-docs.symbols.normalize.utils.ts +155 -0
  47. package/scripts/generate-docs/symbols/generate-docs.symbols.render.utils.ts +149 -0
  48. package/scripts/generate-docs/symbols/generate-docs.symbols.signature.utils.ts +289 -0
  49. package/scripts/generate-docs/symbols/generate-docs.symbols.ts +11 -0
  50. package/scripts/mermaid-cli.mjs +102 -22
  51. package/scripts/mermaid-cli.ts +736 -0
  52. package/scripts/render-docs-html/render-docs-html.assets.ts +54 -0
  53. package/scripts/render-docs-html/render-docs-html.mermaid.ts +245 -0
  54. package/scripts/{render-docs-html.sidebar.ts → render-docs-html/render-docs-html.navigation.ts} +141 -144
  55. package/scripts/render-docs-html/render-docs-html.pages.ts +333 -0
  56. package/scripts/render-docs-html/render-docs-html.shared.ts +333 -0
  57. package/scripts/render-docs-html/render-docs-html.types.ts +42 -0
  58. package/scripts/render-docs-html.ts +23 -587
  59. package/scripts/run-docs.ts +238 -0
  60. package/scripts/write-dist-docs-pkg.ts +40 -0
  61. package/src/README.md +75 -75
  62. package/src/architecture/connection/README.md +5 -5
  63. package/src/architecture/layer/README.md +508 -508
  64. package/src/architecture/network/README.md +1458 -1458
  65. package/src/architecture/network/activate/README.md +694 -694
  66. package/src/architecture/network/bootstrap/README.md +77 -77
  67. package/src/architecture/network/connect/README.md +74 -74
  68. package/src/architecture/network/deterministic/README.md +135 -135
  69. package/src/architecture/network/evolve/README.md +364 -364
  70. package/src/architecture/network/gating/README.md +130 -130
  71. package/src/architecture/network/genetic/README.md +399 -399
  72. package/src/architecture/network/mutate/README.md +897 -897
  73. package/src/architecture/network/onnx/README.md +720 -720
  74. package/src/architecture/network/onnx/export/README.md +728 -728
  75. package/src/architecture/network/onnx/export/layers/README.md +450 -450
  76. package/src/architecture/network/onnx/import/README.md +618 -618
  77. package/src/architecture/network/onnx/schema/README.md +32 -32
  78. package/src/architecture/network/prune/README.md +245 -245
  79. package/src/architecture/network/remove/README.md +135 -135
  80. package/src/architecture/network/runtime/README.md +106 -106
  81. package/src/architecture/network/serialize/README.md +542 -542
  82. package/src/architecture/network/slab/README.md +608 -608
  83. package/src/architecture/network/standalone/README.md +212 -212
  84. package/src/architecture/network/stats/README.md +84 -84
  85. package/src/architecture/network/topology/README.md +465 -465
  86. package/src/architecture/network/training/README.md +200 -200
  87. package/src/architecture/node/README.md +5 -5
  88. package/src/architecture/nodePool/README.md +14 -14
  89. package/src/methods/README.md +99 -99
  90. package/src/methods/activation/README.md +189 -189
  91. package/src/methods/cost/README.md +131 -131
  92. package/src/methods/rate/README.md +86 -86
  93. package/src/multithreading/README.md +77 -77
  94. package/src/multithreading/workers/browser/README.md +8 -8
  95. package/src/multithreading/workers/node/README.md +8 -8
  96. package/src/neat/README.md +148 -148
  97. package/src/neat/adaptive/README.md +120 -120
  98. package/src/neat/adaptive/acceptance/README.md +40 -40
  99. package/src/neat/adaptive/complexity/README.md +137 -137
  100. package/src/neat/adaptive/core/README.md +197 -197
  101. package/src/neat/adaptive/lineage/README.md +90 -90
  102. package/src/neat/adaptive/mutation/README.md +284 -284
  103. package/src/neat/compat/README.md +43 -43
  104. package/src/neat/compat/core/README.md +90 -90
  105. package/src/neat/diversity/README.md +35 -35
  106. package/src/neat/diversity/core/README.md +88 -88
  107. package/src/neat/evaluate/README.md +85 -85
  108. package/src/neat/evaluate/auto-distance/README.md +75 -75
  109. package/src/neat/evaluate/entropy-compat/README.md +37 -37
  110. package/src/neat/evaluate/entropy-sharing/README.md +43 -43
  111. package/src/neat/evaluate/fitness/README.md +23 -23
  112. package/src/neat/evaluate/novelty/README.md +120 -120
  113. package/src/neat/evaluate/objectives/README.md +17 -17
  114. package/src/neat/evaluate/shared/README.md +94 -94
  115. package/src/neat/evolve/README.md +96 -96
  116. package/src/neat/evolve/adaptive/README.md +60 -60
  117. package/src/neat/evolve/objectives/README.md +63 -63
  118. package/src/neat/evolve/offspring/README.md +56 -56
  119. package/src/neat/evolve/population/README.md +171 -171
  120. package/src/neat/evolve/runtime/README.md +79 -79
  121. package/src/neat/evolve/speciation/README.md +74 -74
  122. package/src/neat/evolve/warnings/README.md +10 -10
  123. package/src/neat/export/README.md +114 -114
  124. package/src/neat/helpers/README.md +50 -50
  125. package/src/neat/init/README.md +9 -9
  126. package/src/neat/lineage/core/README.md +101 -101
  127. package/src/neat/multiobjective/category/README.md +74 -74
  128. package/src/neat/multiobjective/crowding/README.md +272 -272
  129. package/src/neat/multiobjective/dominance/README.md +171 -171
  130. package/src/neat/multiobjective/fronts/README.md +68 -68
  131. package/src/neat/multiobjective/metrics/README.md +43 -43
  132. package/src/neat/multiobjective/objectives/README.md +31 -31
  133. package/src/neat/multiobjective/shared/README.md +27 -27
  134. package/src/neat/mutation/README.md +97 -97
  135. package/src/neat/mutation/add-conn/README.md +115 -115
  136. package/src/neat/mutation/add-node/README.md +126 -126
  137. package/src/neat/mutation/flow/README.md +149 -149
  138. package/src/neat/mutation/repair/README.md +185 -185
  139. package/src/neat/mutation/select/README.md +117 -117
  140. package/src/neat/mutation/shared/README.md +32 -32
  141. package/src/neat/objectives/README.md +25 -25
  142. package/src/neat/objectives/core/README.md +67 -67
  143. package/src/neat/pruning/README.md +40 -40
  144. package/src/neat/pruning/core/README.md +171 -171
  145. package/src/neat/pruning/facade/README.md +32 -32
  146. package/src/neat/rng/README.md +104 -104
  147. package/src/neat/rng/core/README.md +137 -137
  148. package/src/neat/rng/facade/README.md +50 -50
  149. package/src/neat/selection/README.md +111 -111
  150. package/src/neat/selection/core/README.md +227 -227
  151. package/src/neat/selection/facade/README.md +61 -61
  152. package/src/neat/shared/README.md +163 -163
  153. package/src/neat/speciation/README.md +31 -31
  154. package/src/neat/speciation/threshold/README.md +35 -35
  155. package/src/neat/species/README.md +25 -25
  156. package/src/neat/species/core/README.md +20 -20
  157. package/src/neat/species/core/shared/README.md +18 -18
  158. package/src/neat/species/history/context/README.md +22 -22
  159. package/src/neat/telemetry/accessors/README.md +58 -58
  160. package/src/neat/telemetry/exports/README.md +233 -233
  161. package/src/neat/telemetry/facade/README.md +252 -252
  162. package/src/neat/telemetry/facade/archive/README.md +57 -57
  163. package/src/neat/telemetry/facade/buffer/README.md +43 -43
  164. package/src/neat/telemetry/facade/lineage/README.md +12 -12
  165. package/src/neat/telemetry/facade/objectives/README.md +44 -44
  166. package/src/neat/telemetry/facade/runtime/README.md +26 -26
  167. package/src/neat/telemetry/facade/species/README.md +27 -27
  168. package/src/neat/telemetry/metrics/README.md +696 -696
  169. package/src/neat/telemetry/recorder/README.md +57 -57
  170. package/src/neat/telemetry/types/README.md +32 -32
  171. package/src/neat/topology-intent/README.md +75 -75
  172. package/src/utils/README.md +193 -193
  173. package/test/examples/asciiMaze/browser-entry/README.md +92 -92
  174. package/test/examples/asciiMaze/dashboardManager/README.md +109 -109
  175. package/test/examples/asciiMaze/dashboardManager/telemetry/README.md +28 -28
  176. package/test/examples/asciiMaze/evolutionEngine/README.md +1527 -1527
  177. package/test/examples/asciiMaze/mazeMovement/README.md +105 -105
  178. package/test/examples/asciiMaze/mazeMovement/finalization/README.md +16 -16
  179. package/test/examples/asciiMaze/mazeMovement/policy/README.md +57 -57
  180. package/test/examples/asciiMaze/mazeMovement/runtime/README.md +52 -52
  181. package/test/examples/asciiMaze/mazeMovement/shaping/README.md +46 -46
  182. package/test/examples/flappy_bird/browser-entry/README.md +508 -508
  183. package/test/examples/flappy_bird/browser-entry/host/README.md +101 -101
  184. package/test/examples/flappy_bird/browser-entry/host/resize/README.md +144 -144
  185. package/test/examples/flappy_bird/browser-entry/network-view/README.md +194 -194
  186. package/test/examples/flappy_bird/browser-entry/playback/README.md +278 -278
  187. package/test/examples/flappy_bird/browser-entry/playback/background/README.md +129 -129
  188. package/test/examples/flappy_bird/browser-entry/playback/background/ground-grid/README.md +502 -502
  189. package/test/examples/flappy_bird/browser-entry/playback/frame-render/README.md +139 -139
  190. package/test/examples/flappy_bird/browser-entry/playback/snapshot/README.md +10 -10
  191. package/test/examples/flappy_bird/browser-entry/playback/trail/README.md +43 -43
  192. package/test/examples/flappy_bird/browser-entry/playback/worker-channel/README.md +30 -30
  193. package/test/examples/flappy_bird/browser-entry/runtime/README.md +59 -59
  194. package/test/examples/flappy_bird/browser-entry/visualization/README.md +276 -276
  195. package/test/examples/flappy_bird/browser-entry/worker-channel/README.md +16 -16
  196. package/test/examples/flappy_bird/constants/README.md +1070 -1070
  197. package/test/examples/flappy_bird/environment/README.md +22 -22
  198. package/test/examples/flappy_bird/evaluation/README.md +32 -32
  199. package/test/examples/flappy_bird/evaluation/rollout/README.md +141 -141
  200. package/test/examples/flappy_bird/flappy-evolution-worker/README.md +425 -425
  201. package/test/examples/flappy_bird/simulation-shared/README.md +170 -170
  202. package/test/examples/flappy_bird/simulation-shared/observation/README.md +109 -109
  203. package/test/examples/flappy_bird/trainer/README.md +325 -325
  204. package/test/examples/flappy_bird/trainer/evaluation/README.md +74 -74
  205. package/scripts/analyze-trace.ts +0 -590
  206. package/scripts/copy-examples.mjs +0 -114
  207. package/scripts/export-onnx.mjs +0 -86
  208. package/scripts/generate-bench-tables.mjs +0 -182
  209. package/scripts/generate-docs.ts +0 -2900
  210. package/scripts/write-dist-docs-pkg.mjs +0 -16
@@ -58,15 +58,17 @@ const runtimeFactories: OnnxRuntimeFactories = {
58
58
  };
59
59
  ```
60
60
 
61
- ### OnnxRuntimePerceptronFactory
61
+ ### OnnxPerceptronBuildContext
62
62
 
63
- ```ts
64
- OnnxRuntimePerceptronFactory(
65
- sizes: number[],
66
- ): default
67
- ```
63
+ Build context for mapping ONNX layer sizes into a Neataptic MLP factory call.
68
64
 
69
- Runtime perceptron factory signature used by ONNX import orchestration.
65
+ ### OnnxPerceptronSizeValidationContext
66
+
67
+ Validation context for perceptron size-list checks during ONNX import.
68
+
69
+ ### OnnxRuntimeFactories
70
+
71
+ Runtime factories consumed during ONNX import network reconstruction.
70
72
 
71
73
  ### OnnxRuntimeLayerFactory
72
74
 
@@ -82,29 +84,47 @@ Runtime layer-constructor signature used for recurrent layer reconstruction.
82
84
 
83
85
  Runtime layer module shape consumed by ONNX import orchestration.
84
86
 
85
- ### OnnxRuntimeFactories
87
+ ### OnnxRuntimePerceptronFactory
86
88
 
87
- Runtime factories consumed during ONNX import network reconstruction.
89
+ ```ts
90
+ OnnxRuntimePerceptronFactory(
91
+ sizes: number[],
92
+ ): default
93
+ ```
88
94
 
89
- ### OnnxPerceptronSizeValidationContext
95
+ Runtime perceptron factory signature used by ONNX import orchestration.
90
96
 
91
- Validation context for perceptron size-list checks during ONNX import.
97
+ ## architecture/network/onnx/import/network.onnx.runtime-load.utils.ts
92
98
 
93
- ### OnnxPerceptronBuildContext
99
+ ### buildPerceptronNetwork
94
100
 
95
- Build context for mapping ONNX layer sizes into a Neataptic MLP factory call.
101
+ ```ts
102
+ buildPerceptronNetwork(
103
+ buildContext: OnnxPerceptronBuildContext,
104
+ ): default
105
+ ```
96
106
 
97
- ## architecture/network/onnx/import/network.onnx.runtime-load.utils.ts
107
+ Build a perceptron network from size-extraction context.
98
108
 
99
- ### loadRuntimeFactories
109
+ Parameters:
110
+ - `buildContext` - Perceptron build context.
111
+
112
+ Returns: Reconstructed network instance.
113
+
114
+ ### createPerceptronBuildContext
100
115
 
101
116
  ```ts
102
- loadRuntimeFactories(): OnnxRuntimeFactories
117
+ createPerceptronBuildContext(
118
+ sizes: number[],
119
+ ): OnnxPerceptronBuildContext
103
120
  ```
104
121
 
105
- Resolve runtime factories used by ONNX import orchestration.
122
+ Build perceptron-network construction context.
106
123
 
107
- Returns: Perceptron factory and layer module object.
124
+ Parameters:
125
+ - `sizes` - Layer-size payload.
126
+
127
+ Returns: Build context.
108
128
 
109
129
  ### createPerceptronFactory
110
130
 
@@ -116,6 +136,21 @@ Create an ONNX import network factory from modern static constructors.
116
136
 
117
137
  Returns: Perceptron-compatible factory function.
118
138
 
139
+ ### createPerceptronSizeValidationContext
140
+
141
+ ```ts
142
+ createPerceptronSizeValidationContext(
143
+ sizes: number[],
144
+ ): OnnxPerceptronSizeValidationContext
145
+ ```
146
+
147
+ Build perceptron-size validation context.
148
+
149
+ Parameters:
150
+ - `sizes` - Layer-size payload.
151
+
152
+ Returns: Validation context.
153
+
119
154
  ### createRuntimeLayerModule
120
155
 
121
156
  ```ts
@@ -160,6 +195,16 @@ Parameters:
160
195
 
161
196
  Returns: Runtime layer module.
162
197
 
198
+ ### loadRuntimeFactories
199
+
200
+ ```ts
201
+ loadRuntimeFactories(): OnnxRuntimeFactories
202
+ ```
203
+
204
+ Resolve runtime factories used by ONNX import orchestration.
205
+
206
+ Returns: Perceptron factory and layer module object.
207
+
163
208
  ### resolveLayerFactory
164
209
 
165
210
  ```ts
@@ -175,21 +220,6 @@ Parameters:
175
220
 
176
221
  Returns: Matching layer factory.
177
222
 
178
- ### createPerceptronSizeValidationContext
179
-
180
- ```ts
181
- createPerceptronSizeValidationContext(
182
- sizes: number[],
183
- ): OnnxPerceptronSizeValidationContext
184
- ```
185
-
186
- Build perceptron-size validation context.
187
-
188
- Parameters:
189
- - `sizes` - Layer-size payload.
190
-
191
- Returns: Validation context.
192
-
193
223
  ### validatePerceptronSizes
194
224
 
195
225
  ```ts
@@ -205,36 +235,6 @@ Parameters:
205
235
 
206
236
  Returns: Nothing. Throws on invalid size-list.
207
237
 
208
- ### createPerceptronBuildContext
209
-
210
- ```ts
211
- createPerceptronBuildContext(
212
- sizes: number[],
213
- ): OnnxPerceptronBuildContext
214
- ```
215
-
216
- Build perceptron-network construction context.
217
-
218
- Parameters:
219
- - `sizes` - Layer-size payload.
220
-
221
- Returns: Build context.
222
-
223
- ### buildPerceptronNetwork
224
-
225
- ```ts
226
- buildPerceptronNetwork(
227
- buildContext: OnnxPerceptronBuildContext,
228
- ): default
229
- ```
230
-
231
- Build a perceptron network from size-extraction context.
232
-
233
- Parameters:
234
- - `buildContext` - Perceptron build context.
235
-
236
- Returns: Reconstructed network instance.
237
-
238
238
  ## architecture/network/onnx/import/network.onnx.import-weights.types.ts
239
239
 
240
240
  Import-owned types for ONNX weight restoration and Conv reconstruction.
@@ -262,742 +262,742 @@ const assignmentContext: OnnxImportWeightAssignmentContext = {
262
262
  };
263
263
  ```
264
264
 
265
- ### OnnxImportLayerWeightBucket
265
+ ### OnnxImportAggregatedLayerAssignmentContext
266
266
 
267
- Bucketed ONNX dense/per-neuron tensors for one exported layer index.
267
+ Context for assigning aggregated dense tensors for one layer.
268
268
 
269
- ### OnnxImportHiddenSizeDerivationContext
269
+ ### OnnxImportAggregatedNeuronAssignmentContext
270
270
 
271
- Context for deriving hidden layer sizes from initializer tensors and metadata.
271
+ Context for assigning one aggregated dense target neuron row.
272
272
 
273
- ### OnnxImportWeightAssignmentContext
273
+ ### OnnxImportConvCoordinateAssignmentContext
274
274
 
275
- Shared weight-assignment context built once per ONNX import.
275
+ Context for applying Conv weights and bias at one output coordinate.
276
276
 
277
- ### OnnxImportWeightAssignmentBuildParams
277
+ ### OnnxImportConvKernelAssignmentContext
278
278
 
279
- Build params for creating shared ONNX import weight-assignment context.
279
+ Context for assigning one concrete Conv kernel connection weight.
280
280
 
281
- ### OnnxImportLayerNodePair
281
+ ### OnnxImportConvLayerContext
282
282
 
283
- Node slices for one sequential imported layer assignment pass.
283
+ Context for reconstructing one Conv layer's imported connectivity.
284
284
 
285
- ### OnnxImportLayerNodePairBuildParams
285
+ ### OnnxImportConvLayerContextBuildParams
286
286
 
287
- Build params for one sequential layer node-pair slice operation.
287
+ Build params for creating one Conv reconstruction layer context.
288
288
 
289
- ### OnnxImportLayerTensorNames
289
+ ### OnnxImportConvMetadata
290
290
 
291
- Weight tensor names for one imported layer index.
291
+ Parsed Conv metadata payload used for optional reconstruction pass.
292
292
 
293
- ### OnnxImportAggregatedLayerAssignmentContext
293
+ ### OnnxImportConvNodeSlices
294
294
 
295
- Context for assigning aggregated dense tensors for one layer.
295
+ Layer node slices used while applying Conv reconstruction assignments.
296
296
 
297
- ### OnnxImportPerNeuronLayerAssignmentContext
297
+ ### OnnxImportConvOutputCoordinate
298
298
 
299
- Context for assigning per-neuron tensors for one layer.
299
+ Coordinate for one Conv output neuron traversal position.
300
300
 
301
- ### OnnxImportAggregatedNeuronAssignmentContext
301
+ ### OnnxImportConvTensorContext
302
302
 
303
- Context for assigning one aggregated dense target neuron row.
303
+ Resolved Conv initializer tensors and dimensions for one layer.
304
304
 
305
- ### OnnxImportPerNeuronAssignmentContext
305
+ ### OnnxImportHiddenSizeDerivationContext
306
306
 
307
- Context for assigning one per-neuron imported target node.
307
+ Context for deriving hidden layer sizes from initializer tensors and metadata.
308
308
 
309
- ### OnnxImportConvMetadata
309
+ ### OnnxImportInboundConnectionMap
310
310
 
311
- Parsed Conv metadata payload used for optional reconstruction pass.
311
+ Inbound connection lookup map keyed by source node for one target neuron.
312
312
 
313
- ### OnnxImportConvLayerContext
313
+ ### OnnxImportLayerNodePair
314
314
 
315
- Context for reconstructing one Conv layer's imported connectivity.
315
+ Node slices for one sequential imported layer assignment pass.
316
316
 
317
- ### OnnxImportConvLayerContextBuildParams
317
+ ### OnnxImportLayerNodePairBuildParams
318
318
 
319
- Build params for creating one Conv reconstruction layer context.
319
+ Build params for one sequential layer node-pair slice operation.
320
320
 
321
- ### OnnxImportConvTensorContext
321
+ ### OnnxImportLayerTensorNames
322
322
 
323
- Resolved Conv initializer tensors and dimensions for one layer.
323
+ Weight tensor names for one imported layer index.
324
324
 
325
- ### OnnxImportConvNodeSlices
325
+ ### OnnxImportLayerWeightBucket
326
326
 
327
- Layer node slices used while applying Conv reconstruction assignments.
327
+ Bucketed ONNX dense/per-neuron tensors for one exported layer index.
328
328
 
329
- ### OnnxImportConvOutputCoordinate
329
+ ### OnnxImportPerNeuronAssignmentContext
330
330
 
331
- Coordinate for one Conv output neuron traversal position.
331
+ Context for assigning one per-neuron imported target node.
332
332
 
333
- ### OnnxImportConvCoordinateAssignmentContext
333
+ ### OnnxImportPerNeuronLayerAssignmentContext
334
334
 
335
- Context for applying Conv weights and bias at one output coordinate.
335
+ Context for assigning per-neuron tensors for one layer.
336
336
 
337
- ### OnnxImportInboundConnectionMap
337
+ ### OnnxImportWeightAssignmentBuildParams
338
338
 
339
- Inbound connection lookup map keyed by source node for one target neuron.
339
+ Build params for creating shared ONNX import weight-assignment context.
340
340
 
341
- ### OnnxImportConvKernelAssignmentContext
341
+ ### OnnxImportWeightAssignmentContext
342
342
 
343
- Context for assigning one concrete Conv kernel connection weight.
343
+ Shared weight-assignment context built once per ONNX import.
344
344
 
345
345
  ## architecture/network/onnx/import/network.onnx.import-weights.utils.ts
346
346
 
347
- ### deriveHiddenLayerSizes
347
+ ### applyAggregatedLayerWeights
348
348
 
349
349
  ```ts
350
- deriveHiddenLayerSizes(
351
- initializers: OnnxTensor[],
352
- metadataProps: OnnxMetadataProperty[] | undefined,
353
- ): number[]
350
+ applyAggregatedLayerWeights(
351
+ aggregatedContext: OnnxImportAggregatedLayerAssignmentContext,
352
+ ): void
354
353
  ```
355
354
 
356
- Extract hidden layer sizes from ONNX initializers (weight tensors).
355
+ Apply aggregated dense tensor assignments for one layer.
357
356
 
358
357
  Parameters:
359
- - `initializers` - ONNX initializer tensors.
360
- - `metadataProps` - Optional ONNX metadata properties.
358
+ - `aggregatedContext` - Aggregated assignment context.
361
359
 
362
- Returns: Hidden layer sizes in order.
360
+ Returns: Nothing.
363
361
 
364
- ### assignWeightsAndBiases
362
+ ### applyAggregatedNeuronAssignment
365
363
 
366
364
  ```ts
367
- assignWeightsAndBiases(
368
- network: default,
369
- onnx: OnnxModel,
370
- hiddenLayerSizes: number[],
371
- metadataProps: OnnxMetadataProperty[] | undefined,
365
+ applyAggregatedNeuronAssignment(
366
+ neuronContext: OnnxImportAggregatedNeuronAssignmentContext,
372
367
  ): void
373
368
  ```
374
369
 
375
- Assign weights and biases from ONNX initializers to a newly created network.
370
+ Apply aggregated dense row weights and bias for one target neuron.
376
371
 
377
372
  Parameters:
378
- - `network` - Target network to mutate.
379
- - `onnx` - Source ONNX model.
380
- - `hiddenLayerSizes` - Hidden layer sizes.
381
- - `metadataProps` - Optional ONNX metadata properties.
373
+ - `neuronContext` - Aggregated neuron assignment context.
382
374
 
383
375
  Returns: Nothing.
384
376
 
385
- ### parseMetadataLayerSizes
377
+ ### applyConvCoordinateAssignment
386
378
 
387
379
  ```ts
388
- parseMetadataLayerSizes(
389
- metadataProps: OnnxMetadataProperty[],
390
- ): number[] | null
380
+ applyConvCoordinateAssignment(
381
+ coordinateContext: OnnxImportConvCoordinateAssignmentContext,
382
+ ): void
391
383
  ```
392
384
 
393
- Parse explicit metadata-driven hidden layer sizes.
385
+ Apply Conv bias and kernel weights for one output coordinate.
394
386
 
395
387
  Parameters:
396
- - `metadataProps` - ONNX metadata properties.
388
+ - `coordinateContext` - Conv coordinate assignment context.
397
389
 
398
- Returns: Parsed hidden layer sizes when available.
390
+ Returns: Nothing.
399
391
 
400
- ### collectLayerWeightBuckets
392
+ ### applyConvLayerReconstruction
401
393
 
402
394
  ```ts
403
- collectLayerWeightBuckets(
404
- initializers: OnnxTensor[],
405
- ): Record<string, OnnxImportLayerWeightBucket>
395
+ applyConvLayerReconstruction(
396
+ layerContext: OnnxImportConvLayerContext,
397
+ ): void
406
398
  ```
407
399
 
408
- Collect ONNX weight tensor buckets grouped by export layer index.
400
+ Apply Conv reconstruction for one validated Conv layer context.
409
401
 
410
402
  Parameters:
411
- - `initializers` - ONNX initializer tensors.
403
+ - `layerContext` - Conv layer context.
412
404
 
413
- Returns: Layer-weight buckets keyed by export layer index.
405
+ Returns: Nothing.
414
406
 
415
- ### collectSortedLayerIndices
407
+ ### applyDenseWeightAssignments
416
408
 
417
409
  ```ts
418
- collectSortedLayerIndices(
419
- layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
420
- ): number[]
410
+ applyDenseWeightAssignments(
411
+ assignmentContext: OnnxImportWeightAssignmentContext,
412
+ ): void
421
413
  ```
422
414
 
423
- Collect sorted layer indices from weight buckets.
415
+ Apply dense/per-neuron assignments for all sorted layer indices.
424
416
 
425
417
  Parameters:
426
- - `layerWeightBuckets` - Layer-weight buckets.
418
+ - `assignmentContext` - Shared assignment context.
427
419
 
428
- Returns: Ascending export layer indices.
420
+ Returns: Nothing.
429
421
 
430
- ### buildHiddenLayerSizesFromBuckets
422
+ ### applyOptionalConvReconstruction
431
423
 
432
424
  ```ts
433
- buildHiddenLayerSizesFromBuckets(
434
- layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
435
- sortedLayerIndices: number[],
436
- ): number[]
425
+ applyOptionalConvReconstruction(
426
+ assignmentContext: OnnxImportWeightAssignmentContext,
427
+ ): void
437
428
  ```
438
429
 
439
- Build hidden-layer sizes from weight buckets while excluding output layer.
430
+ Apply optional Conv2D reconstruction pass from metadata payloads.
440
431
 
441
432
  Parameters:
442
- - `layerWeightBuckets` - Layer-weight buckets.
443
- - `sortedLayerIndices` - Ascending layer indices.
433
+ - `assignmentContext` - Shared assignment context.
444
434
 
445
- Returns: Hidden-layer sizes.
435
+ Returns: Nothing.
446
436
 
447
- ### resolveLayerHiddenSize
437
+ ### applyPerNeuronAssignment
448
438
 
449
439
  ```ts
450
- resolveLayerHiddenSize(
451
- layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
452
- layerIndex: number,
453
- ): number
440
+ applyPerNeuronAssignment(
441
+ perNeuronAssignmentContext: OnnxImportPerNeuronAssignmentContext,
442
+ ): void
454
443
  ```
455
444
 
456
- Resolve one hidden-layer size from its weight bucket.
445
+ Apply one per-neuron weight vector and bias assignment.
457
446
 
458
447
  Parameters:
459
- - `layerWeightBuckets` - Layer-weight buckets.
460
- - `layerIndex` - Export layer index.
448
+ - `perNeuronAssignmentContext` - Per-neuron assignment context.
461
449
 
462
- Returns: Hidden-layer size.
450
+ Returns: Nothing.
463
451
 
464
- ### buildWeightAssignmentContext
452
+ ### applyPerNeuronLayerWeights
465
453
 
466
454
  ```ts
467
- buildWeightAssignmentContext(
468
- params: OnnxImportWeightAssignmentBuildParams,
469
- ): OnnxImportWeightAssignmentContext
455
+ applyPerNeuronLayerWeights(
456
+ perNeuronContext: OnnxImportPerNeuronLayerAssignmentContext,
457
+ ): void
470
458
  ```
471
459
 
472
- Build the shared assignment context for import weight restoration.
460
+ Apply per-neuron tensor assignments for one layer.
473
461
 
474
462
  Parameters:
475
- - `params` - Assignment context input params.
463
+ - `perNeuronContext` - Per-neuron layer assignment context.
476
464
 
477
- Returns: Shared assignment context.
465
+ Returns: Nothing.
478
466
 
479
- ### parseLayerIndexFromWeightTensor
467
+ ### assignConvKernelWeight
480
468
 
481
469
  ```ts
482
- parseLayerIndexFromWeightTensor(
483
- tensorName: string,
484
- ): number | null
470
+ assignConvKernelWeight(
471
+ kernelAssignmentContext: OnnxImportConvKernelAssignmentContext,
472
+ ): void
485
473
  ```
486
474
 
487
- Parse layer index from dense/per-neuron weight tensor name.
475
+ Assign one Conv kernel weight to the matching inbound neuron connection.
488
476
 
489
477
  Parameters:
490
- - `tensorName` - Tensor name.
478
+ - `kernelAssignmentContext` - Conv kernel assignment context.
491
479
 
492
- Returns: Parsed layer index or null.
480
+ Returns: Nothing.
493
481
 
494
- ### parseWeightTensorName
482
+ ### assignLayerWeights
495
483
 
496
484
  ```ts
497
- parseWeightTensorName(
498
- tensorName: string,
499
- ): { layerIndex: string; neuronIndex: number | null; } | null
485
+ assignLayerWeights(
486
+ initializerMap: Record<string, OnnxTensor>,
487
+ nodePair: OnnxImportLayerNodePair,
488
+ ): void
500
489
  ```
501
490
 
502
- Parse layer/neuron components from a weight tensor name.
491
+ Assign one layer's weights using aggregated or per-neuron tensors.
503
492
 
504
493
  Parameters:
505
- - `tensorName` - Tensor name.
494
+ - `initializerMap` - ONNX initializer map.
495
+ - `nodePair` - Current/previous node slices.
506
496
 
507
- Returns: Parsed layer+neuron components when matched.
497
+ Returns: Nothing.
508
498
 
509
- ### buildInitializerMap
499
+ ### assignWeightsAndBiases
510
500
 
511
501
  ```ts
512
- buildInitializerMap(
513
- initializers: OnnxTensor[],
514
- ): Record<string, OnnxTensor>
502
+ assignWeightsAndBiases(
503
+ network: default,
504
+ onnx: OnnxModel,
505
+ hiddenLayerSizes: number[],
506
+ metadataProps: OnnxMetadataProperty[] | undefined,
507
+ ): void
515
508
  ```
516
509
 
517
- Build ONNX initializer map keyed by tensor name.
510
+ Assign weights and biases from ONNX initializers to a newly created network.
518
511
 
519
512
  Parameters:
520
- - `initializers` - ONNX initializer list.
513
+ - `network` - Target network to mutate.
514
+ - `onnx` - Source ONNX model.
515
+ - `hiddenLayerSizes` - Hidden layer sizes.
516
+ - `metadataProps` - Optional ONNX metadata properties.
521
517
 
522
- Returns: Tensor map by name.
518
+ Returns: Nothing.
523
519
 
524
- ### collectSortedUniqueLayerIndices
520
+ ### buildConvLayerContext
525
521
 
526
522
  ```ts
527
- collectSortedUniqueLayerIndices(
528
- initializerMap: Record<string, OnnxTensor>,
529
- ): number[]
523
+ buildConvLayerContext(
524
+ params: OnnxImportConvLayerContextBuildParams,
525
+ ): OnnxImportConvLayerContext | null
530
526
  ```
531
527
 
532
- Collect unique sorted layer indices from initializer weight tensors.
528
+ Build one Conv layer reconstruction context.
533
529
 
534
530
  Parameters:
535
- - `initializerMap` - Initializer map keyed by tensor name.
531
+ - `params` - Conv context input params.
536
532
 
537
- Returns: Unique sorted layer indices.
533
+ Returns: Conv layer context when valid.
538
534
 
539
- ### collectNodesByType
535
+ ### buildConvNeuronLinearIndex
540
536
 
541
537
  ```ts
542
- collectNodesByType(
543
- nodes: default[],
544
- nodeType: "input" | "output" | "hidden",
545
- ): default[]
538
+ buildConvNeuronLinearIndex(
539
+ coordinate: OnnxImportConvOutputCoordinate,
540
+ convSpec: Conv2DMapping,
541
+ ): number
546
542
  ```
547
543
 
548
- Collect nodes by runtime node type discriminator.
544
+ Build flattened linear index for one Conv output coordinate.
549
545
 
550
546
  Parameters:
551
- - `nodes` - Network nodes.
552
- - `nodeType` - Runtime node type.
547
+ - `coordinate` - Conv output coordinate.
548
+ - `convSpec` - Conv mapping spec.
553
549
 
554
- Returns: Filtered nodes.
550
+ Returns: Linear neuron index.
555
551
 
556
- ### applyDenseWeightAssignments
552
+ ### buildConvNodeSlices
557
553
 
558
554
  ```ts
559
- applyDenseWeightAssignments(
560
- assignmentContext: OnnxImportWeightAssignmentContext,
561
- ): void
555
+ buildConvNodeSlices(
556
+ layerContext: OnnxImportConvLayerContext,
557
+ ): OnnxImportConvNodeSlices
562
558
  ```
563
559
 
564
- Apply dense/per-neuron assignments for all sorted layer indices.
560
+ Build Conv current/previous node slices for one layer context.
565
561
 
566
562
  Parameters:
567
- - `assignmentContext` - Shared assignment context.
563
+ - `layerContext` - Conv layer context.
568
564
 
569
- Returns: Nothing.
565
+ Returns: Node slice payload.
570
566
 
571
- ### buildLayerNodePair
567
+ ### buildConvTensorContext
572
568
 
573
569
  ```ts
574
- buildLayerNodePair(
575
- assignmentContext: OnnxImportWeightAssignmentContext,
576
- params: OnnxImportLayerNodePairBuildParams,
577
- ): OnnxImportLayerNodePair
570
+ buildConvTensorContext(
571
+ layerContext: OnnxImportConvLayerContext,
572
+ ): OnnxImportConvTensorContext | null
578
573
  ```
579
574
 
580
- Build current/previous node slices for one sequential import layer pass.
575
+ Build validated Conv tensor context for one layer.
581
576
 
582
577
  Parameters:
583
- - `assignmentContext` - Shared assignment context.
584
- - `params` - Sequential traversal params.
578
+ - `layerContext` - Conv layer context.
585
579
 
586
- Returns: Layer node pair.
580
+ Returns: Conv tensor context when valid.
587
581
 
588
- ### resolveCurrentLayerNodes
582
+ ### buildHiddenLayerSizesFromBuckets
589
583
 
590
584
  ```ts
591
- resolveCurrentLayerNodes(
592
- assignmentContext: OnnxImportWeightAssignmentContext,
593
- params: { sequentialIndex: number; },
594
- ): default[]
585
+ buildHiddenLayerSizesFromBuckets(
586
+ layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
587
+ sortedLayerIndices: number[],
588
+ ): number[]
595
589
  ```
596
590
 
597
- Resolve current layer nodes for one sequential layer assignment pass.
591
+ Build hidden-layer sizes from weight buckets while excluding output layer.
598
592
 
599
593
  Parameters:
600
- - `assignmentContext` - Shared assignment context.
601
- - `params` - Sequential traversal params.
594
+ - `layerWeightBuckets` - Layer-weight buckets.
595
+ - `sortedLayerIndices` - Ascending layer indices.
602
596
 
603
- Returns: Current layer nodes.
597
+ Returns: Hidden-layer sizes.
604
598
 
605
- ### resolvePreviousLayerNodes
599
+ ### buildInboundConnectionMap
606
600
 
607
601
  ```ts
608
- resolvePreviousLayerNodes(
609
- assignmentContext: OnnxImportWeightAssignmentContext,
610
- params: { sequentialIndex: number; },
611
- ): default[]
602
+ buildInboundConnectionMap(
603
+ neuronInternal: NodeInternals,
604
+ ): OnnxImportInboundConnectionMap
612
605
  ```
613
606
 
614
- Resolve previous layer nodes for one sequential layer assignment pass.
607
+ Build inbound connection lookup map for one neuron.
615
608
 
616
609
  Parameters:
617
- - `assignmentContext` - Shared assignment context.
618
- - `params` - Sequential traversal params.
610
+ - `neuronInternal` - Neuron internals.
619
611
 
620
- Returns: Previous layer nodes.
612
+ Returns: Inbound connection map keyed by source node.
621
613
 
622
- ### sumHiddenSizesToIndex
614
+ ### buildInitializerMap
623
615
 
624
616
  ```ts
625
- sumHiddenSizesToIndex(
626
- hiddenLayerSizes: number[],
627
- exclusiveEndIndex: number,
628
- ): number
617
+ buildInitializerMap(
618
+ initializers: OnnxTensor[],
619
+ ): Record<string, OnnxTensor>
629
620
  ```
630
621
 
631
- Sum hidden-layer sizes from index `0` to `exclusiveEndIndex`.
622
+ Build ONNX initializer map keyed by tensor name.
632
623
 
633
624
  Parameters:
634
- - `hiddenLayerSizes` - Hidden-layer size list.
635
- - `exclusiveEndIndex` - Exclusive end index.
625
+ - `initializers` - ONNX initializer list.
636
626
 
637
- Returns: Prefix sum.
627
+ Returns: Tensor map by name.
638
628
 
639
- ### assignLayerWeights
629
+ ### buildInputCoordinate
640
630
 
641
631
  ```ts
642
- assignLayerWeights(
643
- initializerMap: Record<string, OnnxTensor>,
644
- nodePair: OnnxImportLayerNodePair,
645
- ): void
632
+ buildInputCoordinate(
633
+ kernelAssignmentContext: OnnxImportConvKernelAssignmentContext,
634
+ ): { inputRow: number; inputColumn: number; } | null
646
635
  ```
647
636
 
648
- Assign one layer's weights using aggregated or per-neuron tensors.
637
+ Build input-space coordinate for one Conv kernel element.
649
638
 
650
639
  Parameters:
651
- - `initializerMap` - ONNX initializer map.
652
- - `nodePair` - Current/previous node slices.
640
+ - `kernelAssignmentContext` - Conv kernel assignment context.
653
641
 
654
- Returns: Nothing.
642
+ Returns: Input coordinate when in bounds.
655
643
 
656
- ### hasAggregatedLayerWeights
644
+ ### buildInputFeatureLinearIndex
657
645
 
658
646
  ```ts
659
- hasAggregatedLayerWeights(
660
- aggregatedContext: OnnxImportAggregatedLayerAssignmentContext,
661
- ): boolean
647
+ buildInputFeatureLinearIndex(
648
+ convSpec: Conv2DMapping,
649
+ inChannelIndex: number,
650
+ inputRow: number,
651
+ inputColumn: number,
652
+ ): number
662
653
  ```
663
654
 
664
- Determine whether the layer has aggregated weight tensor data.
655
+ Build linear feature index in input feature space.
665
656
 
666
657
  Parameters:
667
- - `aggregatedContext` - Aggregated assignment context.
658
+ - `convSpec` - Conv mapping spec.
659
+ - `inChannelIndex` - Input channel index.
660
+ - `inputRow` - Input row index.
661
+ - `inputColumn` - Input column index.
668
662
 
669
- Returns: True when aggregated tensor exists.
663
+ Returns: Linear input feature index.
670
664
 
671
- ### buildLayerTensorNames
665
+ ### buildLayerNodePair
672
666
 
673
667
  ```ts
674
- buildLayerTensorNames(
675
- layerIndex: number,
676
- ): OnnxImportLayerTensorNames
668
+ buildLayerNodePair(
669
+ assignmentContext: OnnxImportWeightAssignmentContext,
670
+ params: OnnxImportLayerNodePairBuildParams,
671
+ ): OnnxImportLayerNodePair
677
672
  ```
678
673
 
679
- Build dense weight/bias tensor names for one layer index.
674
+ Build current/previous node slices for one sequential import layer pass.
680
675
 
681
676
  Parameters:
682
- - `layerIndex` - Export layer index.
677
+ - `assignmentContext` - Shared assignment context.
678
+ - `params` - Sequential traversal params.
683
679
 
684
- Returns: Layer tensor names.
680
+ Returns: Layer node pair.
685
681
 
686
- ### applyAggregatedLayerWeights
682
+ ### buildLayerTensorNames
687
683
 
688
684
  ```ts
689
- applyAggregatedLayerWeights(
690
- aggregatedContext: OnnxImportAggregatedLayerAssignmentContext,
691
- ): void
685
+ buildLayerTensorNames(
686
+ layerIndex: number,
687
+ ): OnnxImportLayerTensorNames
692
688
  ```
693
689
 
694
- Apply aggregated dense tensor assignments for one layer.
690
+ Build dense weight/bias tensor names for one layer index.
695
691
 
696
692
  Parameters:
697
- - `aggregatedContext` - Aggregated assignment context.
693
+ - `layerIndex` - Export layer index.
698
694
 
699
- Returns: Nothing.
695
+ Returns: Layer tensor names.
700
696
 
701
- ### applyAggregatedNeuronAssignment
697
+ ### buildPerNeuronTensorNames
702
698
 
703
699
  ```ts
704
- applyAggregatedNeuronAssignment(
705
- neuronContext: OnnxImportAggregatedNeuronAssignmentContext,
706
- ): void
700
+ buildPerNeuronTensorNames(
701
+ layerIndex: number,
702
+ neuronIndex: number,
703
+ ): OnnxImportLayerTensorNames
707
704
  ```
708
705
 
709
- Apply aggregated dense row weights and bias for one target neuron.
706
+ Build per-neuron tensor names for one layer and neuron index.
710
707
 
711
708
  Parameters:
712
- - `neuronContext` - Aggregated neuron assignment context.
709
+ - `layerIndex` - Export layer index.
710
+ - `neuronIndex` - Neuron index in layer.
713
711
 
714
- Returns: Nothing.
712
+ Returns: Per-neuron tensor names.
715
713
 
716
- ### applyPerNeuronLayerWeights
714
+ ### buildWeightAssignmentContext
717
715
 
718
716
  ```ts
719
- applyPerNeuronLayerWeights(
720
- perNeuronContext: OnnxImportPerNeuronLayerAssignmentContext,
721
- ): void
717
+ buildWeightAssignmentContext(
718
+ params: OnnxImportWeightAssignmentBuildParams,
719
+ ): OnnxImportWeightAssignmentContext
722
720
  ```
723
721
 
724
- Apply per-neuron tensor assignments for one layer.
722
+ Build the shared assignment context for import weight restoration.
725
723
 
726
724
  Parameters:
727
- - `perNeuronContext` - Per-neuron layer assignment context.
725
+ - `params` - Assignment context input params.
728
726
 
729
- Returns: Nothing.
727
+ Returns: Shared assignment context.
730
728
 
731
- ### buildPerNeuronTensorNames
729
+ ### collectConvKernelCoordinates
732
730
 
733
731
  ```ts
734
- buildPerNeuronTensorNames(
735
- layerIndex: number,
736
- neuronIndex: number,
737
- ): OnnxImportLayerTensorNames
732
+ collectConvKernelCoordinates(
733
+ inChannels: number,
734
+ kernelHeight: number,
735
+ kernelWidth: number,
736
+ ): OnnxConvKernelCoordinate[]
738
737
  ```
739
738
 
740
- Build per-neuron tensor names for one layer and neuron index.
739
+ Collect all kernel traversal coordinates for one Conv output position.
741
740
 
742
741
  Parameters:
743
- - `layerIndex` - Export layer index.
744
- - `neuronIndex` - Neuron index in layer.
742
+ - `inChannels` - Input channel count.
743
+ - `kernelHeight` - Kernel height.
744
+ - `kernelWidth` - Kernel width.
745
745
 
746
- Returns: Per-neuron tensor names.
746
+ Returns: Kernel traversal coordinates.
747
747
 
748
- ### applyPerNeuronAssignment
748
+ ### collectConvOutputCoordinates
749
749
 
750
750
  ```ts
751
- applyPerNeuronAssignment(
752
- perNeuronAssignmentContext: OnnxImportPerNeuronAssignmentContext,
753
- ): void
751
+ collectConvOutputCoordinates(
752
+ convSpec: Conv2DMapping,
753
+ outChannels: number,
754
+ ): OnnxImportConvOutputCoordinate[]
754
755
  ```
755
756
 
756
- Apply one per-neuron weight vector and bias assignment.
757
+ Collect all output traversal coordinates for one Conv layer.
757
758
 
758
759
  Parameters:
759
- - `perNeuronAssignmentContext` - Per-neuron assignment context.
760
+ - `convSpec` - Conv mapping spec.
761
+ - `outChannels` - Output channel count.
760
762
 
761
- Returns: Nothing.
763
+ Returns: Output traversal coordinates.
762
764
 
763
- ### applyOptionalConvReconstruction
765
+ ### collectLayerWeightBuckets
764
766
 
765
767
  ```ts
766
- applyOptionalConvReconstruction(
767
- assignmentContext: OnnxImportWeightAssignmentContext,
768
- ): void
768
+ collectLayerWeightBuckets(
769
+ initializers: OnnxTensor[],
770
+ ): Record<string, OnnxImportLayerWeightBucket>
769
771
  ```
770
772
 
771
- Apply optional Conv2D reconstruction pass from metadata payloads.
773
+ Collect ONNX weight tensor buckets grouped by export layer index.
772
774
 
773
775
  Parameters:
774
- - `assignmentContext` - Shared assignment context.
776
+ - `initializers` - ONNX initializer tensors.
775
777
 
776
- Returns: Nothing.
778
+ Returns: Layer-weight buckets keyed by export layer index.
777
779
 
778
- ### parseConvMetadata
780
+ ### collectNodesByType
779
781
 
780
782
  ```ts
781
- parseConvMetadata(
782
- metadataProps: OnnxMetadataProperty[],
783
- ): OnnxImportConvMetadata | null
783
+ collectNodesByType(
784
+ nodes: default[],
785
+ nodeType: "input" | "output" | "hidden",
786
+ ): default[]
784
787
  ```
785
788
 
786
- Parse Conv reconstruction metadata payload.
789
+ Collect nodes by runtime node type discriminator.
787
790
 
788
791
  Parameters:
789
- - `metadataProps` - ONNX metadata properties.
792
+ - `nodes` - Network nodes.
793
+ - `nodeType` - Runtime node type.
790
794
 
791
- Returns: Parsed Conv metadata.
795
+ Returns: Filtered nodes.
792
796
 
793
- ### buildConvLayerContext
797
+ ### collectSortedLayerIndices
794
798
 
795
799
  ```ts
796
- buildConvLayerContext(
797
- params: OnnxImportConvLayerContextBuildParams,
798
- ): OnnxImportConvLayerContext | null
800
+ collectSortedLayerIndices(
801
+ layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
802
+ ): number[]
799
803
  ```
800
804
 
801
- Build one Conv layer reconstruction context.
805
+ Collect sorted layer indices from weight buckets.
802
806
 
803
807
  Parameters:
804
- - `params` - Conv context input params.
808
+ - `layerWeightBuckets` - Layer-weight buckets.
805
809
 
806
- Returns: Conv layer context when valid.
810
+ Returns: Ascending export layer indices.
807
811
 
808
- ### applyConvLayerReconstruction
812
+ ### collectSortedUniqueLayerIndices
809
813
 
810
814
  ```ts
811
- applyConvLayerReconstruction(
812
- layerContext: OnnxImportConvLayerContext,
813
- ): void
815
+ collectSortedUniqueLayerIndices(
816
+ initializerMap: Record<string, OnnxTensor>,
817
+ ): number[]
814
818
  ```
815
819
 
816
- Apply Conv reconstruction for one validated Conv layer context.
820
+ Collect unique sorted layer indices from initializer weight tensors.
817
821
 
818
822
  Parameters:
819
- - `layerContext` - Conv layer context.
823
+ - `initializerMap` - Initializer map keyed by tensor name.
820
824
 
821
- Returns: Nothing.
825
+ Returns: Unique sorted layer indices.
822
826
 
823
- ### buildConvNodeSlices
827
+ ### deriveHiddenLayerSizes
824
828
 
825
829
  ```ts
826
- buildConvNodeSlices(
827
- layerContext: OnnxImportConvLayerContext,
828
- ): OnnxImportConvNodeSlices
830
+ deriveHiddenLayerSizes(
831
+ initializers: OnnxTensor[],
832
+ metadataProps: OnnxMetadataProperty[] | undefined,
833
+ ): number[]
829
834
  ```
830
835
 
831
- Build Conv current/previous node slices for one layer context.
836
+ Extract hidden layer sizes from ONNX initializers (weight tensors).
832
837
 
833
838
  Parameters:
834
- - `layerContext` - Conv layer context.
839
+ - `initializers` - ONNX initializer tensors.
840
+ - `metadataProps` - Optional ONNX metadata properties.
835
841
 
836
- Returns: Node slice payload.
842
+ Returns: Hidden layer sizes in order.
837
843
 
838
- ### buildConvTensorContext
844
+ ### hasAggregatedLayerWeights
839
845
 
840
846
  ```ts
841
- buildConvTensorContext(
842
- layerContext: OnnxImportConvLayerContext,
843
- ): OnnxImportConvTensorContext | null
847
+ hasAggregatedLayerWeights(
848
+ aggregatedContext: OnnxImportAggregatedLayerAssignmentContext,
849
+ ): boolean
844
850
  ```
845
851
 
846
- Build validated Conv tensor context for one layer.
852
+ Determine whether the layer has aggregated weight tensor data.
847
853
 
848
854
  Parameters:
849
- - `layerContext` - Conv layer context.
855
+ - `aggregatedContext` - Aggregated assignment context.
850
856
 
851
- Returns: Conv tensor context when valid.
857
+ Returns: True when aggregated tensor exists.
852
858
 
853
- ### collectConvOutputCoordinates
859
+ ### parseConvMetadata
854
860
 
855
861
  ```ts
856
- collectConvOutputCoordinates(
857
- convSpec: Conv2DMapping,
858
- outChannels: number,
859
- ): OnnxImportConvOutputCoordinate[]
862
+ parseConvMetadata(
863
+ metadataProps: OnnxMetadataProperty[],
864
+ ): OnnxImportConvMetadata | null
860
865
  ```
861
866
 
862
- Collect all output traversal coordinates for one Conv layer.
867
+ Parse Conv reconstruction metadata payload.
863
868
 
864
869
  Parameters:
865
- - `convSpec` - Conv mapping spec.
866
- - `outChannels` - Output channel count.
870
+ - `metadataProps` - ONNX metadata properties.
867
871
 
868
- Returns: Output traversal coordinates.
872
+ Returns: Parsed Conv metadata.
869
873
 
870
- ### applyConvCoordinateAssignment
874
+ ### parseLayerIndexFromWeightTensor
871
875
 
872
876
  ```ts
873
- applyConvCoordinateAssignment(
874
- coordinateContext: OnnxImportConvCoordinateAssignmentContext,
875
- ): void
877
+ parseLayerIndexFromWeightTensor(
878
+ tensorName: string,
879
+ ): number | null
876
880
  ```
877
881
 
878
- Apply Conv bias and kernel weights for one output coordinate.
882
+ Parse layer index from dense/per-neuron weight tensor name.
879
883
 
880
884
  Parameters:
881
- - `coordinateContext` - Conv coordinate assignment context.
885
+ - `tensorName` - Tensor name.
882
886
 
883
- Returns: Nothing.
887
+ Returns: Parsed layer index or null.
884
888
 
885
- ### buildConvNeuronLinearIndex
889
+ ### parseMetadataLayerSizes
886
890
 
887
891
  ```ts
888
- buildConvNeuronLinearIndex(
889
- coordinate: OnnxImportConvOutputCoordinate,
890
- convSpec: Conv2DMapping,
891
- ): number
892
+ parseMetadataLayerSizes(
893
+ metadataProps: OnnxMetadataProperty[],
894
+ ): number[] | null
892
895
  ```
893
896
 
894
- Build flattened linear index for one Conv output coordinate.
897
+ Parse explicit metadata-driven hidden layer sizes.
895
898
 
896
899
  Parameters:
897
- - `coordinate` - Conv output coordinate.
898
- - `convSpec` - Conv mapping spec.
900
+ - `metadataProps` - ONNX metadata properties.
899
901
 
900
- Returns: Linear neuron index.
902
+ Returns: Parsed hidden layer sizes when available.
901
903
 
902
- ### collectConvKernelCoordinates
904
+ ### parseWeightTensorName
903
905
 
904
906
  ```ts
905
- collectConvKernelCoordinates(
906
- inChannels: number,
907
- kernelHeight: number,
908
- kernelWidth: number,
909
- ): OnnxConvKernelCoordinate[]
907
+ parseWeightTensorName(
908
+ tensorName: string,
909
+ ): { layerIndex: string; neuronIndex: number | null; } | null
910
910
  ```
911
911
 
912
- Collect all kernel traversal coordinates for one Conv output position.
912
+ Parse layer/neuron components from a weight tensor name.
913
913
 
914
914
  Parameters:
915
- - `inChannels` - Input channel count.
916
- - `kernelHeight` - Kernel height.
917
- - `kernelWidth` - Kernel width.
915
+ - `tensorName` - Tensor name.
918
916
 
919
- Returns: Kernel traversal coordinates.
917
+ Returns: Parsed layer+neuron components when matched.
920
918
 
921
- ### assignConvKernelWeight
919
+ ### readConvKernelWeight
922
920
 
923
921
  ```ts
924
- assignConvKernelWeight(
922
+ readConvKernelWeight(
925
923
  kernelAssignmentContext: OnnxImportConvKernelAssignmentContext,
926
- ): void
924
+ ): number
927
925
  ```
928
926
 
929
- Assign one Conv kernel weight to the matching inbound neuron connection.
927
+ Read one Conv kernel weight from flattened ONNX tensor payload.
930
928
 
931
929
  Parameters:
932
930
  - `kernelAssignmentContext` - Conv kernel assignment context.
933
931
 
934
- Returns: Nothing.
932
+ Returns: Kernel weight.
935
933
 
936
- ### buildInputCoordinate
934
+ ### resolveCurrentLayerNodes
937
935
 
938
936
  ```ts
939
- buildInputCoordinate(
940
- kernelAssignmentContext: OnnxImportConvKernelAssignmentContext,
941
- ): { inputRow: number; inputColumn: number; } | null
937
+ resolveCurrentLayerNodes(
938
+ assignmentContext: OnnxImportWeightAssignmentContext,
939
+ params: { sequentialIndex: number; },
940
+ ): default[]
942
941
  ```
943
942
 
944
- Build input-space coordinate for one Conv kernel element.
943
+ Resolve current layer nodes for one sequential layer assignment pass.
945
944
 
946
945
  Parameters:
947
- - `kernelAssignmentContext` - Conv kernel assignment context.
946
+ - `assignmentContext` - Shared assignment context.
947
+ - `params` - Sequential traversal params.
948
948
 
949
- Returns: Input coordinate when in bounds.
949
+ Returns: Current layer nodes.
950
950
 
951
- ### buildInputFeatureLinearIndex
951
+ ### resolveLayerHiddenSize
952
952
 
953
953
  ```ts
954
- buildInputFeatureLinearIndex(
955
- convSpec: Conv2DMapping,
956
- inChannelIndex: number,
957
- inputRow: number,
958
- inputColumn: number,
954
+ resolveLayerHiddenSize(
955
+ layerWeightBuckets: Record<string, OnnxImportLayerWeightBucket>,
956
+ layerIndex: number,
959
957
  ): number
960
958
  ```
961
959
 
962
- Build linear feature index in input feature space.
960
+ Resolve one hidden-layer size from its weight bucket.
963
961
 
964
962
  Parameters:
965
- - `convSpec` - Conv mapping spec.
966
- - `inChannelIndex` - Input channel index.
967
- - `inputRow` - Input row index.
968
- - `inputColumn` - Input column index.
963
+ - `layerWeightBuckets` - Layer-weight buckets.
964
+ - `layerIndex` - Export layer index.
969
965
 
970
- Returns: Linear input feature index.
966
+ Returns: Hidden-layer size.
971
967
 
972
- ### buildInboundConnectionMap
968
+ ### resolvePreviousLayerNodes
973
969
 
974
970
  ```ts
975
- buildInboundConnectionMap(
976
- neuronInternal: NodeInternals,
977
- ): OnnxImportInboundConnectionMap
971
+ resolvePreviousLayerNodes(
972
+ assignmentContext: OnnxImportWeightAssignmentContext,
973
+ params: { sequentialIndex: number; },
974
+ ): default[]
978
975
  ```
979
976
 
980
- Build inbound connection lookup map for one neuron.
977
+ Resolve previous layer nodes for one sequential layer assignment pass.
981
978
 
982
979
  Parameters:
983
- - `neuronInternal` - Neuron internals.
980
+ - `assignmentContext` - Shared assignment context.
981
+ - `params` - Sequential traversal params.
984
982
 
985
- Returns: Inbound connection map keyed by source node.
983
+ Returns: Previous layer nodes.
986
984
 
987
- ### readConvKernelWeight
985
+ ### sumHiddenSizesToIndex
988
986
 
989
987
  ```ts
990
- readConvKernelWeight(
991
- kernelAssignmentContext: OnnxImportConvKernelAssignmentContext,
988
+ sumHiddenSizesToIndex(
989
+ hiddenLayerSizes: number[],
990
+ exclusiveEndIndex: number,
992
991
  ): number
993
992
  ```
994
993
 
995
- Read one Conv kernel weight from flattened ONNX tensor payload.
994
+ Sum hidden-layer sizes from index `0` to `exclusiveEndIndex`.
996
995
 
997
996
  Parameters:
998
- - `kernelAssignmentContext` - Conv kernel assignment context.
997
+ - `hiddenLayerSizes` - Hidden-layer size list.
998
+ - `exclusiveEndIndex` - Exclusive end index.
999
999
 
1000
- Returns: Kernel weight.
1000
+ Returns: Prefix sum.
1001
1001
 
1002
1002
  ## architecture/network/onnx/import/network.onnx.import-activations.utils.ts
1003
1003
 
@@ -1030,21 +1030,21 @@ Keeping them here makes the import chapter explain its own execution state
1030
1030
  without forcing the root ONNX compatibility barrel to remain the ownership
1031
1031
  home for importer-only details.
1032
1032
 
1033
- ### OnnxImportArchitectureResult
1033
+ ### NetworkWithOnnxImportPooling
1034
1034
 
1035
- Parsed architecture dimensions extracted from ONNX import graph payloads.
1035
+ Network instance augmented with optional imported ONNX pooling metadata.
1036
1036
 
1037
1037
  ### OnnxImportArchitectureContext
1038
1038
 
1039
1039
  Shared architecture extraction context with resolved graph dimensions.
1040
1040
 
1041
- ### OnnxImportDimensionRecord
1041
+ ### OnnxImportArchitectureResult
1042
1042
 
1043
- Loose ONNX shape-dimension record used by legacy import payload access.
1043
+ Parsed architecture dimensions extracted from ONNX import graph payloads.
1044
1044
 
1045
- ### OnnxImportRecurrentRestorationContext
1045
+ ### OnnxImportDimensionRecord
1046
1046
 
1047
- Context for recurrent self-connection restoration from ONNX metadata and tensors.
1047
+ Loose ONNX shape-dimension record used by legacy import payload access.
1048
1048
 
1049
1049
  ### OnnxImportHiddenLayerSpan
1050
1050
 
@@ -1054,70 +1054,32 @@ Hidden-layer span payload with one-based layer numbering and global offset.
1054
1054
 
1055
1055
  Execution context for assigning one hidden-layer recurrent diagonal tensor.
1056
1056
 
1057
- ### OnnxImportSelfConnectionUpsertContext
1058
-
1059
- Context for upserting one hidden node self-connection from recurrent weight.
1060
-
1061
1057
  ### OnnxImportPoolingMetadata
1062
1058
 
1063
1059
  Parsed pooling metadata payload attached to imported network instances.
1064
1060
 
1065
- ### NetworkWithOnnxImportPooling
1066
-
1067
- Network instance augmented with optional imported ONNX pooling metadata.
1068
-
1069
- ## architecture/network/onnx/import/network.onnx.import-orchestrators.utils.ts
1070
-
1071
- ### extractOnnxArchitecture
1072
-
1073
- ```ts
1074
- extractOnnxArchitecture(
1075
- onnx: OnnxModel,
1076
- ): OnnxImportArchitectureResult
1077
- ```
1078
-
1079
- Extract input/output counts and hidden layer sizes from ONNX model.
1080
-
1081
- Parameters:
1082
- - `onnx` - Source ONNX model.
1083
-
1084
- Returns: Parsed architecture dimensions.
1085
-
1086
- ### pruneSingleLayerHiddenPlaceholders
1061
+ ### OnnxImportRecurrentRestorationContext
1087
1062
 
1088
- ```ts
1089
- pruneSingleLayerHiddenPlaceholders(
1090
- network: default,
1091
- hiddenLayerSizes: number[],
1092
- ): void
1093
- ```
1063
+ Context for recurrent self-connection restoration from ONNX metadata and tensors.
1094
1064
 
1095
- Remove placeholder hidden nodes for single-layer perceptron imports.
1065
+ ### OnnxImportSelfConnectionUpsertContext
1096
1066
 
1097
- Parameters:
1098
- - `network` - Target network.
1099
- - `hiddenLayerSizes` - Hidden layer sizes.
1067
+ Context for upserting one hidden node self-connection from recurrent weight.
1100
1068
 
1101
- Returns: Nothing.
1069
+ ## architecture/network/onnx/import/network.onnx.import-orchestrators.utils.ts
1102
1070
 
1103
- ### restoreRecurrentSelfConnections
1071
+ ### applyLayerSelfConnections
1104
1072
 
1105
1073
  ```ts
1106
- restoreRecurrentSelfConnections(
1107
- network: default,
1108
- onnx: OnnxModel,
1109
- hiddenLayerSizes: number[],
1110
- metadata: OnnxMetadataProperty[],
1074
+ applyLayerSelfConnections(
1075
+ layerConnectionContext: OnnxImportLayerConnectionContext,
1111
1076
  ): void
1112
1077
  ```
1113
1078
 
1114
- Restore recurrent self-connections from recurrent metadata and R tensors.
1079
+ Apply one hidden layer diagonal recurrent self-weights.
1115
1080
 
1116
1081
  Parameters:
1117
- - `network` - Target network.
1118
- - `onnx` - Source ONNX model.
1119
- - `hiddenLayerSizes` - Hidden layer sizes.
1120
- - `metadata` - Parsed metadata properties.
1082
+ - `layerConnectionContext` - Layer connection context.
1121
1083
 
1122
1084
  Returns: Nothing.
1123
1085
 
@@ -1138,56 +1100,20 @@ Parameters:
1138
1100
 
1139
1101
  Returns: Nothing.
1140
1102
 
1141
- ### reconstructFusedRecurrentLayers
1103
+ ### attachParsedPoolingMetadata
1142
1104
 
1143
1105
  ```ts
1144
- reconstructFusedRecurrentLayers(
1106
+ attachParsedPoolingMetadata(
1145
1107
  network: default,
1146
- onnx: OnnxModel,
1147
- hiddenLayerSizes: number[],
1148
- layerFactory: OnnxLayerFactory,
1149
- metadata: OnnxMetadataProperty[],
1108
+ poolingMetadata: OnnxImportPoolingMetadata,
1150
1109
  ): void
1151
1110
  ```
1152
1111
 
1153
- Reconstruct emitted fused LSTM/GRU layers from ONNX metadata and initializers.
1112
+ Attach parsed pooling metadata to imported network instance.
1154
1113
 
1155
1114
  Parameters:
1156
1115
  - `network` - Target network.
1157
- - `onnx` - Source ONNX model.
1158
- - `hiddenLayerSizes` - Hidden layer sizes.
1159
- - `layerFactory` - Dynamic layer module.
1160
- - `metadata` - ONNX metadata properties.
1161
-
1162
- Returns: Nothing.
1163
-
1164
- ### parseRecurrentLayerIndices
1165
-
1166
- ```ts
1167
- parseRecurrentLayerIndices(
1168
- rawMetadataValue: string,
1169
- ): number[]
1170
- ```
1171
-
1172
- Parse recurrent layer indices metadata.
1173
-
1174
- Parameters:
1175
- - `rawMetadataValue` - Raw metadata JSON string.
1176
-
1177
- Returns: Normalized recurrent layer indices.
1178
-
1179
- ### applyLayerSelfConnections
1180
-
1181
- ```ts
1182
- applyLayerSelfConnections(
1183
- layerConnectionContext: OnnxImportLayerConnectionContext,
1184
- ): void
1185
- ```
1186
-
1187
- Apply one hidden layer diagonal recurrent self-weights.
1188
-
1189
- Parameters:
1190
- - `layerConnectionContext` - Layer connection context.
1116
+ - `poolingMetadata` - Parsed pooling metadata payload.
1191
1117
 
1192
1118
  Returns: Nothing.
1193
1119
 
@@ -1199,57 +1125,44 @@ buildArchitectureContext(
1199
1125
  ): OnnxImportArchitectureContext
1200
1126
  ```
1201
1127
 
1202
- Build architecture extraction context from ONNX graph state.
1203
-
1204
- Parameters:
1205
- - `onnx` - Source ONNX model.
1206
-
1207
- Returns: Normalized architecture extraction context.
1208
-
1209
- ### readLastDimensionValue
1210
-
1211
- ```ts
1212
- readLastDimensionValue(
1213
- dimensions: { dim_value?: number | undefined; }[],
1214
- ): number
1215
- ```
1216
-
1217
- Read the terminal ONNX shape dimension value from one shape array.
1128
+ Build architecture extraction context from ONNX graph state.
1218
1129
 
1219
1130
  Parameters:
1220
- - `dimensions` - ONNX shape dimensions.
1131
+ - `onnx` - Source ONNX model.
1221
1132
 
1222
- Returns: Terminal `dim_value` payload.
1133
+ Returns: Normalized architecture extraction context.
1223
1134
 
1224
- ### isSingleLayerPerceptronImport
1135
+ ### buildHiddenLayerSpans
1225
1136
 
1226
1137
  ```ts
1227
- isSingleLayerPerceptronImport(
1138
+ buildHiddenLayerSpans(
1228
1139
  hiddenLayerSizes: number[],
1229
- ): boolean
1140
+ ): OnnxImportHiddenLayerSpan[]
1230
1141
  ```
1231
1142
 
1232
- Determine whether import shape corresponds to a single-layer perceptron.
1143
+ Build hidden-layer spans with one-based layer numbering and global offsets.
1233
1144
 
1234
1145
  Parameters:
1235
1146
  - `hiddenLayerSizes` - Hidden-layer size list.
1236
1147
 
1237
- Returns: True when no hidden layers exist.
1148
+ Returns: Hidden-layer span payload list.
1238
1149
 
1239
- ### collectPerceptronBoundaryNodes
1150
+ ### collectDiagonalRecurrentWeights
1240
1151
 
1241
1152
  ```ts
1242
- collectPerceptronBoundaryNodes(
1243
- nodes: default[],
1244
- ): default[]
1153
+ collectDiagonalRecurrentWeights(
1154
+ recurrentTensorWeights: number[],
1155
+ hiddenLayerSize: number,
1156
+ ): number[]
1245
1157
  ```
1246
1158
 
1247
- Collect input and output boundary nodes for perceptron imports.
1159
+ Collect diagonal recurrent weights from flattened layer tensor data.
1248
1160
 
1249
1161
  Parameters:
1250
- - `nodes` - Full network node list.
1162
+ - `recurrentTensorWeights` - Flattened recurrent tensor weights.
1163
+ - `hiddenLayerSize` - Hidden-layer width.
1251
1164
 
1252
- Returns: Input/output-only node list.
1165
+ Returns: Diagonal recurrent self-weights.
1253
1166
 
1254
1167
  ### collectNodesByType
1255
1168
 
@@ -1268,6 +1181,21 @@ Parameters:
1268
1181
 
1269
1182
  Returns: Filtered node list.
1270
1183
 
1184
+ ### collectPerceptronBoundaryNodes
1185
+
1186
+ ```ts
1187
+ collectPerceptronBoundaryNodes(
1188
+ nodes: default[],
1189
+ ): default[]
1190
+ ```
1191
+
1192
+ Collect input and output boundary nodes for perceptron imports.
1193
+
1194
+ Parameters:
1195
+ - `nodes` - Full network node list.
1196
+
1197
+ Returns: Input/output-only node list.
1198
+
1271
1199
  ### collectRecurrentLayerSpans
1272
1200
 
1273
1201
  ```ts
@@ -1283,20 +1211,20 @@ Parameters:
1283
1211
 
1284
1212
  Returns: Hidden-layer spans requiring recurrent restoration.
1285
1213
 
1286
- ### resolveRecurrentLayerIndices
1214
+ ### extractOnnxArchitecture
1287
1215
 
1288
1216
  ```ts
1289
- resolveRecurrentLayerIndices(
1290
- metadata: OnnxMetadataProperty[],
1291
- ): number[]
1217
+ extractOnnxArchitecture(
1218
+ onnx: OnnxModel,
1219
+ ): OnnxImportArchitectureResult
1292
1220
  ```
1293
1221
 
1294
- Resolve recurrent layer indices from ONNX metadata.
1222
+ Extract input/output counts and hidden layer sizes from ONNX model.
1295
1223
 
1296
1224
  Parameters:
1297
- - `metadata` - ONNX metadata payload.
1225
+ - `onnx` - Source ONNX model.
1298
1226
 
1299
- Returns: Parsed recurrent layer indices.
1227
+ Returns: Parsed architecture dimensions.
1300
1228
 
1301
1229
  ### findMetadataProperty
1302
1230
 
@@ -1315,20 +1243,35 @@ Parameters:
1315
1243
 
1316
1244
  Returns: Matching metadata property when present.
1317
1245
 
1318
- ### buildHiddenLayerSpans
1246
+ ### findRecurrentInitializer
1319
1247
 
1320
1248
  ```ts
1321
- buildHiddenLayerSpans(
1249
+ findRecurrentInitializer(
1250
+ layerConnectionContext: OnnxImportLayerConnectionContext,
1251
+ ): { name: string; float_data: number[]; } | undefined
1252
+ ```
1253
+
1254
+ Resolve recurrent initializer tensor for one hidden-layer span.
1255
+
1256
+ Parameters:
1257
+ - `layerConnectionContext` - Layer connection context.
1258
+
1259
+ Returns: Recurrent initializer tensor when available.
1260
+
1261
+ ### isSingleLayerPerceptronImport
1262
+
1263
+ ```ts
1264
+ isSingleLayerPerceptronImport(
1322
1265
  hiddenLayerSizes: number[],
1323
- ): OnnxImportHiddenLayerSpan[]
1266
+ ): boolean
1324
1267
  ```
1325
1268
 
1326
- Build hidden-layer spans with one-based layer numbering and global offsets.
1269
+ Determine whether import shape corresponds to a single-layer perceptron.
1327
1270
 
1328
1271
  Parameters:
1329
1272
  - `hiddenLayerSizes` - Hidden-layer size list.
1330
1273
 
1331
- Returns: Hidden-layer span payload list.
1274
+ Returns: True when no hidden layers exist.
1332
1275
 
1333
1276
  ### normalizeRecurrentLayerIndices
1334
1277
 
@@ -1345,105 +1288,174 @@ Parameters:
1345
1288
 
1346
1289
  Returns: Recurrent layer indices.
1347
1290
 
1348
- ### findRecurrentInitializer
1291
+ ### parsePoolingMetadata
1349
1292
 
1350
1293
  ```ts
1351
- findRecurrentInitializer(
1352
- layerConnectionContext: OnnxImportLayerConnectionContext,
1353
- ): { name: string; float_data: number[]; } | undefined
1294
+ parsePoolingMetadata(
1295
+ metadata: OnnxMetadataProperty[],
1296
+ ): OnnxImportPoolingMetadata | null
1354
1297
  ```
1355
1298
 
1356
- Resolve recurrent initializer tensor for one hidden-layer span.
1299
+ Parse pooling metadata payload from ONNX metadata.
1357
1300
 
1358
1301
  Parameters:
1359
- - `layerConnectionContext` - Layer connection context.
1302
+ - `metadata` - ONNX metadata entries.
1360
1303
 
1361
- Returns: Recurrent initializer tensor when available.
1304
+ Returns: Parsed pooling metadata payload.
1362
1305
 
1363
- ### sliceLayerHiddenNodes
1306
+ ### parseRecurrentLayerIndices
1364
1307
 
1365
1308
  ```ts
1366
- sliceLayerHiddenNodes(
1367
- layerConnectionContext: OnnxImportLayerConnectionContext,
1368
- ): default[]
1309
+ parseRecurrentLayerIndices(
1310
+ rawMetadataValue: string,
1311
+ ): number[]
1369
1312
  ```
1370
1313
 
1371
- Slice hidden nodes for one hidden-layer span.
1314
+ Parse recurrent layer indices metadata.
1372
1315
 
1373
1316
  Parameters:
1374
- - `layerConnectionContext` - Layer connection context.
1317
+ - `rawMetadataValue` - Raw metadata JSON string.
1375
1318
 
1376
- Returns: Hidden nodes belonging to the span.
1319
+ Returns: Normalized recurrent layer indices.
1377
1320
 
1378
- ### collectDiagonalRecurrentWeights
1321
+ ### pruneSingleLayerHiddenPlaceholders
1379
1322
 
1380
1323
  ```ts
1381
- collectDiagonalRecurrentWeights(
1382
- recurrentTensorWeights: number[],
1383
- hiddenLayerSize: number,
1384
- ): number[]
1324
+ pruneSingleLayerHiddenPlaceholders(
1325
+ network: default,
1326
+ hiddenLayerSizes: number[],
1327
+ ): void
1385
1328
  ```
1386
1329
 
1387
- Collect diagonal recurrent weights from flattened layer tensor data.
1330
+ Remove placeholder hidden nodes for single-layer perceptron imports.
1388
1331
 
1389
1332
  Parameters:
1390
- - `recurrentTensorWeights` - Flattened recurrent tensor weights.
1391
- - `hiddenLayerSize` - Hidden-layer width.
1333
+ - `network` - Target network.
1334
+ - `hiddenLayerSizes` - Hidden layer sizes.
1392
1335
 
1393
- Returns: Diagonal recurrent self-weights.
1336
+ Returns: Nothing.
1394
1337
 
1395
- ### upsertSelfConnection
1338
+ ### readLastDimensionValue
1396
1339
 
1397
1340
  ```ts
1398
- upsertSelfConnection(
1399
- selfConnectionContext: OnnxImportSelfConnectionUpsertContext,
1341
+ readLastDimensionValue(
1342
+ dimensions: { dim_value?: number | undefined; }[],
1343
+ ): number
1344
+ ```
1345
+
1346
+ Read the terminal ONNX shape dimension value from one shape array.
1347
+
1348
+ Parameters:
1349
+ - `dimensions` - ONNX shape dimensions.
1350
+
1351
+ Returns: Terminal `dim_value` payload.
1352
+
1353
+ ### reconstructFusedRecurrentLayers
1354
+
1355
+ ```ts
1356
+ reconstructFusedRecurrentLayers(
1357
+ network: default,
1358
+ onnx: OnnxModel,
1359
+ hiddenLayerSizes: number[],
1360
+ layerFactory: OnnxLayerFactory,
1361
+ metadata: OnnxMetadataProperty[],
1400
1362
  ): void
1401
1363
  ```
1402
1364
 
1403
- Upsert one node self-connection for recurrent import restoration.
1365
+ Reconstruct emitted fused LSTM/GRU layers from ONNX metadata and initializers.
1404
1366
 
1405
1367
  Parameters:
1406
- - `selfConnectionContext` - Self-connection upsert context.
1368
+ - `network` - Target network.
1369
+ - `onnx` - Source ONNX model.
1370
+ - `hiddenLayerSizes` - Hidden layer sizes.
1371
+ - `layerFactory` - Dynamic layer module.
1372
+ - `metadata` - ONNX metadata properties.
1407
1373
 
1408
1374
  Returns: Nothing.
1409
1375
 
1410
- ### parsePoolingMetadata
1376
+ ### resolveRecurrentLayerIndices
1411
1377
 
1412
1378
  ```ts
1413
- parsePoolingMetadata(
1379
+ resolveRecurrentLayerIndices(
1414
1380
  metadata: OnnxMetadataProperty[],
1415
- ): OnnxImportPoolingMetadata | null
1381
+ ): number[]
1416
1382
  ```
1417
1383
 
1418
- Parse pooling metadata payload from ONNX metadata.
1384
+ Resolve recurrent layer indices from ONNX metadata.
1419
1385
 
1420
1386
  Parameters:
1421
- - `metadata` - ONNX metadata entries.
1387
+ - `metadata` - ONNX metadata payload.
1422
1388
 
1423
- Returns: Parsed pooling metadata payload.
1389
+ Returns: Parsed recurrent layer indices.
1424
1390
 
1425
- ### attachParsedPoolingMetadata
1391
+ ### restoreRecurrentSelfConnections
1426
1392
 
1427
1393
  ```ts
1428
- attachParsedPoolingMetadata(
1394
+ restoreRecurrentSelfConnections(
1429
1395
  network: default,
1430
- poolingMetadata: OnnxImportPoolingMetadata,
1396
+ onnx: OnnxModel,
1397
+ hiddenLayerSizes: number[],
1398
+ metadata: OnnxMetadataProperty[],
1431
1399
  ): void
1432
1400
  ```
1433
1401
 
1434
- Attach parsed pooling metadata to imported network instance.
1402
+ Restore recurrent self-connections from recurrent metadata and R tensors.
1435
1403
 
1436
1404
  Parameters:
1437
1405
  - `network` - Target network.
1438
- - `poolingMetadata` - Parsed pooling metadata payload.
1406
+ - `onnx` - Source ONNX model.
1407
+ - `hiddenLayerSizes` - Hidden layer sizes.
1408
+ - `metadata` - Parsed metadata properties.
1409
+
1410
+ Returns: Nothing.
1411
+
1412
+ ### sliceLayerHiddenNodes
1413
+
1414
+ ```ts
1415
+ sliceLayerHiddenNodes(
1416
+ layerConnectionContext: OnnxImportLayerConnectionContext,
1417
+ ): default[]
1418
+ ```
1419
+
1420
+ Slice hidden nodes for one hidden-layer span.
1421
+
1422
+ Parameters:
1423
+ - `layerConnectionContext` - Layer connection context.
1424
+
1425
+ Returns: Hidden nodes belonging to the span.
1426
+
1427
+ ### upsertSelfConnection
1428
+
1429
+ ```ts
1430
+ upsertSelfConnection(
1431
+ selfConnectionContext: OnnxImportSelfConnectionUpsertContext,
1432
+ ): void
1433
+ ```
1434
+
1435
+ Upsert one node self-connection for recurrent import restoration.
1436
+
1437
+ Parameters:
1438
+ - `selfConnectionContext` - Self-connection upsert context.
1439
1439
 
1440
1440
  Returns: Nothing.
1441
1441
 
1442
1442
  ## architecture/network/onnx/import/network.onnx.import-fused-recurrent.types.ts
1443
1443
 
1444
- ### OnnxFusedRecurrentKind
1444
+ ### OnnxFusedGateApplicationContext
1445
1445
 
1446
- Supported fused recurrent operator families recognized during ONNX import.
1446
+ Gate-weight application context for one reconstructed fused layer.
1447
+
1448
+ ### OnnxFusedGateRowAssignmentContext
1449
+
1450
+ Context for assigning one gate-neuron row from flattened ONNX tensors.
1451
+
1452
+ ### OnnxFusedLayerNeighborhood
1453
+
1454
+ Hidden-layer neighborhood slices around a reconstructed fused layer.
1455
+
1456
+ ### OnnxFusedLayerReconstructionContext
1457
+
1458
+ Execution context for one fused recurrent layer reconstruction.
1447
1459
 
1448
1460
  ### OnnxFusedLayerRuntime
1449
1461
 
@@ -1453,6 +1465,10 @@ The importer only relies on a narrow runtime contract: access to the
1453
1465
  reconstructed nodes, an input wiring hook, and an optional output group that
1454
1466
  can be reconnected to the next restored layer.
1455
1467
 
1468
+ ### OnnxFusedRecurrentKind
1469
+
1470
+ Supported fused recurrent operator families recognized during ONNX import.
1471
+
1456
1472
  ### OnnxFusedRecurrentSpec
1457
1473
 
1458
1474
  Fused recurrent family specification used during import reconstruction.
@@ -1461,10 +1477,6 @@ This tells the importer how to interpret one emitted ONNX recurrent family:
1461
1477
  how many gates to expect, what order those gates were serialized in, and
1462
1478
  which gate owns the self-recurrent diagonal replay.
1463
1479
 
1464
- ### OnnxFusedLayerNeighborhood
1465
-
1466
- Hidden-layer neighborhood slices around a reconstructed fused layer.
1467
-
1468
1480
  ### OnnxFusedTensorPayload
1469
1481
 
1470
1482
  Fused recurrent tensor payload read from ONNX initializers.
@@ -1473,18 +1485,6 @@ The importer resolves the three recurrent tensor families up front so the
1473
1485
  reconstruction pass can focus on wiring and row assignment instead of
1474
1486
  repeatedly re-looking up initializers.
1475
1487
 
1476
- ### OnnxFusedLayerReconstructionContext
1477
-
1478
- Execution context for one fused recurrent layer reconstruction.
1479
-
1480
- ### OnnxFusedGateApplicationContext
1481
-
1482
- Gate-weight application context for one reconstructed fused layer.
1483
-
1484
- ### OnnxFusedGateRowAssignmentContext
1485
-
1486
- Context for assigning one gate-neuron row from flattened ONNX tensors.
1487
-
1488
1488
  ### OnnxIncomingWeightAssignmentContext
1489
1489
 
1490
1490
  Context for assigning dense incoming weights for one gate-neuron row.