Reputation: 459
I am trying to plot in a scatter format some data I have predicted with the decoder of a VAE I've developed.
This might be very basic. However, I would like to know how should I plot the array I've predicted with a scatterplot.
new_data = vae.decoder.predict(np.random.normal(0,1,size=(1, latent_dim, 1)))
array([[[0.4776226 ],
[0.47153735],
[0.4817254 ],
[0.48054865],
[0.45594737],
[0.48623624],
[0.47953185],
[0.47151 ],
[0.4822226 ],
[0.46702865],
[0.50809085]]], dtype=float32)
I am using this question. However when I do: df = pd.DataFrame(new_data)
I get: ValueError: Must pass 2-d input. shape=(1, 11, 1)
Which is the proper way to plot this using Seaborn?
Upvotes: 0
Views: 52
Reputation: 945
Your data is currently a 3d array and it requires a 2d array, so you will need to reshape your array:
new_data = vae.decoder.predict(np.random.normal(0,1,size=(1, latent_dim, 1)))
reshaped_data = new_data.reshape((1, 11))
Upvotes: 1