Menu

I added dilation to Burn's average pooling by copying max pooling
📰

I added dilation to Burn's average pooling by copying max pooling

DEV Community: rust·Ashok Ram·11 days ago
#tdfYGk3X
#devtorust#devto#dev#dilation#pooling
Long article (631 words) — no AI summary yet.
Reading 0:00
15s threshold

An ONNX model with dilated average pooling could load into Burn and give wrong numbers without a single error. The 2D import just dropped the dilation.

antimora opened issue #6148 to fix that at the source, and I added the missing option in tracel-ai/burn#6235 . The trick was not inventing anything new.

Two quick definitions

Burn is a Rust framework for building and training neural networks. Pooling shrinks a grid of numbers (a tensor) by sliding a small window over it and keeping one value per spot: the max, or the average.

Dilation puts gaps in that window. A 2 by 2 window with dilation 2 reads four cells spaced two apart, like jumping two squares at a time on a chessboard, so it spans a 3 by 3 area. ONNX, the common format for sharing trained models, has supported dilation on AveragePool since opset 19. Burn's max pooling had it.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.