ARM-software / CMSIS_5

CMSIS Version 5 Development Repository
http://arm-software.github.io/CMSIS_5/index.html
Apache License 2.0
1.33k stars 1.08k forks source link

AvgPool in a q15_t model #966

Closed dtch1997 closed 4 years ago

dtch1997 commented 4 years ago

I am following this tutorial to convert my ONNX model to CMSIS-NN.

I would like to have my whole model work in q15. However I noticed there is no arm_avgpool that works with q15 input and no data conversion function to convert q15 to q7 to use arm_avgpool_q7_HWC. How should I convert the q15 input to a q7 that can be fed into this layer?

christophe0606 commented 4 years ago

@dtch1997 In the CMSIS-DSP, you'll find a arm_q15_to_q7 function But you'll lose some accuracy by doing it so it is not the ideal solution.

dtch1997 commented 4 years ago

@christophe0606 thanks. It seems odd that there is no in-built q15 average pooling solution. Perhaps that could be a useful feature in the future.