duck_mopsi
duck_mopsi t1_j6ibwq0 wrote
Reply to [D] Simple Questions Thread by AutoModerator
I am trying to create a GAN with RNNs. Therefore I'm trying to create stacked GRU-Cells which get fed the random input. I implemented it as follows:
def build_generator():
inputs = keras.Input(shape=[LATENT_SHAPE])
cell = keras.layers.StackedRNNCells([keras.layers.GRUCell(64, activation = 'tanh') for _ in range(7)])
rnn = keras.layers.RNN(cell, return_sequences=True)
x = rnn(inputs)
return keras.models.Model(inputs, x)
However everytime I try to call the method, I do get the following error:
I have found basically the same implementation for StackedRNNCells in the second to newest push from TimeGAN. Yet for me I get the error, I don't know how to fix.
duck_mopsi t1_j6iksqy wrote
Reply to comment by duck_mopsi in [D] Simple Questions Thread by AutoModerator
Welp, it seemed like the problem was, that the inputs need to be defined as 2-dimensional with the sequence length as the first parameter. I thought one would give the RNN only 1 dimension of latent noise and get the sequence through reiterating it trough the RNN.