def test():
model.load("music.tflearn")
X = fft_sequences[10].reshape([1, num_history, fft_stored_size])
X = np.random.uniform(low=-0.1, high=0.1, size=[1, num_history, fft_stored_size])
num_test = 10
output = np.zeros([num_test, num_history, fft_stored_size])
for test_i in range(num_test):
Y = np.array(model.predict(X)[0])
output[test_i] = Y.reshape([num_history, fft_stored_size])
X = Y.reshape([1, num_history, fft_stored_size])
X[np.where(np.square(X) < 0.0001)] = 0.0
#X *= 1.5
#raw test
#output[test_i] = fft_next[test_i]
#print(output[test_i])
wav = convert(output)
print("wav: " + str(wav.shape))
wavfile.write("test.wav", 8000, wav)
评论列表
文章目录