wai-rs: jpegai_icci — the eICCI network body (conv, BN-fold, residual block, plane path) #14
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/jpegai-icci-net"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Second piece of eICCI. The reference network is float, so this runs in f32 rather than quantising: IEEE-754 with a fixed accumulation order is deterministic across machines, so a faithful float port is byte-identical and carries no PTQ error — no quantise/calibrate loop is needed for this filter.
Conv— stride-1 zero-padded conv; covers the 3x3 stem and the separable [1,3]/[3,1] block kernelsConv::fold_bn— folds BatchNorm into the conv, exact at inference:(w·γ/√(σ²+ε))·x + ((b−μ)·γ/√(σ²+ε) + β)ResBlock—x + scale·BN2(conv2_3x1(relu(BN1(conv1_1x3(x)))))IcciPath—relu(BN(conv_first(yuv48))) → resblocks → conv_last → out·scale + subbands16 → idwt2Unit tests: identity conv + edge zero-padding,
fold_bnvs an explicit BatchNorm, and the residual block (scale=0 → identity; scale=1 + identity convs → adds relu(x)).Remaining for eICCI: the 20 models float weights from ONNX, and the per-tile model selection.
Second piece of eICCI. The reference network is float, so this runs in f32 rather than quantising: IEEE-754 add/mul with a fixed accumulation order is deterministic across machines, so a faithful float port is byte-identical AND carries no PTQ error — no quantise/calibrate loop is needed for this filter. Conv stride-1 zero-padded conv, [cout,cin,kh,kw]; supports the 3x3 stem and the separable [1,3] / [3,1] block kernels Conv::fold_bn folds BatchNorm into the preceding conv (exact at inference): BN(conv(x)) = (w·γ/√(σ²+ε))·x + ((b−μ)·γ/√(σ²+ε) + β) ResBlock x + scale · BN2(conv2_3x1(relu(BN1(conv1_1x3(x))))) [BNs folded] IcciPath relu(BN(conv_first(yuv48))) -> N residual blocks -> conv_last -> out·scale + subbands16 -> idwt2 -> plane Unit tests: identity conv + zero-padding at the edge, fold_bn matching an explicit BatchNorm, and the residual block (scale=0 is the identity; scale=1 with identity convs adds relu(x) back). Remaining for eICCI: load the 20 models' float weights from the ONNX, and the per-tile model selection. Co-Authored-By: Claude Opus 4.8 <[email protected]>dcharlot referenced this pull request2026-11-06 13:54:17 -05:00