@reicek/neataptic-ts 0.1.24 → 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/.github/workflows/ci.yml +3 -3
- package/.github/workflows/deploy-pages.yml +6 -6
- package/.github/workflows/manual_release_pipeline.yml +3 -3
- package/.github/workflows/publish.yml +18 -19
- package/.github/workflows/release_dispatch.yml +3 -3
- package/package.json +26 -20
- 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
|
@@ -20,380 +20,380 @@ flowchart LR
|
|
|
20
20
|
|
|
21
21
|
## architecture/network/onnx/export/network.onnx.export.types.ts
|
|
22
22
|
|
|
23
|
-
###
|
|
23
|
+
### ActivationSquashFunction
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
```ts
|
|
26
|
+
ActivationSquashFunction(
|
|
27
|
+
x: number,
|
|
28
|
+
derivate: boolean | undefined,
|
|
29
|
+
): number
|
|
30
|
+
```
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
Activation function signature used by ONNX layer emission helpers.
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
layered topology, homogeneous activations per layer, and fully-connected layers.
|
|
34
|
+
### ConvInferenceEvaluationContext
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
more networks, but it may generate graphs that are primarily meant for NeatapticTS’s
|
|
34
|
-
importer (and may be less friendly to external ONNX tooling).
|
|
36
|
+
Width and shape evaluation context used by Conv inference helpers.
|
|
35
37
|
|
|
36
|
-
|
|
37
|
-
focuses on a constrained single-step representation and optional fused heuristics.
|
|
38
|
+
### ConvInferenceKernelEvaluationContext
|
|
38
39
|
|
|
39
|
-
|
|
40
|
-
- `includeMetadata`: includes `metadata_props` with architecture hints.
|
|
41
|
-
- `opset`: numeric opset version stored in the exported model metadata (default is
|
|
42
|
-
resolved by the exporter; commonly 18 in this codebase).
|
|
43
|
-
- `legacyNodeOrdering`: keeps older node ordering for backward compatibility.
|
|
44
|
-
- `conv2dMappings` / `pool2dMappings`: encode conv/pool semantics for fully-connected
|
|
45
|
-
layers via explicit mapping declarations.
|
|
40
|
+
Kernel candidate context for one Conv inference evaluation pass.
|
|
46
41
|
|
|
47
|
-
###
|
|
42
|
+
### ConvInferenceResult
|
|
48
43
|
|
|
49
|
-
|
|
44
|
+
Collected inferred Conv metadata payload.
|
|
50
45
|
|
|
51
|
-
###
|
|
46
|
+
### ConvInferenceTraversalContext
|
|
52
47
|
|
|
53
|
-
|
|
48
|
+
Traversal context for one hidden layer during Conv inference.
|
|
54
49
|
|
|
55
|
-
###
|
|
50
|
+
### ConvKernelConsistencyContext
|
|
56
51
|
|
|
57
|
-
|
|
52
|
+
Context for kernel-coordinate consistency checks at one output position.
|
|
58
53
|
|
|
59
|
-
###
|
|
54
|
+
### ConvLayerPairContext
|
|
60
55
|
|
|
61
|
-
|
|
56
|
+
Context for one resolved Conv mapping layer pair.
|
|
62
57
|
|
|
63
|
-
###
|
|
58
|
+
### ConvOutputCoordinate
|
|
64
59
|
|
|
65
|
-
|
|
60
|
+
Coordinate for one Conv output neuron position.
|
|
66
61
|
|
|
67
|
-
###
|
|
62
|
+
### ConvRepresentativeKernelContext
|
|
68
63
|
|
|
69
|
-
|
|
64
|
+
Context for representative Conv kernel collection per output channel.
|
|
70
65
|
|
|
71
|
-
###
|
|
66
|
+
### ConvSharingValidationContext
|
|
72
67
|
|
|
73
|
-
|
|
68
|
+
Context for validating Conv sharing across all declared mappings.
|
|
74
69
|
|
|
75
|
-
###
|
|
70
|
+
### ConvSharingValidationResult
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
Result of Conv sharing validation across declared mappings.
|
|
78
73
|
|
|
79
|
-
###
|
|
74
|
+
### DenseActivationContext
|
|
80
75
|
|
|
81
|
-
|
|
76
|
+
Dense activation emission context.
|
|
82
77
|
|
|
83
|
-
###
|
|
78
|
+
### DenseActivationNodePayload
|
|
84
79
|
|
|
85
|
-
|
|
80
|
+
Strongly typed activation node payload used by dense export helpers.
|
|
86
81
|
|
|
87
|
-
###
|
|
82
|
+
### DenseGemmNodePayload
|
|
88
83
|
|
|
89
|
-
|
|
84
|
+
Strongly typed Gemm node payload used by dense export helpers.
|
|
90
85
|
|
|
91
|
-
###
|
|
86
|
+
### DenseGraphNames
|
|
92
87
|
|
|
93
|
-
|
|
88
|
+
Dense graph tensor names.
|
|
94
89
|
|
|
95
|
-
###
|
|
90
|
+
### DenseInitializerValues
|
|
96
91
|
|
|
97
|
-
|
|
92
|
+
Dense initializer value arrays.
|
|
98
93
|
|
|
99
|
-
###
|
|
94
|
+
### DenseLayerContext
|
|
100
95
|
|
|
101
|
-
|
|
96
|
+
Dense layer context enriched with resolved activation function.
|
|
102
97
|
|
|
103
|
-
###
|
|
98
|
+
### DenseLayerParams
|
|
104
99
|
|
|
105
|
-
|
|
100
|
+
Parameters for dense layer emission.
|
|
106
101
|
|
|
107
|
-
###
|
|
102
|
+
### DenseOrderedNodePayload
|
|
108
103
|
|
|
109
|
-
|
|
104
|
+
Dense node payload union used by ordered append helpers.
|
|
110
105
|
|
|
111
|
-
###
|
|
106
|
+
### DenseTensorNames
|
|
112
107
|
|
|
113
|
-
|
|
108
|
+
Dense initializer tensor names.
|
|
114
109
|
|
|
115
|
-
###
|
|
110
|
+
### DenseWeightBuildContext
|
|
116
111
|
|
|
117
|
-
|
|
112
|
+
Context for building dense layer initializers from two adjacent layers.
|
|
118
113
|
|
|
119
|
-
###
|
|
114
|
+
### DenseWeightBuildResult
|
|
120
115
|
|
|
121
|
-
|
|
116
|
+
Dense layer initializer fold output.
|
|
122
117
|
|
|
123
|
-
###
|
|
118
|
+
### DenseWeightRow
|
|
124
119
|
|
|
125
|
-
|
|
120
|
+
One collected dense row before fold to flattened initializers.
|
|
126
121
|
|
|
127
|
-
###
|
|
122
|
+
### DenseWeightRowCollectionContext
|
|
128
123
|
|
|
129
|
-
|
|
124
|
+
Context for collecting one dense row.
|
|
130
125
|
|
|
131
|
-
###
|
|
126
|
+
### DiagonalRecurrentBuildContext
|
|
132
127
|
|
|
133
|
-
|
|
128
|
+
Context for building a diagonal recurrent matrix from self-connections.
|
|
134
129
|
|
|
135
|
-
###
|
|
130
|
+
### ExportNodeIndexAssignmentContext
|
|
136
131
|
|
|
137
|
-
Context
|
|
132
|
+
Context for assigning a stable export index to one node.
|
|
138
133
|
|
|
139
|
-
###
|
|
134
|
+
### FlattenAfterPoolingContext
|
|
140
135
|
|
|
141
|
-
|
|
136
|
+
Flatten emission context after optional pooling.
|
|
142
137
|
|
|
143
|
-
###
|
|
138
|
+
### FusedRecurrentEmissionExecutionContext
|
|
144
139
|
|
|
145
|
-
|
|
140
|
+
Shared execution context for emitting one fused recurrent layer payload.
|
|
146
141
|
|
|
147
|
-
###
|
|
142
|
+
### FusedRecurrentGraphNames
|
|
148
143
|
|
|
149
|
-
Context for
|
|
144
|
+
Context for ONNX fused recurrent node payload names.
|
|
150
145
|
|
|
151
|
-
###
|
|
146
|
+
### FusedRecurrentInitializerNames
|
|
152
147
|
|
|
153
|
-
Context for
|
|
148
|
+
Context for ONNX fused recurrent initializer names.
|
|
154
149
|
|
|
155
150
|
### GruEmissionContext
|
|
156
151
|
|
|
157
152
|
Context for heuristic GRU emission when a layer matches expected shape.
|
|
158
153
|
|
|
159
|
-
###
|
|
154
|
+
### HiddenLayerHeuristicContext
|
|
160
155
|
|
|
161
|
-
Context for
|
|
156
|
+
Context for one hidden layer during heuristic recurrent emission.
|
|
162
157
|
|
|
163
|
-
###
|
|
158
|
+
### IndexedMetadataAppendContext
|
|
164
159
|
|
|
165
|
-
|
|
160
|
+
Append-an-index metadata context for JSON-array metadata keys.
|
|
166
161
|
|
|
167
|
-
###
|
|
162
|
+
### LayerActivationContext
|
|
168
163
|
|
|
169
|
-
|
|
164
|
+
Activation analysis context for one layer.
|
|
170
165
|
|
|
171
|
-
###
|
|
166
|
+
### LayerBuildContext
|
|
172
167
|
|
|
173
|
-
|
|
168
|
+
Layer build context used while emitting one ONNX graph layer segment.
|
|
174
169
|
|
|
175
|
-
###
|
|
170
|
+
### LayerRecurrentDecisionContext
|
|
176
171
|
|
|
177
|
-
Context
|
|
172
|
+
Context used to decide recurrent emission branch usage.
|
|
178
173
|
|
|
179
|
-
###
|
|
174
|
+
### LayerTraversalContext
|
|
180
175
|
|
|
181
|
-
|
|
176
|
+
Layer traversal context with adjacent layers and output classification.
|
|
182
177
|
|
|
183
|
-
###
|
|
178
|
+
### LstmCandidateContext
|
|
184
179
|
|
|
185
|
-
|
|
180
|
+
Candidate context for validating one LSTM-like hidden layer pattern.
|
|
186
181
|
|
|
187
|
-
###
|
|
182
|
+
### LstmEmissionContext
|
|
188
183
|
|
|
189
|
-
|
|
184
|
+
Context for heuristic LSTM emission when a layer matches expected shape.
|
|
190
185
|
|
|
191
|
-
###
|
|
186
|
+
### LstmLayerTraversalContext
|
|
192
187
|
|
|
193
|
-
|
|
188
|
+
Traversal context for one hidden layer during LSTM stub collection.
|
|
194
189
|
|
|
195
|
-
###
|
|
190
|
+
### LstmPatternStub
|
|
196
191
|
|
|
197
|
-
|
|
192
|
+
Heuristic LSTM pattern stub for metadata output.
|
|
198
193
|
|
|
199
|
-
###
|
|
194
|
+
### OnnxBaseModelBuildContext
|
|
200
195
|
|
|
201
|
-
|
|
196
|
+
Context for constructing a base ONNX model shell.
|
|
202
197
|
|
|
203
|
-
###
|
|
198
|
+
### OnnxBuildResolvedOptions
|
|
204
199
|
|
|
205
|
-
|
|
200
|
+
Resolved options used by ONNX model build orchestration.
|
|
206
201
|
|
|
207
|
-
###
|
|
202
|
+
### OnnxConvEmissionContext
|
|
208
203
|
|
|
209
|
-
Context
|
|
204
|
+
Context used after resolving Conv mapping for one layer.
|
|
210
205
|
|
|
211
|
-
###
|
|
206
|
+
### OnnxConvEmissionParams
|
|
212
207
|
|
|
213
|
-
|
|
208
|
+
Parameters accepted by Conv layer emission.
|
|
214
209
|
|
|
215
|
-
###
|
|
210
|
+
### OnnxConvParameters
|
|
216
211
|
|
|
217
|
-
|
|
212
|
+
Flattened Conv parameters for ONNX initializers.
|
|
218
213
|
|
|
219
|
-
###
|
|
214
|
+
### OnnxConvTensorNames
|
|
220
215
|
|
|
221
|
-
|
|
216
|
+
Tensor names generated for Conv parameters.
|
|
222
217
|
|
|
223
|
-
###
|
|
218
|
+
### OnnxExportOptions
|
|
224
219
|
|
|
225
|
-
|
|
220
|
+
Options controlling ONNX-like export.
|
|
226
221
|
|
|
227
|
-
|
|
222
|
+
These options trade off strictness, portability, and fidelity:
|
|
228
223
|
|
|
229
|
-
|
|
224
|
+
- **Strict (default-ish)** export tries to keep the graph easy to interpret:
|
|
225
|
+
layered topology, homogeneous activations per layer, and fully-connected layers.
|
|
230
226
|
|
|
231
|
-
|
|
227
|
+
- **Relaxed** export (`allowPartialConnectivity` / `allowMixedActivations`) can represent
|
|
228
|
+
more networks, but it may generate graphs that are primarily meant for NeatapticTS’s
|
|
229
|
+
importer (and may be less friendly to external ONNX tooling).
|
|
232
230
|
|
|
233
|
-
|
|
231
|
+
- **Recurrent export** (`allowRecurrent`) is intentionally conservative and currently
|
|
232
|
+
focuses on a constrained single-step representation and optional fused heuristics.
|
|
234
233
|
|
|
235
|
-
|
|
234
|
+
Key fields (high-level):
|
|
235
|
+
- `includeMetadata`: includes `metadata_props` with architecture hints.
|
|
236
|
+
- `opset`: numeric opset version stored in the exported model metadata (default is
|
|
237
|
+
resolved by the exporter; commonly 18 in this codebase).
|
|
238
|
+
- `legacyNodeOrdering`: keeps older node ordering for backward compatibility.
|
|
239
|
+
- `conv2dMappings` / `pool2dMappings`: encode conv/pool semantics for fully-connected
|
|
240
|
+
layers via explicit mapping declarations.
|
|
236
241
|
|
|
237
|
-
|
|
242
|
+
### OnnxGraphDimensionBuildContext
|
|
238
243
|
|
|
239
|
-
|
|
244
|
+
Context for constructing input/output ONNX graph dimensions.
|
|
240
245
|
|
|
241
|
-
|
|
246
|
+
### OnnxGraphDimensions
|
|
242
247
|
|
|
243
|
-
|
|
248
|
+
Output dimensions used by ONNX graph input/output value info payloads.
|
|
244
249
|
|
|
245
|
-
|
|
250
|
+
### OnnxLayerEmissionContext
|
|
246
251
|
|
|
247
|
-
|
|
252
|
+
Context for emitting non-input layers during model build.
|
|
248
253
|
|
|
249
|
-
|
|
254
|
+
### OnnxLayerEmissionResult
|
|
250
255
|
|
|
251
|
-
|
|
256
|
+
Result of emitting non-input export layers.
|
|
252
257
|
|
|
253
|
-
|
|
258
|
+
### OnnxModelMetadataContext
|
|
254
259
|
|
|
255
|
-
|
|
260
|
+
Context for applying optional ONNX model metadata.
|
|
256
261
|
|
|
257
|
-
|
|
262
|
+
### OnnxPostProcessingContext
|
|
258
263
|
|
|
259
|
-
|
|
264
|
+
Context for post-processing and export metadata finalization.
|
|
260
265
|
|
|
261
|
-
|
|
266
|
+
### OnnxRecurrentCollectionContext
|
|
262
267
|
|
|
263
|
-
|
|
268
|
+
Context for collecting recurrent layer indices during model build.
|
|
264
269
|
|
|
265
|
-
|
|
266
|
-
ActivationSquashFunction(
|
|
267
|
-
x: number,
|
|
268
|
-
derivate: boolean | undefined,
|
|
269
|
-
): number
|
|
270
|
-
```
|
|
270
|
+
### OnnxRecurrentInputValueInfoContext
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
Context for constructing one recurrent previous-state graph input payload.
|
|
273
273
|
|
|
274
|
-
###
|
|
274
|
+
### OnnxRecurrentLayerProcessingContext
|
|
275
275
|
|
|
276
|
-
|
|
276
|
+
Execution context for processing one hidden recurrent layer.
|
|
277
277
|
|
|
278
|
-
###
|
|
278
|
+
### OnnxRecurrentLayerTraversalContext
|
|
279
279
|
|
|
280
|
-
|
|
280
|
+
Traversal context for one hidden layer during recurrent-input collection.
|
|
281
281
|
|
|
282
282
|
### OptionalLayerOutputParams
|
|
283
283
|
|
|
284
284
|
Shared parameters for optional pooling/flatten output emission.
|
|
285
285
|
|
|
286
|
-
###
|
|
287
|
-
|
|
288
|
-
Context for building dense layer initializers from two adjacent layers.
|
|
289
|
-
|
|
290
|
-
### DenseWeightRow
|
|
286
|
+
### OptionalPoolingAndFlattenParams
|
|
291
287
|
|
|
292
|
-
|
|
288
|
+
Parameters for optional pooling + flatten emission after a layer output.
|
|
293
289
|
|
|
294
|
-
###
|
|
290
|
+
### PerNeuronConcatNodePayload
|
|
295
291
|
|
|
296
|
-
|
|
292
|
+
Per-neuron concat node payload.
|
|
297
293
|
|
|
298
|
-
###
|
|
294
|
+
### PerNeuronGraphNames
|
|
299
295
|
|
|
300
|
-
|
|
296
|
+
Per-neuron graph tensor names.
|
|
301
297
|
|
|
302
|
-
###
|
|
298
|
+
### PerNeuronLayerContext
|
|
303
299
|
|
|
304
|
-
|
|
300
|
+
Per-neuron layer context alias.
|
|
305
301
|
|
|
306
|
-
###
|
|
302
|
+
### PerNeuronLayerParams
|
|
307
303
|
|
|
308
|
-
|
|
304
|
+
Parameters for per-neuron layer emission.
|
|
309
305
|
|
|
310
|
-
###
|
|
306
|
+
### PerNeuronNodeContext
|
|
311
307
|
|
|
312
|
-
|
|
308
|
+
Per-neuron normalized node context.
|
|
313
309
|
|
|
314
|
-
###
|
|
310
|
+
### PerNeuronSubgraphContext
|
|
315
311
|
|
|
316
|
-
|
|
312
|
+
Per-neuron subgraph emission context.
|
|
317
313
|
|
|
318
|
-
###
|
|
314
|
+
### PerNeuronTensorNames
|
|
319
315
|
|
|
320
|
-
|
|
316
|
+
Per-neuron initializer tensor names.
|
|
321
317
|
|
|
322
318
|
### PoolingAttributes
|
|
323
319
|
|
|
324
320
|
Pooling tensor attributes for ONNX node payloads.
|
|
325
321
|
|
|
326
|
-
###
|
|
322
|
+
### PoolingEmissionContext
|
|
327
323
|
|
|
328
|
-
|
|
324
|
+
Pooling emission context resolved for one layer output.
|
|
329
325
|
|
|
330
|
-
###
|
|
326
|
+
### RecurrentActivationEmissionContext
|
|
331
327
|
|
|
332
|
-
|
|
328
|
+
Context for selecting and emitting recurrent activation node payload.
|
|
333
329
|
|
|
334
|
-
###
|
|
330
|
+
### RecurrentGateBlockCollectionContext
|
|
335
331
|
|
|
336
|
-
|
|
332
|
+
Context for collecting one gate parameter block.
|
|
337
333
|
|
|
338
|
-
###
|
|
334
|
+
### RecurrentGateParameterCollectionResult
|
|
339
335
|
|
|
340
|
-
|
|
336
|
+
Flattened recurrent gate parameter vectors for one fused operator.
|
|
341
337
|
|
|
342
|
-
###
|
|
338
|
+
### RecurrentGateRow
|
|
343
339
|
|
|
344
|
-
|
|
340
|
+
One recurrent gate row payload before flatten fold.
|
|
345
341
|
|
|
346
|
-
###
|
|
342
|
+
### RecurrentGateRowCollectionContext
|
|
347
343
|
|
|
348
|
-
|
|
344
|
+
Context for collecting one recurrent gate row (one neuron).
|
|
349
345
|
|
|
350
|
-
###
|
|
346
|
+
### RecurrentGemmEmissionContext
|
|
351
347
|
|
|
352
|
-
|
|
348
|
+
Context for emitting one Gemm node for recurrent single-step export.
|
|
353
349
|
|
|
354
|
-
###
|
|
350
|
+
### RecurrentGraphNames
|
|
355
351
|
|
|
356
|
-
|
|
352
|
+
Derived graph names for one recurrent single-step layer payload.
|
|
357
353
|
|
|
358
|
-
###
|
|
354
|
+
### RecurrentHeuristicEmissionContext
|
|
359
355
|
|
|
360
|
-
|
|
356
|
+
Context for heuristic recurrent operator emission traversal.
|
|
361
357
|
|
|
362
|
-
###
|
|
358
|
+
### RecurrentInitializerEmissionContext
|
|
363
359
|
|
|
364
|
-
|
|
360
|
+
Context for pushing recurrent initializers into ONNX graph state.
|
|
365
361
|
|
|
366
|
-
###
|
|
362
|
+
### RecurrentInitializerNames
|
|
367
363
|
|
|
368
|
-
|
|
364
|
+
Initializer tensor names for one single-step recurrent layer.
|
|
369
365
|
|
|
370
|
-
###
|
|
366
|
+
### RecurrentInitializerValues
|
|
371
367
|
|
|
372
|
-
|
|
368
|
+
Collected initializer vectors for one single-step recurrent layer.
|
|
373
369
|
|
|
374
|
-
###
|
|
370
|
+
### RecurrentLayerEmissionContext
|
|
375
371
|
|
|
376
|
-
|
|
372
|
+
Derived execution context for single-step recurrent layer emission.
|
|
377
373
|
|
|
378
|
-
###
|
|
374
|
+
### RecurrentLayerEmissionParams
|
|
379
375
|
|
|
380
|
-
|
|
376
|
+
Parameters for single-step recurrent layer emission.
|
|
381
377
|
|
|
382
|
-
###
|
|
378
|
+
### RecurrentRowCollectionContext
|
|
383
379
|
|
|
384
|
-
|
|
380
|
+
Context for collecting one recurrent matrix row.
|
|
385
381
|
|
|
386
|
-
###
|
|
382
|
+
### SharedActivationNodeBuildParams
|
|
387
383
|
|
|
388
|
-
|
|
384
|
+
Shared parameters for constructing an activation node payload.
|
|
389
385
|
|
|
390
|
-
###
|
|
386
|
+
### SharedGemmNodeBuildParams
|
|
391
387
|
|
|
392
|
-
|
|
388
|
+
Shared parameters for constructing a Gemm node payload.
|
|
393
389
|
|
|
394
|
-
###
|
|
390
|
+
### SpecMetadataAppendContext
|
|
395
391
|
|
|
396
|
-
|
|
392
|
+
Append-a-spec metadata context for JSON-array metadata keys.
|
|
393
|
+
|
|
394
|
+
### WeightToleranceComparisonContext
|
|
395
|
+
|
|
396
|
+
Context for comparing two scalar weights with numeric tolerance.
|
|
397
397
|
|
|
398
398
|
## architecture/network/onnx/export/network.onnx.export-flow.utils.ts
|
|
399
399
|
|
|
@@ -443,35 +443,39 @@ Returns: ONNX model.
|
|
|
443
443
|
|
|
444
444
|
## architecture/network/onnx/export/network.onnx.export-setup.utils.ts
|
|
445
445
|
|
|
446
|
-
###
|
|
446
|
+
### appendRecurrentGraphInput
|
|
447
447
|
|
|
448
448
|
```ts
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
449
|
+
appendRecurrentGraphInput(
|
|
450
|
+
model: OnnxModel,
|
|
451
|
+
traversalContext: OnnxRecurrentLayerTraversalContext,
|
|
452
|
+
): void
|
|
452
453
|
```
|
|
453
454
|
|
|
454
|
-
|
|
455
|
+
Append one recurrent previous-state graph input for a hidden layer.
|
|
455
456
|
|
|
456
457
|
Parameters:
|
|
457
|
-
- `
|
|
458
|
+
- `model` - Target ONNX model.
|
|
459
|
+
- `traversalContext` - Hidden layer traversal context.
|
|
458
460
|
|
|
459
|
-
Returns:
|
|
461
|
+
Returns: Nothing.
|
|
460
462
|
|
|
461
|
-
###
|
|
463
|
+
### appendRecurrentLayerIndex
|
|
462
464
|
|
|
463
465
|
```ts
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
466
|
+
appendRecurrentLayerIndex(
|
|
467
|
+
recurrentLayerIndices: number[],
|
|
468
|
+
traversalContext: OnnxRecurrentLayerTraversalContext,
|
|
469
|
+
): void
|
|
467
470
|
```
|
|
468
471
|
|
|
469
|
-
|
|
472
|
+
Append one recurrent layer index to the collected index list.
|
|
470
473
|
|
|
471
474
|
Parameters:
|
|
472
|
-
- `
|
|
475
|
+
- `recurrentLayerIndices` - Collected recurrent layer indices.
|
|
476
|
+
- `traversalContext` - Hidden layer traversal context.
|
|
473
477
|
|
|
474
|
-
Returns:
|
|
478
|
+
Returns: Nothing.
|
|
475
479
|
|
|
476
480
|
### applyModelMetadata
|
|
477
481
|
|
|
@@ -503,22 +507,35 @@ Parameters:
|
|
|
503
507
|
|
|
504
508
|
Returns: Export-layer indices with recurrent self-connections.
|
|
505
509
|
|
|
506
|
-
###
|
|
510
|
+
### createBaseModel
|
|
507
511
|
|
|
508
512
|
```ts
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
+
createBaseModel(
|
|
514
|
+
context: OnnxBaseModelBuildContext,
|
|
515
|
+
): OnnxModel
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
Create the base ONNX model shell with graph input/output declarations.
|
|
519
|
+
|
|
520
|
+
Parameters:
|
|
521
|
+
- `context` - Base model build context.
|
|
522
|
+
|
|
523
|
+
Returns: Initialized ONNX model with empty initializer/node lists.
|
|
524
|
+
|
|
525
|
+
### createGraphDimensions
|
|
526
|
+
|
|
527
|
+
```ts
|
|
528
|
+
createGraphDimensions(
|
|
529
|
+
context: OnnxGraphDimensionBuildContext,
|
|
530
|
+
): OnnxGraphDimensions
|
|
513
531
|
```
|
|
514
532
|
|
|
515
|
-
Build
|
|
533
|
+
Build tensor dimensions for model input and output, optionally with symbolic batch dimension.
|
|
516
534
|
|
|
517
535
|
Parameters:
|
|
518
|
-
- `
|
|
519
|
-
- `batchDimension` - Whether symbolic batch dimension is enabled.
|
|
536
|
+
- `context` - Dimension construction context.
|
|
520
537
|
|
|
521
|
-
Returns:
|
|
538
|
+
Returns: Input and output dimension arrays for ONNX value info.
|
|
522
539
|
|
|
523
540
|
### createGraphValueInfo
|
|
524
541
|
|
|
@@ -537,20 +554,20 @@ Parameters:
|
|
|
537
554
|
|
|
538
555
|
Returns: ONNX value info payload.
|
|
539
556
|
|
|
540
|
-
###
|
|
557
|
+
### createHiddenLayerIndices
|
|
541
558
|
|
|
542
559
|
```ts
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
):
|
|
560
|
+
createHiddenLayerIndices(
|
|
561
|
+
totalLayerCount: number,
|
|
562
|
+
): number[]
|
|
546
563
|
```
|
|
547
564
|
|
|
548
|
-
|
|
565
|
+
Build hidden layer indices excluding input and output layers.
|
|
549
566
|
|
|
550
567
|
Parameters:
|
|
551
|
-
- `
|
|
568
|
+
- `totalLayerCount` - Total number of network layers.
|
|
552
569
|
|
|
553
|
-
Returns:
|
|
570
|
+
Returns: Hidden layer indices.
|
|
554
571
|
|
|
555
572
|
### createHiddenLayerTraversalContexts
|
|
556
573
|
|
|
@@ -567,69 +584,52 @@ Parameters:
|
|
|
567
584
|
|
|
568
585
|
Returns: Hidden layer traversal contexts.
|
|
569
586
|
|
|
570
|
-
###
|
|
571
|
-
|
|
572
|
-
```ts
|
|
573
|
-
createHiddenLayerIndices(
|
|
574
|
-
totalLayerCount: number,
|
|
575
|
-
): number[]
|
|
576
|
-
```
|
|
577
|
-
|
|
578
|
-
Build hidden layer indices excluding input and output layers.
|
|
579
|
-
|
|
580
|
-
Parameters:
|
|
581
|
-
- `totalLayerCount` - Total number of network layers.
|
|
582
|
-
|
|
583
|
-
Returns: Hidden layer indices.
|
|
584
|
-
|
|
585
|
-
### processHiddenLayerRecurrence
|
|
587
|
+
### createRecurrentInputValueInfo
|
|
586
588
|
|
|
587
589
|
```ts
|
|
588
|
-
|
|
589
|
-
context:
|
|
590
|
-
):
|
|
590
|
+
createRecurrentInputValueInfo(
|
|
591
|
+
context: OnnxRecurrentInputValueInfoContext,
|
|
592
|
+
): OnnxValueInfo
|
|
591
593
|
```
|
|
592
594
|
|
|
593
|
-
|
|
595
|
+
Build one recurrent previous-state graph input payload.
|
|
594
596
|
|
|
595
597
|
Parameters:
|
|
596
|
-
- `context` -
|
|
598
|
+
- `context` - Recurrent input value-info context.
|
|
597
599
|
|
|
598
|
-
Returns:
|
|
600
|
+
Returns: ONNX value info payload for recurrent state input.
|
|
599
601
|
|
|
600
|
-
###
|
|
602
|
+
### createRecurrentInputValueInfoContext
|
|
601
603
|
|
|
602
604
|
```ts
|
|
603
|
-
|
|
604
|
-
recurrentLayerIndices: number[],
|
|
605
|
+
createRecurrentInputValueInfoContext(
|
|
605
606
|
traversalContext: OnnxRecurrentLayerTraversalContext,
|
|
606
|
-
):
|
|
607
|
+
): OnnxRecurrentInputValueInfoContext
|
|
607
608
|
```
|
|
608
609
|
|
|
609
|
-
|
|
610
|
+
Build recurrent input context for one hidden recurrent layer.
|
|
610
611
|
|
|
611
612
|
Parameters:
|
|
612
|
-
- `recurrentLayerIndices` - Collected recurrent layer indices.
|
|
613
613
|
- `traversalContext` - Hidden layer traversal context.
|
|
614
614
|
|
|
615
|
-
Returns:
|
|
615
|
+
Returns: Recurrent input value-info context.
|
|
616
616
|
|
|
617
|
-
###
|
|
617
|
+
### createTensorDimensions
|
|
618
618
|
|
|
619
619
|
```ts
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
):
|
|
620
|
+
createTensorDimensions(
|
|
621
|
+
width: number,
|
|
622
|
+
batchDimension: boolean,
|
|
623
|
+
): OnnxDimension[]
|
|
624
624
|
```
|
|
625
625
|
|
|
626
|
-
|
|
626
|
+
Build one tensor shape dimension payload for dense vectors.
|
|
627
627
|
|
|
628
628
|
Parameters:
|
|
629
|
-
- `
|
|
630
|
-
- `
|
|
629
|
+
- `width` - Vector width.
|
|
630
|
+
- `batchDimension` - Whether symbolic batch dimension is enabled.
|
|
631
631
|
|
|
632
|
-
Returns:
|
|
632
|
+
Returns: ONNX dimensions for the vector payload.
|
|
633
633
|
|
|
634
634
|
### hasLayerSelfRecurrence
|
|
635
635
|
|
|
@@ -646,200 +646,197 @@ Parameters:
|
|
|
646
646
|
|
|
647
647
|
Returns: True when a node has a self-connection.
|
|
648
648
|
|
|
649
|
-
###
|
|
649
|
+
### isRecurrentCollectionEnabled
|
|
650
650
|
|
|
651
651
|
```ts
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
):
|
|
652
|
+
isRecurrentCollectionEnabled(
|
|
653
|
+
context: OnnxRecurrentCollectionContext,
|
|
654
|
+
): boolean
|
|
655
655
|
```
|
|
656
656
|
|
|
657
|
-
|
|
657
|
+
Determine whether recurrent layer collection should execute.
|
|
658
658
|
|
|
659
659
|
Parameters:
|
|
660
|
-
- `
|
|
660
|
+
- `context` - Recurrent collection context.
|
|
661
661
|
|
|
662
|
-
Returns:
|
|
662
|
+
Returns: True when recurrent collection is enabled.
|
|
663
663
|
|
|
664
|
-
###
|
|
664
|
+
### processHiddenLayerRecurrence
|
|
665
665
|
|
|
666
666
|
```ts
|
|
667
|
-
|
|
668
|
-
context:
|
|
669
|
-
):
|
|
667
|
+
processHiddenLayerRecurrence(
|
|
668
|
+
context: OnnxRecurrentLayerProcessingContext,
|
|
669
|
+
): void
|
|
670
670
|
```
|
|
671
671
|
|
|
672
|
-
|
|
672
|
+
Process one hidden layer for recurrent self-connections.
|
|
673
673
|
|
|
674
674
|
Parameters:
|
|
675
|
-
- `context` -
|
|
675
|
+
- `context` - Hidden layer recurrent processing context.
|
|
676
676
|
|
|
677
|
-
Returns:
|
|
677
|
+
Returns: Nothing.
|
|
678
678
|
|
|
679
679
|
## architecture/network/onnx/export/network.onnx.export-postprocess.utils.ts
|
|
680
680
|
|
|
681
|
-
###
|
|
681
|
+
### appendConvLayerValidationResult
|
|
682
682
|
|
|
683
683
|
```ts
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
previousOutputName: string,
|
|
684
|
+
appendConvLayerValidationResult(
|
|
685
|
+
result: ConvSharingValidationResult,
|
|
686
|
+
layerIndex: number,
|
|
687
|
+
isConsistent: boolean,
|
|
689
688
|
): void
|
|
690
689
|
```
|
|
691
690
|
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
Parameters:
|
|
695
|
-
- `model` - Target ONNX model.
|
|
696
|
-
- `layers` - Layered network nodes.
|
|
697
|
-
- `allowRecurrent` - Whether recurrent export is enabled.
|
|
698
|
-
- `previousOutputName` - Current graph output name (kept for backward-compatible emission semantics).
|
|
699
|
-
|
|
700
|
-
Returns: Nothing.
|
|
691
|
+
Append one Conv-layer validation outcome and optional warning.
|
|
701
692
|
|
|
702
|
-
###
|
|
693
|
+
### appendConvSharingMetadata
|
|
703
694
|
|
|
704
695
|
```ts
|
|
705
|
-
|
|
696
|
+
appendConvSharingMetadata(
|
|
706
697
|
model: OnnxModel,
|
|
707
|
-
|
|
708
|
-
options: OnnxExportOptions,
|
|
709
|
-
includeMetadata: boolean,
|
|
710
|
-
hiddenSizesMetadata: number[],
|
|
711
|
-
recurrentLayerIndices: number[],
|
|
698
|
+
result: ConvSharingValidationResult,
|
|
712
699
|
): void
|
|
713
700
|
```
|
|
714
701
|
|
|
715
|
-
|
|
702
|
+
Append Conv-sharing validation metadata arrays.
|
|
716
703
|
|
|
717
|
-
|
|
718
|
-
- `model` - Target ONNX model.
|
|
719
|
-
- `layers` - Layered network nodes.
|
|
720
|
-
- `options` - Export options.
|
|
721
|
-
- `includeMetadata` - Whether metadata emission is enabled.
|
|
722
|
-
- `hiddenSizesMetadata` - Hidden-layer sizes collected during emission.
|
|
723
|
-
- `recurrentLayerIndices` - Recurrent layer indices.
|
|
704
|
+
### appendFusedRecurrentInitializers
|
|
724
705
|
|
|
725
|
-
|
|
706
|
+
```ts
|
|
707
|
+
appendFusedRecurrentInitializers(
|
|
708
|
+
model: OnnxModel,
|
|
709
|
+
initializerNames: FusedRecurrentInitializerNames,
|
|
710
|
+
parameters: RecurrentGateParameterCollectionResult,
|
|
711
|
+
gateCount: number,
|
|
712
|
+
unitSize: number,
|
|
713
|
+
previousSize: number,
|
|
714
|
+
): void
|
|
715
|
+
```
|
|
726
716
|
|
|
727
|
-
|
|
717
|
+
Append fused recurrent initializer tensors to the ONNX graph.
|
|
718
|
+
|
|
719
|
+
### appendFusedRecurrentNode
|
|
728
720
|
|
|
729
721
|
```ts
|
|
730
|
-
|
|
731
|
-
|
|
722
|
+
appendFusedRecurrentNode(
|
|
723
|
+
graph: OnnxGraph,
|
|
724
|
+
operatorType: "LSTM" | "GRU",
|
|
725
|
+
previousOutputName: string,
|
|
726
|
+
initializerNames: FusedRecurrentInitializerNames,
|
|
727
|
+
graphNames: FusedRecurrentGraphNames,
|
|
728
|
+
unitSize: number,
|
|
732
729
|
): void
|
|
733
730
|
```
|
|
734
731
|
|
|
735
|
-
|
|
732
|
+
Append fused recurrent operator node to the ONNX graph.
|
|
736
733
|
|
|
737
|
-
###
|
|
734
|
+
### appendIndexMetadata
|
|
738
735
|
|
|
739
736
|
```ts
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
737
|
+
appendIndexMetadata(
|
|
738
|
+
model: OnnxModel,
|
|
739
|
+
key: string,
|
|
740
|
+
layerIndex: number,
|
|
741
|
+
): void
|
|
743
742
|
```
|
|
744
743
|
|
|
745
|
-
|
|
744
|
+
Append a unique layer index to metadata array key.
|
|
746
745
|
|
|
747
|
-
###
|
|
746
|
+
### appendMetadataProperty
|
|
748
747
|
|
|
749
748
|
```ts
|
|
750
|
-
|
|
751
|
-
|
|
749
|
+
appendMetadataProperty(
|
|
750
|
+
model: OnnxModel,
|
|
751
|
+
metadataProperty: OnnxMetadataProperty,
|
|
752
752
|
): void
|
|
753
753
|
```
|
|
754
754
|
|
|
755
|
-
|
|
755
|
+
Append metadata property to model metadata_props list.
|
|
756
756
|
|
|
757
|
-
###
|
|
757
|
+
### appendRecurrentSingleStepMetadata
|
|
758
758
|
|
|
759
759
|
```ts
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
760
|
+
appendRecurrentSingleStepMetadata(
|
|
761
|
+
model: OnnxModel,
|
|
762
|
+
recurrentLayerIndices: number[],
|
|
763
|
+
): void
|
|
763
764
|
```
|
|
764
765
|
|
|
765
|
-
|
|
766
|
+
Append recurrent single-step metadata when recurrent layers exist.
|
|
766
767
|
|
|
767
|
-
###
|
|
768
|
+
### areWeightsWithinTolerance
|
|
768
769
|
|
|
769
770
|
```ts
|
|
770
|
-
|
|
771
|
-
context:
|
|
772
|
-
):
|
|
771
|
+
areWeightsWithinTolerance(
|
|
772
|
+
context: WeightToleranceComparisonContext,
|
|
773
|
+
): boolean
|
|
773
774
|
```
|
|
774
775
|
|
|
775
|
-
|
|
776
|
+
Compare two scalar weights using configured tolerance.
|
|
776
777
|
|
|
777
|
-
###
|
|
778
|
+
### asNodeInternals
|
|
778
779
|
|
|
779
780
|
```ts
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
layerIndex: number,
|
|
784
|
-
): void
|
|
781
|
+
asNodeInternals(
|
|
782
|
+
node: default,
|
|
783
|
+
): NodeInternals
|
|
785
784
|
```
|
|
786
785
|
|
|
787
|
-
|
|
786
|
+
Resolve runtime node internals in one typed helper.
|
|
788
787
|
|
|
789
|
-
###
|
|
788
|
+
### buildFusedGruExecutionContext
|
|
790
789
|
|
|
791
790
|
```ts
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
): number
|
|
791
|
+
buildFusedGruExecutionContext(
|
|
792
|
+
context: GruEmissionContext,
|
|
793
|
+
): FusedRecurrentEmissionExecutionContext
|
|
796
794
|
```
|
|
797
795
|
|
|
798
|
-
|
|
796
|
+
Build shared fused-recurrent execution context for GRU.
|
|
799
797
|
|
|
800
|
-
###
|
|
798
|
+
### buildFusedLstmExecutionContext
|
|
801
799
|
|
|
802
800
|
```ts
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
layerIndex: number,
|
|
807
|
-
): void
|
|
801
|
+
buildFusedLstmExecutionContext(
|
|
802
|
+
context: LstmEmissionContext,
|
|
803
|
+
): FusedRecurrentEmissionExecutionContext
|
|
808
804
|
```
|
|
809
805
|
|
|
810
|
-
|
|
806
|
+
Build shared fused-recurrent execution context for LSTM.
|
|
811
807
|
|
|
812
|
-
###
|
|
808
|
+
### buildFusedRecurrentGraphNames
|
|
813
809
|
|
|
814
810
|
```ts
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
811
|
+
buildFusedRecurrentGraphNames(
|
|
812
|
+
nodePrefix: string,
|
|
813
|
+
outputSuffix: string,
|
|
814
|
+
layerIndex: number,
|
|
815
|
+
): FusedRecurrentGraphNames
|
|
818
816
|
```
|
|
819
817
|
|
|
820
|
-
|
|
818
|
+
Build fused recurrent graph names for node and output.
|
|
821
819
|
|
|
822
|
-
###
|
|
820
|
+
### buildFusedRecurrentInitializerNames
|
|
823
821
|
|
|
824
822
|
```ts
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
): RecurrentHeuristicEmissionContext
|
|
823
|
+
buildFusedRecurrentInitializerNames(
|
|
824
|
+
operatorType: "LSTM" | "GRU",
|
|
825
|
+
layerIndex: number,
|
|
826
|
+
): FusedRecurrentInitializerNames
|
|
830
827
|
```
|
|
831
828
|
|
|
832
|
-
Build
|
|
829
|
+
Build fused recurrent initializer names for the current layer.
|
|
833
830
|
|
|
834
|
-
###
|
|
831
|
+
### buildGruEmissionContext
|
|
835
832
|
|
|
836
833
|
```ts
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
):
|
|
834
|
+
buildGruEmissionContext(
|
|
835
|
+
context: HiddenLayerHeuristicContext,
|
|
836
|
+
): GruEmissionContext
|
|
840
837
|
```
|
|
841
838
|
|
|
842
|
-
|
|
839
|
+
Build GRU emission context from one hidden-layer traversal record.
|
|
843
840
|
|
|
844
841
|
### buildHiddenLayerHeuristicContext
|
|
845
842
|
|
|
@@ -852,85 +849,88 @@ buildHiddenLayerHeuristicContext(
|
|
|
852
849
|
|
|
853
850
|
Build one hidden-layer traversal context.
|
|
854
851
|
|
|
855
|
-
###
|
|
852
|
+
### buildLstmEmissionContext
|
|
856
853
|
|
|
857
854
|
```ts
|
|
858
|
-
|
|
855
|
+
buildLstmEmissionContext(
|
|
859
856
|
context: HiddenLayerHeuristicContext,
|
|
860
|
-
):
|
|
857
|
+
): LstmEmissionContext
|
|
861
858
|
```
|
|
862
859
|
|
|
863
|
-
|
|
860
|
+
Build LSTM emission context from one hidden-layer traversal record.
|
|
864
861
|
|
|
865
|
-
###
|
|
862
|
+
### buildMetadataProperty
|
|
866
863
|
|
|
867
864
|
```ts
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
865
|
+
buildMetadataProperty(
|
|
866
|
+
key: string,
|
|
867
|
+
value: unknown,
|
|
868
|
+
): OnnxMetadataProperty
|
|
871
869
|
```
|
|
872
870
|
|
|
873
|
-
|
|
871
|
+
Build a metadata key/value property with JSON string serialization.
|
|
874
872
|
|
|
875
|
-
###
|
|
873
|
+
### buildRecurrentHeuristicEmissionContext
|
|
876
874
|
|
|
877
875
|
```ts
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
876
|
+
buildRecurrentHeuristicEmissionContext(
|
|
877
|
+
model: OnnxModel,
|
|
878
|
+
layers: default[][],
|
|
879
|
+
previousOutputName: string,
|
|
880
|
+
): RecurrentHeuristicEmissionContext
|
|
881
881
|
```
|
|
882
882
|
|
|
883
|
-
|
|
883
|
+
Build reusable context for recurrent heuristic traversal.
|
|
884
884
|
|
|
885
|
-
###
|
|
885
|
+
### collectConvKernelCoordinates
|
|
886
886
|
|
|
887
887
|
```ts
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
):
|
|
888
|
+
collectConvKernelCoordinates(
|
|
889
|
+
convSpec: Conv2DMapping,
|
|
890
|
+
): OnnxConvKernelCoordinate[]
|
|
891
891
|
```
|
|
892
892
|
|
|
893
|
-
|
|
893
|
+
Collect kernel coordinates for one Conv kernel traversal.
|
|
894
894
|
|
|
895
|
-
###
|
|
895
|
+
### collectConvOutputCoordinates
|
|
896
896
|
|
|
897
897
|
```ts
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
):
|
|
898
|
+
collectConvOutputCoordinates(
|
|
899
|
+
convSpec: Conv2DMapping,
|
|
900
|
+
): ConvOutputCoordinate[]
|
|
901
901
|
```
|
|
902
902
|
|
|
903
|
-
Collect
|
|
903
|
+
Collect output coordinates for full Conv traversal.
|
|
904
904
|
|
|
905
|
-
###
|
|
905
|
+
### collectGruGateNodeGroups
|
|
906
906
|
|
|
907
907
|
```ts
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
):
|
|
908
|
+
collectGruGateNodeGroups(
|
|
909
|
+
context: GruEmissionContext,
|
|
910
|
+
): default[][]
|
|
911
911
|
```
|
|
912
912
|
|
|
913
|
-
|
|
913
|
+
Collect GRU gate node groups in canonical export order.
|
|
914
914
|
|
|
915
|
-
###
|
|
915
|
+
### collectHiddenLayerIndices
|
|
916
916
|
|
|
917
917
|
```ts
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
):
|
|
918
|
+
collectHiddenLayerIndices(
|
|
919
|
+
layers: default[][],
|
|
920
|
+
): number[]
|
|
921
921
|
```
|
|
922
922
|
|
|
923
|
-
|
|
923
|
+
Collect hidden-layer indices for recurrent traversal.
|
|
924
924
|
|
|
925
|
-
###
|
|
925
|
+
### collectLstmGateNodeGroups
|
|
926
926
|
|
|
927
927
|
```ts
|
|
928
|
-
|
|
929
|
-
context:
|
|
928
|
+
collectLstmGateNodeGroups(
|
|
929
|
+
context: LstmEmissionContext,
|
|
930
930
|
): default[][]
|
|
931
931
|
```
|
|
932
932
|
|
|
933
|
-
Collect
|
|
933
|
+
Collect LSTM gate node groups in canonical export order.
|
|
934
934
|
|
|
935
935
|
### collectRecurrentGateBlockParameters
|
|
936
936
|
|
|
@@ -952,142 +952,145 @@ collectRecurrentGateRow(
|
|
|
952
952
|
|
|
953
953
|
Collect one recurrent gate row payload (inputs, recurrent slice, and bias).
|
|
954
954
|
|
|
955
|
-
###
|
|
956
|
-
|
|
957
|
-
```ts
|
|
958
|
-
resolveRecurrentRowWeight(
|
|
959
|
-
context: RecurrentGateRowCollectionContext,
|
|
960
|
-
columnIndex: number,
|
|
961
|
-
): number
|
|
962
|
-
```
|
|
963
|
-
|
|
964
|
-
Resolve one recurrent row value at the requested column.
|
|
965
|
-
|
|
966
|
-
### foldRecurrentGateRows
|
|
955
|
+
### collectRepresentativeKernelForChannel
|
|
967
956
|
|
|
968
957
|
```ts
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
):
|
|
958
|
+
collectRepresentativeKernelForChannel(
|
|
959
|
+
context: ConvRepresentativeKernelContext,
|
|
960
|
+
): number[]
|
|
972
961
|
```
|
|
973
962
|
|
|
974
|
-
|
|
963
|
+
Collect one representative kernel by reading the first output position for a channel.
|
|
975
964
|
|
|
976
|
-
###
|
|
965
|
+
### collectRepresentativeKernels
|
|
977
966
|
|
|
978
967
|
```ts
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
):
|
|
968
|
+
collectRepresentativeKernels(
|
|
969
|
+
context: ConvLayerPairContext,
|
|
970
|
+
): number[][]
|
|
982
971
|
```
|
|
983
972
|
|
|
984
|
-
|
|
973
|
+
Collect representative kernels for each output channel.
|
|
985
974
|
|
|
986
|
-
###
|
|
975
|
+
### collectRepresentativeKernelWeight
|
|
987
976
|
|
|
988
977
|
```ts
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
978
|
+
collectRepresentativeKernelWeight(
|
|
979
|
+
convSpec: Conv2DMapping,
|
|
980
|
+
previousLayerNodes: default[],
|
|
981
|
+
representativeInternal: NodeInternals,
|
|
982
|
+
kernelCoordinate: OnnxConvKernelCoordinate,
|
|
983
|
+
): number
|
|
993
984
|
```
|
|
994
985
|
|
|
995
|
-
|
|
986
|
+
Collect representative kernel value using top-left receptive field indexing.
|
|
996
987
|
|
|
997
|
-
###
|
|
988
|
+
### emitFallbackRecurrentPatternMetadata
|
|
998
989
|
|
|
999
990
|
```ts
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
layerIndex: number,
|
|
1004
|
-
): FusedRecurrentGraphNames
|
|
991
|
+
emitFallbackRecurrentPatternMetadata(
|
|
992
|
+
context: HiddenLayerHeuristicContext,
|
|
993
|
+
): void
|
|
1005
994
|
```
|
|
1006
995
|
|
|
1007
|
-
|
|
996
|
+
Emit fallback metadata for recurrent-size ambiguity.
|
|
1008
997
|
|
|
1009
|
-
###
|
|
998
|
+
### emitFusedRecurrentHeuristics
|
|
1010
999
|
|
|
1011
1000
|
```ts
|
|
1012
|
-
|
|
1001
|
+
emitFusedRecurrentHeuristics(
|
|
1013
1002
|
model: OnnxModel,
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
unitSize: number,
|
|
1018
|
-
previousSize: number,
|
|
1003
|
+
layers: default[][],
|
|
1004
|
+
allowRecurrent: boolean | undefined,
|
|
1005
|
+
previousOutputName: string,
|
|
1019
1006
|
): void
|
|
1020
1007
|
```
|
|
1021
1008
|
|
|
1022
|
-
|
|
1009
|
+
Emit heuristic fused recurrent operators (LSTM/GRU) when recurrent export is enabled.
|
|
1023
1010
|
|
|
1024
|
-
|
|
1011
|
+
Parameters:
|
|
1012
|
+
- `model` - Target ONNX model.
|
|
1013
|
+
- `layers` - Layered network nodes.
|
|
1014
|
+
- `allowRecurrent` - Whether recurrent export is enabled.
|
|
1015
|
+
- `previousOutputName` - Current graph output name (kept for backward-compatible emission semantics).
|
|
1016
|
+
|
|
1017
|
+
Returns: Nothing.
|
|
1018
|
+
|
|
1019
|
+
### emitFusedRecurrentLayer
|
|
1025
1020
|
|
|
1026
1021
|
```ts
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
operatorType: "LSTM" | "GRU",
|
|
1030
|
-
previousOutputName: string,
|
|
1031
|
-
initializerNames: FusedRecurrentInitializerNames,
|
|
1032
|
-
graphNames: FusedRecurrentGraphNames,
|
|
1033
|
-
unitSize: number,
|
|
1022
|
+
emitFusedRecurrentLayer(
|
|
1023
|
+
context: FusedRecurrentEmissionExecutionContext,
|
|
1034
1024
|
): void
|
|
1035
1025
|
```
|
|
1036
1026
|
|
|
1037
|
-
|
|
1027
|
+
Emit shared fused recurrent payload (initializers, node, metadata).
|
|
1038
1028
|
|
|
1039
|
-
###
|
|
1029
|
+
### ensureMetadataProps
|
|
1040
1030
|
|
|
1041
1031
|
```ts
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
):
|
|
1032
|
+
ensureMetadataProps(
|
|
1033
|
+
model: OnnxModel,
|
|
1034
|
+
): OnnxMetadataProperty[]
|
|
1045
1035
|
```
|
|
1046
1036
|
|
|
1047
|
-
|
|
1037
|
+
Ensure metadata_props array exists and return it.
|
|
1048
1038
|
|
|
1049
|
-
###
|
|
1039
|
+
### finalizeExportMetadata
|
|
1050
1040
|
|
|
1051
1041
|
```ts
|
|
1052
|
-
|
|
1042
|
+
finalizeExportMetadata(
|
|
1053
1043
|
model: OnnxModel,
|
|
1044
|
+
layers: default[][],
|
|
1045
|
+
options: OnnxExportOptions,
|
|
1046
|
+
includeMetadata: boolean,
|
|
1047
|
+
hiddenSizesMetadata: number[],
|
|
1054
1048
|
recurrentLayerIndices: number[],
|
|
1055
1049
|
): void
|
|
1056
1050
|
```
|
|
1057
1051
|
|
|
1058
|
-
|
|
1052
|
+
Finalize export metadata and optional conv-sharing validation.
|
|
1059
1053
|
|
|
1060
|
-
|
|
1054
|
+
Parameters:
|
|
1055
|
+
- `model` - Target ONNX model.
|
|
1056
|
+
- `layers` - Layered network nodes.
|
|
1057
|
+
- `options` - Export options.
|
|
1058
|
+
- `includeMetadata` - Whether metadata emission is enabled.
|
|
1059
|
+
- `hiddenSizesMetadata` - Hidden-layer sizes collected during emission.
|
|
1060
|
+
- `recurrentLayerIndices` - Recurrent layer indices.
|
|
1061
|
+
|
|
1062
|
+
Returns: Nothing.
|
|
1063
|
+
|
|
1064
|
+
### findMetadataPropertyIndex
|
|
1061
1065
|
|
|
1062
1066
|
```ts
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1067
|
+
findMetadataPropertyIndex(
|
|
1068
|
+
metadataProperties: OnnxMetadataProperty[],
|
|
1069
|
+
key: string,
|
|
1070
|
+
): number
|
|
1066
1071
|
```
|
|
1067
1072
|
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
### validateConvSharingAcrossMappings
|
|
1073
|
+
Find metadata property index by key.
|
|
1071
1074
|
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1075
|
+
### foldRecurrentGateBlocks
|
|
1076
|
+
|
|
1077
|
+
```ts
|
|
1078
|
+
foldRecurrentGateBlocks(
|
|
1079
|
+
gateParameterBlocks: RecurrentGateParameterCollectionResult[],
|
|
1080
|
+
): RecurrentGateParameterCollectionResult
|
|
1076
1081
|
```
|
|
1077
1082
|
|
|
1078
|
-
|
|
1083
|
+
Fold gate blocks into a single fused parameter payload.
|
|
1079
1084
|
|
|
1080
|
-
###
|
|
1085
|
+
### foldRecurrentGateRows
|
|
1081
1086
|
|
|
1082
1087
|
```ts
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
convSpec: Conv2DMapping,
|
|
1087
|
-
): ConvLayerPairContext | undefined
|
|
1088
|
+
foldRecurrentGateRows(
|
|
1089
|
+
gateRows: RecurrentGateRow[],
|
|
1090
|
+
): RecurrentGateParameterCollectionResult
|
|
1088
1091
|
```
|
|
1089
1092
|
|
|
1090
|
-
|
|
1093
|
+
Fold recurrent gate rows into flattened ONNX initializer vectors.
|
|
1091
1094
|
|
|
1092
1095
|
### isConvLayerPairConsistent
|
|
1093
1096
|
|
|
@@ -1099,68 +1102,57 @@ isConvLayerPairConsistent(
|
|
|
1099
1102
|
|
|
1100
1103
|
Validate one Conv layer pair against representative kernel sharing.
|
|
1101
1104
|
|
|
1102
|
-
###
|
|
1103
|
-
|
|
1104
|
-
```ts
|
|
1105
|
-
appendConvLayerValidationResult(
|
|
1106
|
-
result: ConvSharingValidationResult,
|
|
1107
|
-
layerIndex: number,
|
|
1108
|
-
isConsistent: boolean,
|
|
1109
|
-
): void
|
|
1110
|
-
```
|
|
1111
|
-
|
|
1112
|
-
Append one Conv-layer validation outcome and optional warning.
|
|
1113
|
-
|
|
1114
|
-
### appendConvSharingMetadata
|
|
1105
|
+
### isEligibleForGruHeuristic
|
|
1115
1106
|
|
|
1116
1107
|
```ts
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
): void
|
|
1108
|
+
isEligibleForGruHeuristic(
|
|
1109
|
+
currentSize: number,
|
|
1110
|
+
): boolean
|
|
1121
1111
|
```
|
|
1122
1112
|
|
|
1123
|
-
|
|
1113
|
+
Check GRU heuristic eligibility by size and gate divisibility.
|
|
1124
1114
|
|
|
1125
|
-
###
|
|
1115
|
+
### isEligibleForLstmHeuristic
|
|
1126
1116
|
|
|
1127
1117
|
```ts
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
):
|
|
1118
|
+
isEligibleForLstmHeuristic(
|
|
1119
|
+
currentSize: number,
|
|
1120
|
+
): boolean
|
|
1131
1121
|
```
|
|
1132
1122
|
|
|
1133
|
-
|
|
1123
|
+
Check LSTM heuristic eligibility by size and gate divisibility.
|
|
1134
1124
|
|
|
1135
|
-
###
|
|
1125
|
+
### isFallbackRecurrentPatternSize
|
|
1136
1126
|
|
|
1137
1127
|
```ts
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
):
|
|
1128
|
+
isFallbackRecurrentPatternSize(
|
|
1129
|
+
currentSize: number,
|
|
1130
|
+
): boolean
|
|
1141
1131
|
```
|
|
1142
1132
|
|
|
1143
|
-
|
|
1133
|
+
Check whether hidden size should emit recurrent fallback metadata.
|
|
1144
1134
|
|
|
1145
|
-
###
|
|
1135
|
+
### isInputPositionInsideBounds
|
|
1146
1136
|
|
|
1147
1137
|
```ts
|
|
1148
|
-
|
|
1138
|
+
isInputPositionInsideBounds(
|
|
1149
1139
|
convSpec: Conv2DMapping,
|
|
1150
|
-
|
|
1140
|
+
inputRow: number,
|
|
1141
|
+
inputColumn: number,
|
|
1142
|
+
): boolean
|
|
1151
1143
|
```
|
|
1152
1144
|
|
|
1153
|
-
|
|
1145
|
+
Check whether input row/column falls inside Conv input bounds.
|
|
1154
1146
|
|
|
1155
|
-
###
|
|
1147
|
+
### isKernelCoordinateConsistent
|
|
1156
1148
|
|
|
1157
1149
|
```ts
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
):
|
|
1150
|
+
isKernelCoordinateConsistent(
|
|
1151
|
+
context: ConvKernelConsistencyContext,
|
|
1152
|
+
): boolean
|
|
1161
1153
|
```
|
|
1162
1154
|
|
|
1163
|
-
|
|
1155
|
+
Validate one kernel coordinate against its representative channel value.
|
|
1164
1156
|
|
|
1165
1157
|
### isOutputCoordinateConsistent
|
|
1166
1158
|
|
|
@@ -1175,106 +1167,80 @@ isOutputCoordinateConsistent(
|
|
|
1175
1167
|
|
|
1176
1168
|
Validate one output coordinate against channel representative kernel weights.
|
|
1177
1169
|
|
|
1178
|
-
###
|
|
1179
|
-
|
|
1180
|
-
```ts
|
|
1181
|
-
resolveNeuronInternalAtOutputCoordinate(
|
|
1182
|
-
context: ConvLayerPairContext,
|
|
1183
|
-
outputCoordinate: ConvOutputCoordinate,
|
|
1184
|
-
): NodeInternals | undefined
|
|
1185
|
-
```
|
|
1186
|
-
|
|
1187
|
-
Resolve runtime internals for output coordinate neuron, if present.
|
|
1188
|
-
|
|
1189
|
-
### isKernelCoordinateConsistent
|
|
1190
|
-
|
|
1191
|
-
```ts
|
|
1192
|
-
isKernelCoordinateConsistent(
|
|
1193
|
-
context: ConvKernelConsistencyContext,
|
|
1194
|
-
): boolean
|
|
1195
|
-
```
|
|
1196
|
-
|
|
1197
|
-
Validate one kernel coordinate against its representative channel value.
|
|
1198
|
-
|
|
1199
|
-
### resolveInputPosition
|
|
1170
|
+
### parseMetadataLayerIndices
|
|
1200
1171
|
|
|
1201
1172
|
```ts
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
):
|
|
1173
|
+
parseMetadataLayerIndices(
|
|
1174
|
+
metadataValue: string,
|
|
1175
|
+
): number[]
|
|
1205
1176
|
```
|
|
1206
1177
|
|
|
1207
|
-
|
|
1178
|
+
Parse metadata JSON value into a numeric layer-index array.
|
|
1208
1179
|
|
|
1209
|
-
###
|
|
1180
|
+
### resolveConvLayerPairContext
|
|
1210
1181
|
|
|
1211
1182
|
```ts
|
|
1212
|
-
|
|
1183
|
+
resolveConvLayerPairContext(
|
|
1184
|
+
layers: default[][],
|
|
1185
|
+
layerIndex: number,
|
|
1213
1186
|
convSpec: Conv2DMapping,
|
|
1214
|
-
|
|
1215
|
-
inputColumn: number,
|
|
1216
|
-
): boolean
|
|
1187
|
+
): ConvLayerPairContext | undefined
|
|
1217
1188
|
```
|
|
1218
1189
|
|
|
1219
|
-
|
|
1190
|
+
Resolve one Conv mapping layer pair or return undefined for invalid layout.
|
|
1220
1191
|
|
|
1221
|
-
###
|
|
1192
|
+
### resolveGruPreviousOutputName
|
|
1222
1193
|
|
|
1223
1194
|
```ts
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
inChannelIndex: number,
|
|
1228
|
-
inputRow: number,
|
|
1229
|
-
inputColumn: number,
|
|
1230
|
-
): default | undefined
|
|
1195
|
+
resolveGruPreviousOutputName(
|
|
1196
|
+
layerIndex: number,
|
|
1197
|
+
): string
|
|
1231
1198
|
```
|
|
1232
1199
|
|
|
1233
|
-
Resolve
|
|
1200
|
+
Resolve previous output naming semantics for GRU heuristic emission.
|
|
1234
1201
|
|
|
1235
|
-
###
|
|
1202
|
+
### resolveIncomingWeight
|
|
1236
1203
|
|
|
1237
1204
|
```ts
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
representativeInternal: NodeInternals,
|
|
1242
|
-
kernelCoordinate: OnnxConvKernelCoordinate,
|
|
1205
|
+
resolveIncomingWeight(
|
|
1206
|
+
targetNodeInternal: NodeInternals,
|
|
1207
|
+
sourceNode: default,
|
|
1243
1208
|
): number
|
|
1244
1209
|
```
|
|
1245
1210
|
|
|
1246
|
-
|
|
1211
|
+
Resolve incoming connection weight from a specific source node.
|
|
1247
1212
|
|
|
1248
|
-
###
|
|
1213
|
+
### resolveInputPosition
|
|
1249
1214
|
|
|
1250
1215
|
```ts
|
|
1251
|
-
|
|
1252
|
-
context:
|
|
1253
|
-
):
|
|
1216
|
+
resolveInputPosition(
|
|
1217
|
+
context: ConvKernelConsistencyContext,
|
|
1218
|
+
): { inputRow: number; inputColumn: number; }
|
|
1254
1219
|
```
|
|
1255
1220
|
|
|
1256
|
-
|
|
1221
|
+
Resolve input row/column projected by output and kernel coordinates.
|
|
1257
1222
|
|
|
1258
|
-
###
|
|
1223
|
+
### resolveNeuronInternalAtOutputCoordinate
|
|
1259
1224
|
|
|
1260
1225
|
```ts
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1226
|
+
resolveNeuronInternalAtOutputCoordinate(
|
|
1227
|
+
context: ConvLayerPairContext,
|
|
1228
|
+
outputCoordinate: ConvOutputCoordinate,
|
|
1229
|
+
): NodeInternals | undefined
|
|
1264
1230
|
```
|
|
1265
1231
|
|
|
1266
|
-
Resolve runtime
|
|
1232
|
+
Resolve runtime internals for output coordinate neuron, if present.
|
|
1267
1233
|
|
|
1268
|
-
###
|
|
1234
|
+
### resolveRecurrentRowWeight
|
|
1269
1235
|
|
|
1270
1236
|
```ts
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1237
|
+
resolveRecurrentRowWeight(
|
|
1238
|
+
context: RecurrentGateRowCollectionContext,
|
|
1239
|
+
columnIndex: number,
|
|
1274
1240
|
): number
|
|
1275
1241
|
```
|
|
1276
1242
|
|
|
1277
|
-
Resolve
|
|
1243
|
+
Resolve one recurrent row value at the requested column.
|
|
1278
1244
|
|
|
1279
1245
|
### resolveSelfConnectionWeight
|
|
1280
1246
|
|
|
@@ -1286,71 +1252,73 @@ resolveSelfConnectionWeight(
|
|
|
1286
1252
|
|
|
1287
1253
|
Resolve self-connection weight for diagonal recurrent matrix entries.
|
|
1288
1254
|
|
|
1289
|
-
###
|
|
1255
|
+
### resolveSourceNodeAtInputPosition
|
|
1290
1256
|
|
|
1291
1257
|
```ts
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1258
|
+
resolveSourceNodeAtInputPosition(
|
|
1259
|
+
convSpec: Conv2DMapping,
|
|
1260
|
+
previousLayerNodes: default[],
|
|
1261
|
+
inChannelIndex: number,
|
|
1262
|
+
inputRow: number,
|
|
1263
|
+
inputColumn: number,
|
|
1264
|
+
): default | undefined
|
|
1296
1265
|
```
|
|
1297
1266
|
|
|
1298
|
-
|
|
1267
|
+
Resolve source node by Conv input position coordinates.
|
|
1299
1268
|
|
|
1300
|
-
###
|
|
1269
|
+
### shouldValidateConvSharing
|
|
1301
1270
|
|
|
1302
1271
|
```ts
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
): void
|
|
1272
|
+
shouldValidateConvSharing(
|
|
1273
|
+
options: OnnxExportOptions,
|
|
1274
|
+
): boolean
|
|
1307
1275
|
```
|
|
1308
1276
|
|
|
1309
|
-
|
|
1277
|
+
Determine whether Conv2D sharing validation is enabled and configured.
|
|
1310
1278
|
|
|
1311
|
-
###
|
|
1279
|
+
### tryEmitFusedGru
|
|
1312
1280
|
|
|
1313
1281
|
```ts
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
):
|
|
1282
|
+
tryEmitFusedGru(
|
|
1283
|
+
context: HiddenLayerHeuristicContext,
|
|
1284
|
+
): void
|
|
1317
1285
|
```
|
|
1318
1286
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
## architecture/network/onnx/export/network.onnx.export-orchestrators.utils.ts
|
|
1287
|
+
Try emitting heuristic fused GRU node and metadata.
|
|
1322
1288
|
|
|
1323
|
-
###
|
|
1289
|
+
### tryEmitFusedLstm
|
|
1324
1290
|
|
|
1325
1291
|
```ts
|
|
1326
|
-
|
|
1327
|
-
|
|
1292
|
+
tryEmitFusedLstm(
|
|
1293
|
+
context: HiddenLayerHeuristicContext,
|
|
1328
1294
|
): void
|
|
1329
1295
|
```
|
|
1330
1296
|
|
|
1331
|
-
|
|
1297
|
+
Try emitting heuristic fused LSTM node and metadata.
|
|
1332
1298
|
|
|
1333
|
-
|
|
1334
|
-
- `network` - Source network.
|
|
1299
|
+
### upsertLayerIndexMetadataValue
|
|
1335
1300
|
|
|
1336
|
-
|
|
1301
|
+
```ts
|
|
1302
|
+
upsertLayerIndexMetadataValue(
|
|
1303
|
+
metadataProperties: OnnxMetadataProperty[],
|
|
1304
|
+
metadataIndex: number,
|
|
1305
|
+
layerIndex: number,
|
|
1306
|
+
): void
|
|
1307
|
+
```
|
|
1337
1308
|
|
|
1338
|
-
|
|
1309
|
+
Upsert one layer index into metadata array-like JSON value.
|
|
1310
|
+
|
|
1311
|
+
### validateConvSharingAcrossMappings
|
|
1339
1312
|
|
|
1340
1313
|
```ts
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
): LstmPatternStub[]
|
|
1314
|
+
validateConvSharingAcrossMappings(
|
|
1315
|
+
context: ConvSharingValidationContext,
|
|
1316
|
+
): ConvSharingValidationResult
|
|
1345
1317
|
```
|
|
1346
1318
|
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
Parameters:
|
|
1350
|
-
- `layers` - Layered network nodes.
|
|
1351
|
-
- `allowRecurrent` - Whether recurrent export heuristics are enabled.
|
|
1319
|
+
Validate Conv2D sharing across all declared Conv mappings.
|
|
1352
1320
|
|
|
1353
|
-
|
|
1321
|
+
## architecture/network/onnx/export/network.onnx.export-orchestrators.utils.ts
|
|
1354
1322
|
|
|
1355
1323
|
### appendConvInferenceMetadata
|
|
1356
1324
|
|
|
@@ -1388,20 +1356,22 @@ Parameters:
|
|
|
1388
1356
|
|
|
1389
1357
|
Returns: Nothing.
|
|
1390
1358
|
|
|
1391
|
-
###
|
|
1359
|
+
### appendMetadataProperties
|
|
1392
1360
|
|
|
1393
1361
|
```ts
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1362
|
+
appendMetadataProperties(
|
|
1363
|
+
model: OnnxModel,
|
|
1364
|
+
metadataProperties: OnnxMetadataProperty[],
|
|
1365
|
+
): void
|
|
1397
1366
|
```
|
|
1398
1367
|
|
|
1399
|
-
|
|
1368
|
+
Append metadata properties in a single, normalized path.
|
|
1400
1369
|
|
|
1401
1370
|
Parameters:
|
|
1402
|
-
- `
|
|
1371
|
+
- `model` - Target ONNX model.
|
|
1372
|
+
- `metadataProperties` - Metadata properties to append.
|
|
1403
1373
|
|
|
1404
|
-
Returns:
|
|
1374
|
+
Returns: Nothing.
|
|
1405
1375
|
|
|
1406
1376
|
### applyExportNodeIndexAssignments
|
|
1407
1377
|
|
|
@@ -1433,20 +1403,52 @@ Parameters:
|
|
|
1433
1403
|
|
|
1434
1404
|
Returns: Nothing.
|
|
1435
1405
|
|
|
1436
|
-
###
|
|
1406
|
+
### assignExportNodeIndices
|
|
1437
1407
|
|
|
1438
1408
|
```ts
|
|
1439
|
-
|
|
1409
|
+
assignExportNodeIndices(
|
|
1410
|
+
network: default,
|
|
1411
|
+
): void
|
|
1412
|
+
```
|
|
1413
|
+
|
|
1414
|
+
Assign stable index values to nodes for export diagnostics.
|
|
1415
|
+
|
|
1416
|
+
Parameters:
|
|
1417
|
+
- `network` - Source network.
|
|
1418
|
+
|
|
1419
|
+
Returns: Nothing.
|
|
1420
|
+
|
|
1421
|
+
### collectInferredConvMetadata
|
|
1422
|
+
|
|
1423
|
+
```ts
|
|
1424
|
+
collectInferredConvMetadata(
|
|
1425
|
+
context: { layers: default[][]; declaredMappings: Conv2DMapping[] | undefined; },
|
|
1426
|
+
): ConvInferenceResult
|
|
1427
|
+
```
|
|
1428
|
+
|
|
1429
|
+
Collect inferred Conv metadata from hidden-layer traversals.
|
|
1430
|
+
|
|
1431
|
+
Parameters:
|
|
1432
|
+
- `context` - Conv traversal context.
|
|
1433
|
+
|
|
1434
|
+
Returns: Inferred Conv metadata result.
|
|
1435
|
+
|
|
1436
|
+
### collectLstmPatternStubs
|
|
1437
|
+
|
|
1438
|
+
```ts
|
|
1439
|
+
collectLstmPatternStubs(
|
|
1440
1440
|
layers: default[][],
|
|
1441
|
+
allowRecurrent: boolean | undefined,
|
|
1441
1442
|
): LstmPatternStub[]
|
|
1442
1443
|
```
|
|
1443
1444
|
|
|
1444
|
-
Collect LSTM
|
|
1445
|
+
Collect heuristic LSTM grouping stubs from hidden layers.
|
|
1445
1446
|
|
|
1446
1447
|
Parameters:
|
|
1447
1448
|
- `layers` - Layered network nodes.
|
|
1449
|
+
- `allowRecurrent` - Whether recurrent export heuristics are enabled.
|
|
1448
1450
|
|
|
1449
|
-
Returns: LSTM pattern stubs.
|
|
1451
|
+
Returns: Candidate LSTM pattern stubs.
|
|
1450
1452
|
|
|
1451
1453
|
### collectLstmPatternStubsFromLayers
|
|
1452
1454
|
|
|
@@ -1463,6 +1465,51 @@ Parameters:
|
|
|
1463
1465
|
|
|
1464
1466
|
Returns: LSTM pattern stubs.
|
|
1465
1467
|
|
|
1468
|
+
### createConvInferenceEvaluationContext
|
|
1469
|
+
|
|
1470
|
+
```ts
|
|
1471
|
+
createConvInferenceEvaluationContext(
|
|
1472
|
+
traversalContext: ConvInferenceTraversalContext,
|
|
1473
|
+
): ConvInferenceEvaluationContext
|
|
1474
|
+
```
|
|
1475
|
+
|
|
1476
|
+
Create width/square-evaluation context for Conv inference.
|
|
1477
|
+
|
|
1478
|
+
Parameters:
|
|
1479
|
+
- `traversalContext` - Conv traversal context.
|
|
1480
|
+
|
|
1481
|
+
Returns: Conv evaluation context.
|
|
1482
|
+
|
|
1483
|
+
### createConvTraversalContexts
|
|
1484
|
+
|
|
1485
|
+
```ts
|
|
1486
|
+
createConvTraversalContexts(
|
|
1487
|
+
context: { layers: default[][]; declaredMappings: Conv2DMapping[] | undefined; },
|
|
1488
|
+
): ConvInferenceTraversalContext[]
|
|
1489
|
+
```
|
|
1490
|
+
|
|
1491
|
+
Create Conv traversal contexts for hidden layers.
|
|
1492
|
+
|
|
1493
|
+
Parameters:
|
|
1494
|
+
- `context` - Conv traversal source context.
|
|
1495
|
+
|
|
1496
|
+
Returns: Conv traversal contexts.
|
|
1497
|
+
|
|
1498
|
+
### createExportNodeIndexAssignmentContexts
|
|
1499
|
+
|
|
1500
|
+
```ts
|
|
1501
|
+
createExportNodeIndexAssignmentContexts(
|
|
1502
|
+
network: default,
|
|
1503
|
+
): ExportNodeIndexAssignmentContext[]
|
|
1504
|
+
```
|
|
1505
|
+
|
|
1506
|
+
Create node/index assignment contexts for export diagnostics.
|
|
1507
|
+
|
|
1508
|
+
Parameters:
|
|
1509
|
+
- `network` - Source network.
|
|
1510
|
+
|
|
1511
|
+
Returns: Assignment contexts.
|
|
1512
|
+
|
|
1466
1513
|
### createHiddenLayerTraversalContexts
|
|
1467
1514
|
|
|
1468
1515
|
```ts
|
|
@@ -1493,35 +1540,20 @@ Parameters:
|
|
|
1493
1540
|
|
|
1494
1541
|
Returns: LSTM candidate context.
|
|
1495
1542
|
|
|
1496
|
-
###
|
|
1543
|
+
### hasInferredConvMetadata
|
|
1497
1544
|
|
|
1498
1545
|
```ts
|
|
1499
|
-
|
|
1500
|
-
|
|
1546
|
+
hasInferredConvMetadata(
|
|
1547
|
+
inferenceResult: ConvInferenceResult,
|
|
1501
1548
|
): boolean
|
|
1502
1549
|
```
|
|
1503
1550
|
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
Parameters:
|
|
1507
|
-
- `candidateContext` - Candidate context.
|
|
1508
|
-
|
|
1509
|
-
Returns: True when the candidate is a valid LSTM stub.
|
|
1510
|
-
|
|
1511
|
-
### mapLstmCandidateToStub
|
|
1512
|
-
|
|
1513
|
-
```ts
|
|
1514
|
-
mapLstmCandidateToStub(
|
|
1515
|
-
candidateContext: LstmCandidateContext,
|
|
1516
|
-
): LstmPatternStub
|
|
1517
|
-
```
|
|
1518
|
-
|
|
1519
|
-
Map a valid candidate context to metadata stub.
|
|
1551
|
+
Check whether inferred Conv metadata exists.
|
|
1520
1552
|
|
|
1521
1553
|
Parameters:
|
|
1522
|
-
- `
|
|
1554
|
+
- `inferenceResult` - Inferred Conv result.
|
|
1523
1555
|
|
|
1524
|
-
Returns:
|
|
1556
|
+
Returns: True when inferred metadata exists.
|
|
1525
1557
|
|
|
1526
1558
|
### hasRequiredSelfConnectionCount
|
|
1527
1559
|
|
|
@@ -1538,78 +1570,78 @@ Parameters:
|
|
|
1538
1570
|
|
|
1539
1571
|
Returns: True when self-connection count matches requirement.
|
|
1540
1572
|
|
|
1541
|
-
###
|
|
1573
|
+
### isDeclaredConvLayer
|
|
1542
1574
|
|
|
1543
1575
|
```ts
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
):
|
|
1576
|
+
isDeclaredConvLayer(
|
|
1577
|
+
traversalContext: ConvInferenceTraversalContext,
|
|
1578
|
+
): boolean
|
|
1547
1579
|
```
|
|
1548
1580
|
|
|
1549
|
-
|
|
1581
|
+
Check whether a traversal layer already has declared Conv mapping.
|
|
1550
1582
|
|
|
1551
1583
|
Parameters:
|
|
1552
|
-
- `
|
|
1584
|
+
- `traversalContext` - Conv traversal context.
|
|
1553
1585
|
|
|
1554
|
-
Returns:
|
|
1586
|
+
Returns: True when mapping is already declared.
|
|
1555
1587
|
|
|
1556
|
-
###
|
|
1588
|
+
### isInferredConvSpec
|
|
1557
1589
|
|
|
1558
1590
|
```ts
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
):
|
|
1591
|
+
isInferredConvSpec(
|
|
1592
|
+
specification: (Conv2DMapping & { note?: string | undefined; }) | undefined,
|
|
1593
|
+
): boolean
|
|
1562
1594
|
```
|
|
1563
1595
|
|
|
1564
|
-
|
|
1596
|
+
Type guard for inferred Conv specifications.
|
|
1565
1597
|
|
|
1566
1598
|
Parameters:
|
|
1567
|
-
- `
|
|
1599
|
+
- `specification` - Conv specification candidate.
|
|
1568
1600
|
|
|
1569
|
-
Returns:
|
|
1601
|
+
Returns: True when specification is defined.
|
|
1570
1602
|
|
|
1571
|
-
###
|
|
1603
|
+
### isValidLstmCandidateContext
|
|
1572
1604
|
|
|
1573
1605
|
```ts
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
):
|
|
1606
|
+
isValidLstmCandidateContext(
|
|
1607
|
+
candidateContext: LstmCandidateContext,
|
|
1608
|
+
): boolean
|
|
1577
1609
|
```
|
|
1578
1610
|
|
|
1579
|
-
|
|
1611
|
+
Determine whether a candidate context satisfies heuristic LSTM conditions.
|
|
1580
1612
|
|
|
1581
1613
|
Parameters:
|
|
1582
|
-
- `
|
|
1614
|
+
- `candidateContext` - Candidate context.
|
|
1583
1615
|
|
|
1584
|
-
Returns:
|
|
1616
|
+
Returns: True when the candidate is a valid LSTM stub.
|
|
1585
1617
|
|
|
1586
|
-
###
|
|
1618
|
+
### mapLstmCandidateToStub
|
|
1587
1619
|
|
|
1588
1620
|
```ts
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
):
|
|
1621
|
+
mapLstmCandidateToStub(
|
|
1622
|
+
candidateContext: LstmCandidateContext,
|
|
1623
|
+
): LstmPatternStub
|
|
1592
1624
|
```
|
|
1593
1625
|
|
|
1594
|
-
|
|
1626
|
+
Map a valid candidate context to metadata stub.
|
|
1595
1627
|
|
|
1596
1628
|
Parameters:
|
|
1597
|
-
- `
|
|
1629
|
+
- `candidateContext` - Valid candidate context.
|
|
1598
1630
|
|
|
1599
|
-
Returns:
|
|
1631
|
+
Returns: LSTM pattern stub.
|
|
1600
1632
|
|
|
1601
|
-
###
|
|
1633
|
+
### resolveConvInferenceForLayer
|
|
1602
1634
|
|
|
1603
1635
|
```ts
|
|
1604
|
-
|
|
1605
|
-
|
|
1636
|
+
resolveConvInferenceForLayer(
|
|
1637
|
+
traversalContext: ConvInferenceTraversalContext,
|
|
1606
1638
|
): (Conv2DMapping & { note?: string | undefined; }) | undefined
|
|
1607
1639
|
```
|
|
1608
1640
|
|
|
1609
|
-
Resolve Conv specification
|
|
1641
|
+
Resolve inferred Conv specification for one hidden layer.
|
|
1610
1642
|
|
|
1611
1643
|
Parameters:
|
|
1612
|
-
- `
|
|
1644
|
+
- `traversalContext` - Conv traversal context.
|
|
1613
1645
|
|
|
1614
1646
|
Returns: Inferred Conv specification when matched.
|
|
1615
1647
|
|
|
@@ -1628,64 +1660,32 @@ Parameters:
|
|
|
1628
1660
|
|
|
1629
1661
|
Returns: Inferred Conv specification when matched.
|
|
1630
1662
|
|
|
1631
|
-
###
|
|
1632
|
-
|
|
1633
|
-
```ts
|
|
1634
|
-
isDeclaredConvLayer(
|
|
1635
|
-
traversalContext: ConvInferenceTraversalContext,
|
|
1636
|
-
): boolean
|
|
1637
|
-
```
|
|
1638
|
-
|
|
1639
|
-
Check whether a traversal layer already has declared Conv mapping.
|
|
1640
|
-
|
|
1641
|
-
Parameters:
|
|
1642
|
-
- `traversalContext` - Conv traversal context.
|
|
1643
|
-
|
|
1644
|
-
Returns: True when mapping is already declared.
|
|
1645
|
-
|
|
1646
|
-
### isInferredConvSpec
|
|
1647
|
-
|
|
1648
|
-
```ts
|
|
1649
|
-
isInferredConvSpec(
|
|
1650
|
-
specification: (Conv2DMapping & { note?: string | undefined; }) | undefined,
|
|
1651
|
-
): boolean
|
|
1652
|
-
```
|
|
1653
|
-
|
|
1654
|
-
Type guard for inferred Conv specifications.
|
|
1655
|
-
|
|
1656
|
-
Parameters:
|
|
1657
|
-
- `specification` - Conv specification candidate.
|
|
1658
|
-
|
|
1659
|
-
Returns: True when specification is defined.
|
|
1660
|
-
|
|
1661
|
-
### hasInferredConvMetadata
|
|
1663
|
+
### resolveConvSpecFromKernelCandidates
|
|
1662
1664
|
|
|
1663
1665
|
```ts
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
):
|
|
1666
|
+
resolveConvSpecFromKernelCandidates(
|
|
1667
|
+
evaluationContext: ConvInferenceEvaluationContext,
|
|
1668
|
+
): (Conv2DMapping & { note?: string | undefined; }) | undefined
|
|
1667
1669
|
```
|
|
1668
1670
|
|
|
1669
|
-
|
|
1671
|
+
Resolve Conv specification using ordered kernel candidates.
|
|
1670
1672
|
|
|
1671
1673
|
Parameters:
|
|
1672
|
-
- `
|
|
1674
|
+
- `evaluationContext` - Conv evaluation context.
|
|
1673
1675
|
|
|
1674
|
-
Returns:
|
|
1676
|
+
Returns: Inferred Conv specification when matched.
|
|
1675
1677
|
|
|
1676
|
-
###
|
|
1678
|
+
### safelyCollectLstmPatternStubs
|
|
1677
1679
|
|
|
1678
1680
|
```ts
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
): void
|
|
1681
|
+
safelyCollectLstmPatternStubs(
|
|
1682
|
+
layers: default[][],
|
|
1683
|
+
): LstmPatternStub[]
|
|
1683
1684
|
```
|
|
1684
1685
|
|
|
1685
|
-
|
|
1686
|
+
Collect LSTM pattern stubs with heuristic error isolation.
|
|
1686
1687
|
|
|
1687
1688
|
Parameters:
|
|
1688
|
-
- `
|
|
1689
|
-
- `metadataProperties` - Metadata properties to append.
|
|
1689
|
+
- `layers` - Layered network nodes.
|
|
1690
1690
|
|
|
1691
|
-
Returns:
|
|
1691
|
+
Returns: LSTM pattern stubs.
|