pg020196 / Neural-Network-Translator

This repository contains a neural network translator which can translate neural network models to native code.
MIT License
8 stars 4 forks source link

Check assignment of variables in backend #107

Closed pg020196 closed 4 years ago

pg020196 commented 4 years ago

The attached neural was created with the following parameters:
model.add(keras.layers.AveragePooling2D(pool_size=(2,1), strides=(2,1),padding='valid', input_shape = (5,3,1)))
When translating this neural network it seems like the dimensions get mixed up. The following table shows the actual values compared to the values I expected:

Variable in .h-file Expected Actual
POOL_HEIGHT {2} {1}
POOL_WIDTH {1} {2}
VERTICAL_STRIDE {2} {1}
HORIZONTAL_STRIDE {1} {2}
LAYER_OUTPUT_WIDTH {3,3} {3,3}
LAYER_OUTPUT_HEIGHT {5,2} {5,2}

As far as I understand the values of POOL_HEIGHT and POOLWIDTH are somehow swapped by the backend. Same thing goes for VERTICAL and HORIZONAL_STRIDE.

pg020196 commented 4 years ago

avg_pool_2d.zip