Skip to main content
JMari.5
Visitor II
May 6, 2021
Question

Implementation of lambda layer

  • May 6, 2021
  • 1 reply
  • 950 views

Hello

I am trying to implement an RNN which contains a lambda layer. It works perfectly on keras but gives me an error in STM32CubeIDE

I have read in the documentation that it should be possible to implement a lambda layer in the X-CUBE-AI 6.0.0 and followed the advice there but nothing works.

The lambda layer I am trying to implement is:

x2=layers.Lambda(lambda q: q[:, -1])(x)

Which basically takes just one column from another layer.

Do you know how can I implement this layer or maybe a workaround using another kind of trick?

Thanks

    This topic has been closed for replies.

    1 reply

    fauvarque.daniel
    ST Employee
    May 6, 2021

    How to have lambda and custom layers is described in the X-Cube-AI documentation embedded in the package.

    I guess is your case you'll have to provide also the C code.

    The documentation is located on your machine under your home directory, typically here

    file:///C:/Users/xxxx/STM32Cube/Repository/Packs/STMicroelectronics/X-CUBE-AI/6.1.0/Documentation/how_to_do_keras_lambda_custom.html

    Regards

    Daniel