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


Couldn't import dot_parser, loading of dot files will not be possible.

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]:
[<matplotlib.lines.Line2D at 0x7efe7eb6fa10>]

In [24]:
import scipy.io.wavfile as wavfile
#print (45 * data).astype(np.)
wavfile.write('outfile.wav',16000,data)