1
$\begingroup$

I am trying to make my own custom layer in tensorflow which looks like:

class custom_LSTM(RNN):
    # implementation of class

where RNN is another class.

However, to use this custom layer in model it needs to inherit tf.keras.layers.Layer. I am creating models using tf.keras.

Any idea how do I solve this problem?

$\endgroup$
1
$\begingroup$

Although I'm not an export of RNN's, the following should work given that RNN is inherited from Layer:

from keras.layers import RNN
class custom_LSTM(RNN):
   # implementation of class
   ...

It might be good to provide the smallest piece of code that can reproduce your error.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.