In [1]:
%pylab inline
import pylab as plt
import numpy as np
import cPickle as pkl
# check pretraining progress
model = 'model_un16_bpe2k_uni_en-zh.npz.current'
config = pkl.load(open('.pretraining/{}.pkl'.format(model)))
for c in config:
print '{}: {}'.format(c, config[c])
data = np.load('.pretraining/{}.npz'.format(model))
error = data['history_errs']
plt.plot(error)
plt.xlabel('Iterations (x 1000)')
plt.ylabel('Valid Error')
plt.show()
In [2]:
%pylab inline
import pylab as plt
import numpy as np
import cPickle as pkl
# check pretraining progress
model = 'model_un16_bpe2k_uni_zh-en.npz.current'
config = pkl.load(open('.pretraining/{}.pkl'.format(model)))
for c in config:
print '{}: {}'.format(c, config[c])
data = np.load('.pretraining/{}.npz'.format(model))
error = data['history_errs']
plt.plot(error)
plt.xlabel('Iterations (x 1000)')
plt.ylabel('Valid Error')
plt.show()
In [10]:
import itertools
a = [1, 2, 3, 4]
b = list(itertools.chain.from_iterable(itertools.repeat(x, 4) for x in a))
print b
In [13]:
c = a + b
In [14]:
c[:] = [1,2,3]
In [15]:
c
Out[15]:
In [ ]: