public static INDArray pooling2D ( INDArray img , int kh , int kw , int sy , int sx , int ph , int pw , int dh , int dw , boolean isSameMode , Pooling2D . Pooling2DType type , Pooling2D . Divisor divisor , double extra , int virtualHeight , int virtualWidth , INDArray out ) { Pooling2D pooling = Pooling2D . builder ( ) . arrayInputs ( new INDArray [ ] { img } ) . arrayOutputs ( new INDArray [ ] { out } ) . config ( Pooling2DConfig . builder ( ) . dh ( dh ) . dw ( dw ) . extra ( extra ) . kh ( kh ) . kw ( kw ) . ph ( ph ) . pw ( pw ) . isSameMode ( isSameMode ) . sx ( sx ) . sy ( sy ) . virtualHeight ( virtualHeight ) . virtualWidth ( virtualWidth ) . type ( type ) . divisor ( divisor ) . build ( ) ) . build ( ) ; Nd4j . getExecutioner ( ) . exec ( pooling ) ; return out ; }
Pooling 2d implementation