wai-rs: jpegai_icci — the eICCI network body (conv, BN-fold, residual block, plane path) #14

Merged
dcharlot merged 1 commit from feat/jpegai-icci-net into main 2026-07-15 03:46:58 -04:00

2026-07-15

Transaction Science
wai-rs: jpegai_icci — the eICCI network body (conv, BN-fold, residual block, plane path)
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]>
2026-07-15 03:38:56 -04:00