Following this article, I\'m trying to implement a generative RNN. In the mentioned article, the training and validation data are passed as fully loaded np.array
Since your model has two inputs and one output, the generator should return a tuple with two elements where the first element is a list containing two arrays, which corresponds to two input layers, and the second element is an array corresponding to output layer:
def generator():
...
yield [input_samples1, input_samples2], targets
Generally, in a model with M
inputs and N
outputs, the generator should return a tuple of two lists where the first one has M
arrays and the second one has N
arrays:
def generator():
...
yield [in1, in2, ..., inM], [out1, out2, ..., outN]
If instead of a Python generator, an instance of Sequence
class is used to generate data, the format is the same with the only difference that you would use return
instead of yield
in the __getitem__
method.