Basically my system is like this
- 4 array input and return 1 array output
- each array is consists of 12 numbers
my model is here below
n_hidden = 512
input_shape = 12
input_len = 4
model = Sequential()
model.add(SimpleRNN(n_hidden, input_shape=(input_len, input_shape), return_sequences=False))
model.add(Dense(n_hidden, activation="linear"))
model.add(Dense(input_shape, activation="linear"))
opt = Adam(lr=0.001)
model.compile(loss='mse', optimizer=opt)
model.summary()
prediction code.
in_ = basicdata[0].x[:1]
# in_.shape = (1,4,12)
predicted = []
NUM_DATA = 100
cnt = 0
for i in range(NUM_DATA):
out_ = model.predict(in_)
#it returns only 1 answer.
#out_.shape = (1, 12)
in_ = np.concatenate((in_.reshape(input_shape, input_len)[1:], out_), axis=0).reshape(1, input_shape,input_len)
if cnt == 0:
predicted = out_
else:
predicted = np.concatenate([predicted,out_],axis=0)
cnt = cnt + 1
In this case , model.predict accepts (1,4,12) and returns the one array (1, 12) but,
I want to get (10,12) multiple candidate to sample from.
I guess return_sequences and batch_size of simpleRNN are related but still in vague.
In my understanding.
return_sequences
return_sequences = False
A,B,C,D => (E)
return_sequences = True
A,B,C,D => (A,B,C,D,E)
I want to have like this below
A,B,C,D => (E1,E2,E3,E4,E5)
batch_size
batch_size affect the input shape though,
I want to change the output.