In [1]:
%matplotlib inline
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as plt
from theano_toolkit.parameters import Parameters
import theano
import model
In [2]:
P = Parameters()
_,sample = model.build(P,"vrnn")
f = theano.function(inputs=[],outputs=sample())
In [3]:
P.load('model.pkl')
In [26]:
data = f()
data = data.reshape(data.shape[0] * data.shape[2])
plt.figure(figsize=(10,5))
plt.plot(data)
Out[26]:
In [24]:
import scipy.io.wavfile as wavfile
#print (45 * data).astype(np.)
wavfile.write('outfile.wav',16000,data)