Skip to main content
MFise.1
Associate
November 26, 2021
Question

X-CUBE-AI: Skip custom layer

  • November 26, 2021
  • 3 replies
  • 1473 views

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?

This topic has been closed for replies.

3 replies

ST Employee
November 29, 2021

Hello @MFise.1​ ,

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

Regards,

Sara.

MFise.1
MFise.1Author
Associate
November 29, 2021

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?

ST Employee
November 30, 2021

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.