std :: ml::convnet
Macro RESIZE_NEAREST
#define RESIZE_NEAREST 0To any outH x outW (up or down), as PyTorch's interpolate(size=...):
RESIZE_NEAREST source floor(o * in / out) ('nearest'; alignCorners ignored)
RESIZE_BILINEAR the four nearest pixels
RESIZE_BICUBIC the sixteen nearest, cubic convolution with a = -0.75
alignCorners maps the corner pixels' centres onto each other (source o * (in - 1) / (out - 1)); otherwise pixel areas line up (source (o + 0.5) * in / out - 0.5, clamped at 0 for bilinear). Edges are clamped. Gradients scatter back with the same weights.