# Feature Pyramid Network scalar reference

Run `python examples/fpn.py` or append `--json`; no packages required.
Regions: `upsample`, `fusion`, `assignment`. Pinned source: [FPN v2](https://arxiv.org/pdf/1612.03144v2),
§§3–4, Figure 3 and Equation 1. PDF and crop hashes are in the source manifest.

The reference accepts four scalar C2..C5 feature maps. A supplied scalar scale
stands in for each learned 1x1 lateral projection. Top-down nearest resize uses
an explicit target shape and floor-index mapping; lateral and top-down values
are added. A fixed zero-padded 3x3 mean stands in for learned output filters.
Top-down propagation uses the inner merged map, not the smoothed output P map.
Real FPN channels are projected to 256; the scalar example has one channel.

RoIs use floor(4 + log2(sqrt(w\*h)/224)), clipped to P2..P5. The original RPN
additionally uses P6, obtained by stride-two subsampling P5; the Fast R-CNN RoI
assignment here does not use P6. This is not a backbone, RPN, Faster R-CNN,
trained detector, checkpoint output or speed benchmark.
