cancel
Showing results for 
Search instead for 
Did you mean: 

X-CUBE-AI: Skip custom layer

MFise.1
Associate

X-CUBE-Ai offers ways to implement custom layers via a custom layer json file. The documentation is a little vague on what operations can be used in the "op" field.

Concretely I would like to simply just skip some of the custom layers in my model, since they are purely relevant for training (like Dropout). What would be the simplest way to get CUBE-AI to skip a custom layer just like it does for Dropout, without introducing any unnecessary operations?

3 REPLIES 3
Sara BEN HADJ YAHYA
ST Employee

Hello @MFise.1​ ,

Could you please specify the softwares versions? and if possible share your .ioc file

Regards,

Sara.

MFise.1
Associate

Hi Sara,

thank you for your response. I'm using CubeMX 6.4.0 and X-CUBE-AI 7.0.0. I'm trying to load a tf.keras model stored in in hdf5 format. This model contains custom layers that are only relevant during training and should be skipped during normal execution, just like Dropout layers. I know X-CUBE-AI automatically skips dropout layers during import and I wondered if there is a simple way to enable this behaviour for my own layer. I know that custom layers can now be implemented using python and c, but I would really just like for that layer to be ignored when imported in X-CUBE-AI. Is there a simple way to achieve this behaviour, without having to modify my model?

Sara BEN HADJ YAHYA
ST Employee

Hello @MFise.1​ ,

Could you please clarify this for me: Are you looking for a way to set the training argument in call() of a custom layer to False or True using CubeMX?

Regards,

Sara.