Pooling operator bounds #
This file provides simple interval-bound-propagation (IBP) transfer rules for 2D max/average pooling. These rules are used by the graph-level CROWN/LiRPA development when a model contains pooling operators.
References #
- IBP: Gowal et al., On the Effectiveness of Interval Bound Propagation for Training Verifiably Robust Models, 2018. (arXiv:1810.12715)
- CROWN: Zhang et al., Efficient Neural Network Robustness Certification with General Activation Functions, NeurIPS 2018. (arXiv:1811.00866)
- auto_LiRPA: Xu et al., Automatic Perturbation Analysis for Scalable Certified Robustness and Beyond, NeurIPS 2020. (arXiv:2002.12920)
Compute output dimensions for pooling
Instances For
Max Pooling IBP #
For max pooling, the interval bounds are:
- Lower bound: max of all lower bounds in the window
- Upper bound: max of all upper bounds in the window
We use Numbers.neg_thousand as a practical lower bound for initialization
since the Context typeclass doesn't provide negative infinity.
Get element from 2D tensor with bounds checking, returns default if out of bounds
Instances For
IBP for MaxPool2D on a single channel 2D input. Input shape: (H, W), Output shape: (outH, outW)
Instances For
Average Pooling IBP #
For average pooling, the interval bounds are:
- Lower bound: average of all lower bounds in the window
- Upper bound: average of all upper bounds in the window
IBP for AvgPool2D on a single channel 2D input.
Instances For
Global Pooling #
Global max/average pooling reduces entire spatial dimensions to a single value.
Get element from 3D tensor (C, H, W)
Instances For
IBP for Global Average Pooling
Instances For
IBP for Global Max Pooling