Esempio n. 1
0
                          padding='pre',
                          truncating='pre')
rnn_output = pad_sequences(rnn_output,
                           maxlen=30,
                           dtype='float32',
                           padding='pre',
                           truncating='pre')

# print(rnn_input.shape)
# print(rnn_output.shape)
true = rnn_output[episode][frame]
print("The true value is: ")
print(true)

# print(rnn_input[episode][frame])
predict = rnn.get_output(np.expand_dims([rnn_input[episode][frame]], 0))
print("The prediction is: ")
print(predict)

plt.subplot(1, 2, 1)
true = true.reshape(1, 32)
true = vae.get_output(true)
true = true.reshape(48, 64, 3)[:, :, ::-1]  # convert bgr to rgb format
plt.imshow(
    true
)  # The rgb values should be in the range [0 .. 1] for floats or [0 .. 255] for integers.
plt.title('Original')

plt.subplot(1, 2, 2)
predict = np.array(predict)
predict = predict.reshape(1, 32)