ℝ→Float32 bridge: global average pooling #
The float global-average-pool gapFlatF and its budget gapFlat_close: GAP is a
per-channel mean (globalAvgPoolFlat_eq_bnMean), so gapFlat_close reduces to
bnMean_close on the channel slice (sum_finProdFinEquiv flattens the spatial double sum).
The other ResNet-34 ops' float lemmas are elsewhere: the residual add is add_close
(FloatBridge), the conv is flatConvF_close (ConvFloat), per-channel BN is
bnForward_close_of (BnFloatBridge), and the FloatClose instances are in
FloatComposeBridge.
The float global-average-pool: per channel, the float mean of the channel's
h·w spatial slice (rounded sum, rounded /(h·w)). The float peer of
globalAvgPoolFlat.
Equations
- M.gapFlatF v ci = M.div (M.sum fun (s : Fin (h * w)) => Proofs.Tensor3.unflatten v ci (finProdFinEquiv.symm s).1 (finProdFinEquiv.symm s).2) ↑(h * w)
Instances For
Global-average-pool closeness. GAP is the per-channel spatial mean, so the
float GAP is within the bnMean_close budget of globalAvgPoolFlat per
channel (sum_finProdFinEquiv flattens the spatial double sum to the Fin (h·w) slice the
mean rounds).
GAP as a per-channel bnMean. globalAvgPoolFlat c h w v ci is the mean of
channel ci's spatial slice — bnMean (h·w) of the Fin (h·w)-indexed gather.
The reduction gapFlat_close performs inline, exposed so the float-bridge
magnitude/input-shift bounds (bnMean_abs_le / bnMean_input_close) apply.