# Neural Network Pooling Functions

CMSIS-NN: Neural Network Pooling Functions

| CMSIS-NN Version 1.1.0 CMSIS NN Software Library

- Main Page
- Usage and Description
- Reference

All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Macros Groups Pages
Functions
Neural Network Pooling Functions
Neural Network Functions

## Functions

void | arm_maxpool_q7_HWC (q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out)
| Q7 max pooling function. More...
void | arm_avepool_q7_HWC (q7_t *Im_in, const uint16_t dim_im_in, const uint16_t ch_im_in, const uint16_t dim_kernel, const uint16_t padding, const uint16_t stride, const uint16_t dim_im_out, q7_t *bufferA, q7_t *Im_out)
| Q7 average pooling function. More...

## Description

Perform pooling functions, including max pooling and average pooling

## Function Documentation

void arm_avepool_q7_HWC | ( | q7_t * | Im_in,
|  | const uint16_t | dim_im_in,
|  | const uint16_t | ch_im_in,
|  | const uint16_t | dim_kernel,
|  | const uint16_t | padding,
|  | const uint16_t | stride,
|  | const uint16_t | dim_im_out,
|  | q7_t * | bufferA,
|  | q7_t * | Im_out
| ) |  |

Parameters

  [in,out] | Im_in | pointer to input tensor
  [in] | dim_im_in | input tensor dimention
  [in] | ch_im_in | number of input tensor channels
  [in] | dim_kernel | filter kernel size
  [in] | padding | padding sizes
  [in] | stride | convolution stride
  [in] | dim_im_out | output tensor dimension
  [in,out] | bufferA | pointer to buffer space for input
  [in,out] | Im_out | pointer to output tensor

Returns
  none.

Buffer size:

bufferA size: 2*dim_im_out*ch_im_in

The pooling function is implemented as split x-pooling then y-pooling.

This pooling function is input-destructive. Input data is undefined after calling this function.

References arm_q7_to_q15_no_shift().

void arm_maxpool_q7_HWC | ( | q7_t * | Im_in,
|  | const uint16_t | dim_im_in,
|  | const uint16_t | ch_im_in,
|  | const uint16_t | dim_kernel,
|  | const uint16_t | padding,
|  | const uint16_t | stride,
|  | const uint16_t | dim_im_out,
|  | q7_t * | bufferA,
|  | q7_t * | Im_out
| ) |  |

Parameters

  [in,out] | Im_in | pointer to input tensor
  [in] | dim_im_in | input tensor dimention
  [in] | ch_im_in | number of input tensor channels
  [in] | dim_kernel | filter kernel size
  [in] | padding | padding sizes
  [in] | stride | convolution stride
  [in] | dim_im_out | output tensor dimension
  [in,out] | bufferA | pointer to buffer space for input
  [in,out] | Im_out | pointer to output tensor

Returns
  none.

Buffer size:

bufferA size: 0

The pooling function is implemented as split x-pooling then y-pooling.

This pooling function is input-destructive. Input data is undefined after calling this function.

Referenced by main().