Thursday, November 29, 2018

Notes about Keras custum RNN

There are several limitations of keras.layers.RNN

  1. It can have only one input.
  2. It can have only one output.
  3. The input has to be at least 3D (batch * timesteps * extra_dimensions). This is a slight inconvenience because you can use expand_dims to expand 2D tensor to 3D tensor.
  4. The signature of cell.call() is not same as keras.Model.call(), this make it impossible to use Model as the base for cell. Thus it is very cumbersome to write complex custom cell consisting of many Layers.

No comments: