Beispiel #1
0
X_std = train_data.X_std

valid_data = TIMIT(name='valid',
                   path=data_path,
                   frame_size=frame_size,
                   shuffle=0,
                   use_n_gram=1,
                   X_mean=X_mean,
                   X_std=X_std)

init_W = InitCell('rand')
init_U = InitCell('ortho')
init_b = InitCell('zeros')
init_b_sig = InitCell('const', mean=0.6)

x, x_mask = train_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((15, batch_size, frame_size), dtype=np.float32)
    temp = np.ones((15, batch_size), dtype=np.float32)
    temp[:, -2:] = 0.
    x_mask.tag.test_value = temp

x_1 = FullyConnectedLayer(name='x_1',
                          parent=['x_t'],
                          parent_dim=[frame_size],
                          nout=x2s_dim,
                          unit='relu',
                          init_W=init_W,
                          init_b=init_b)

x_2 = FullyConnectedLayer(name='x_2',
Beispiel #2
0
                  shuffle=0,
                  use_n_gram=1,
                  X_mean=X_mean,
                  X_std=X_std)

exp = unpickle(exp_path + exp_name + '_best.pkl')
nodes = exp.model.nodes
names = [node.name for node in nodes]

output = GaussianLayer(name='output',
                       parent=['theta_mu',
                               'theta_sig'],
                       use_sample=1,
                       nout=frame_size)

x, y, spk_info, mask = train_data.theano_vars()
if debug:
    x.tag.test_value = np.zeros((15, batch_size, frame_size), dtype=np.float32)
    y.tag.test_value = np.zeros((15, batch_size, label_size), dtype=np.float32)
    temp = np.ones((15, batch_size), dtype=np.float32)
    temp[:, -2:] = 0.
    mask.tag.test_value = temp
    spk_info.tag.test_value = np.zeros((batch_size, 630), dtype=np.float32)

[main_lstm, prior, kl,
 x_1, x_2, x_3, x_4,
 z_1, z_2, z_3, z_4,
 y_1, y_2, y_3, y_4,
 phi_1, phi_2, phi_3, phi_4, phi_mu, phi_sig,
 prior_1, prior_2, prior_3, prior_4, prior_mu, prior_sig,
 theta_1, theta_2, theta_3, theta_4, theta_mu, theta_sig] = nodes