Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created March 26, 2020 21:30
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
import random
ind = np.random.randint(0,len(x_val)-1)
random_music = x_val[ind]
predictions=[]
for i in range(10):
random_music = random_music.reshape(1,no_of_timesteps)
prob = model.predict(random_music)[0]
y_pred= np.argmax(prob,axis=0)
predictions.append(y_pred)
random_music = np.insert(random_music[0],len(random_music[0]),y_pred)
random_music = random_music[1:]
print(predictions)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment