Repository navigation
Frame generation: CPU reference of both networks' forward pass from a supplied wiring - #179
Merged
Merged
Conversation
… supplied wiring clean/fg/reference/forward.py: each convolution layer from its stage's parameters (from blobs, or from the converter's raw output of the preset-FG map), and a network run as a checked list of steps (conv, pool, upscale, add, concat, slice); net1_forward adds the 2x2 fold and unfold. Undelivered behaviour stays a required argument: the wiring, the storage-to-natural weight view, the border rule, net1 blob 2 (1x1 runs, 2x2 raises OpenItem) and the fold order. The real wiring plugs in as data without changing the layers. Refs #96 Signed-off-by: phantoslayer21 <156617979+phantoslayer21@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CPU reference of both frame-generation networks' forward pass, as far as parts 1–2 and the map define it (lane h). The layers are settled. How they are connected is not delivered yet, so a network runs from a wiring the caller supplies. When the real wiring arrives it is passed in as data, without changing the layers.
clean/fg/reference/forward.pynet1_01..net2_25): storage-order weights and the bias.params_from_blobsbuilds them from blob bytes, viablobs.split_all.params_from_rawreads the converter's--rawoutput of the preset-FG map (stagesdl1.lNN/dl2.lNN, tensorsW_storageandb/b_storage), checking that every value is exact in float16.run_layer: one convolution layer throughops.conv2d(float16 operands, float64 sums, one float16 rounding, optional ReLU).run_graph: runs a list of steps:conv(layer, ReLU flag),pool(kind),upscale(bilinear 2×, align corners),add,concatandslice;net1_forward: the 2×2 fold of the 10 features into 48-value cells, the wiring, then the unfold of 16 values per cell to 4 per pixel.net2_forward: the wiring, returning the named buffers.Required arguments for what is still OPEN (
clean/fg/FORMATS.md):wiring;weight_view: storage to natural[out, k, k, in]. Map v1 gives the weights as stored, and the natural view comes with v1.1.view_by_axescovers a plain axis reorder.pad: the border rule;blob2: "1x1" runs net1's blob 2 as a 1×1 convolution; "2x2" raisesOpenItem, because its stride and channel grouping are not delivered.fold_order.Refs #96
Tested
python -m unittest clean.fg.tests.test_fg_forward: 11 tests pass locally, all on synthetic weights.blob2rule.clean/fgtest set and the line-ending check pass. The public gates pass, with no hits inclean/fg. The branch also merges cleanly with Converter: the delivered preset-FG map, storage order and offset axes #177 and Frame generation: real-file check tool (execute-only, digests and verdict only) #178.Not tested