I am trying to create a 2-layer simple RNN model with Keras in which I can directly feed data into the first layer. As I understand it, cells in an RNN are fully connected with their input with the standard Keras layer. For example, if I define an input with 4 features and 1 timestep, connected to a SimpleRNN with 4 cells as follows:
I will get 32 trainable params which makes sense. There are 4x4 recurrent connections in the SimpleRNN, and 4x4 connections between the input and the 4 RNN cells, so we get 32 trainable params (ignoring bias terms).
However, I would like to structure my network so that each input feature is connected to only one cell in the RNN, as in the diagram below:
Is there a neat way to implement this in Keras? Any way to remove specific connections between layers?
Thanks!
Andrew