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

Intermediate format missing input layer making some layer types unusable as first layer #142

Open TerrestrialEclipse opened 3 years ago

TerrestrialEclipse commented 3 years ago

Currently the keras frontend is intentionally removing the input layer as it didn't provide any required attributes for the tested networks.

grafik

However, some layer types, e.g., AveragePooling2D, don't expose the batch_input_shape parameter leading to missing shape information of the expected input tensor (when using these types of layers as the first layer).

This could e.g. be resolved by incorporating the input layer into the intermediate format. This would probably require additional changes in the GCC backend.

pg020196 commented 3 years ago

Hi @TerrestrialEclipse, thank you for contributing to the project and sorry for my delayed response. I agree with your idea of incorporating the input layer into the intermediate format. This should not be to hard since the intermediate format can contain any values as long as they follow the specified key structure.

This change would result in adjustments in the keras frontend as well as the gcc backend (and the utils class), I think. I can look into that but due to other projects I'm working on I will have to delay this to the end of october, I think. Does this affect your fork and does this fit to your schedule? Let me know and we will figure things out!

TerrestrialEclipse commented 3 years ago

Hi @pg020196

Thanks for your response. My fork would have to be slightly adapted. I will adapt the c_sharp backend once the intermediate format is adapted.

pg020196 commented 3 years ago

Hi @TerrestrialEclipse, since you had a very fast pace at implementing the C# backend, I will try to resolve this issue as fast as possible. I'll let you know as soon as I am ready!