Beispiel #1
0
import nn_extra_student
from config_rnn import defaults

batch_size = 32
sample_batch_size = 1
n_samples = 4
rng = np.random.RandomState(42)
rng_test = np.random.RandomState(317070)
seq_len = defaults.seq_len

nonlinearity = tf.nn.elu
weight_norm = True

train_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                    batch_size=batch_size,
                                                    set='train',
                                                    rng=rng,
                                                    dataset='fashion_mnist')
test_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                   batch_size=batch_size,
                                                   set='test',
                                                   dataset='fashion_mnist',
                                                   rng=rng_test)

obs_shape = train_data_iter.get_observation_size()  # (seq_len, 28,28,1)
print('obs shape', obs_shape)

ndim = np.prod(obs_shape[1:])
corr_init = np.ones((ndim, ), dtype='float32') * 0.1
nu_init = 1000
Beispiel #2
0
batch_size = 16
sample_batch_size = 1
n_samples = 4
rng = np.random.RandomState(42)
test_rng = np.random.RandomState(317070)
seq_len = defaults.seq_len
eps_corr = defaults.eps_corr
mask_dims = defaults.mask_dims

nonlinearity = tf.nn.elu
weight_norm = True

train_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                    batch_size=batch_size,
                                                    dataset='cifar10',
                                                    set='train',
                                                    rng=rng)
test_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                   batch_size=batch_size,
                                                   dataset='cifar10',
                                                   set='test',
                                                   rng=test_rng)
obs_shape = train_data_iter.get_observation_size()  # (seq_len, 28,28,1)
print('obs shape', obs_shape)

ndim = np.prod(obs_shape[1:])
corr_init = np.ones((ndim, ), dtype='float32') * 0.1

optimizer = 'rmsprop'
learning_rate = 0.001
Beispiel #3
0
from config_rnn import defaults

batch_size = 64
sample_batch_size = 1
n_samples = 4
rng = np.random.RandomState(42)
rng_test = np.random.RandomState(317070)
seq_len = defaults.seq_len
eps_corr = defaults.eps_corr
mask_dims = defaults.mask_dims

nonlinearity = tf.nn.elu
weight_norm = True

train_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                    batch_size=batch_size,
                                                    set='train',
                                                    rng=rng)
test_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                   batch_size=batch_size,
                                                   set='test',
                                                   rng=rng_test)

valid_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len,
                                                    batch_size=batch_size,
                                                    set='test',
                                                    rng=rng)

test_data_iter2 = data_iter.BaseTestBatchSeqDataIterator(seq_len=seq_len,
                                                         set='test',
                                                         rng=rng)
Beispiel #4
0
import nn_extra_student
from config_rnn import defaults

batch_size = 32
sample_batch_size = 1
n_samples = 4
rng = np.random.RandomState(42)
rng_test = np.random.RandomState(317070)
seq_len = defaults.seq_len
eps_corr = defaults.eps_corr
mask_dims = defaults.mask_dims

nonlinearity = tf.nn.elu
weight_norm = True

train_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len, batch_size=batch_size,
                                                    set='train', rng=rng, digits=[0, 2, 4, 6, 8])
test_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len, batch_size=batch_size, set='test',
                                                   digits=[1, 3, 5, 7, 9], rng=rng_test)

valid_data_iter = data_iter.BaseExchSeqDataIterator(seq_len=seq_len, batch_size=batch_size,
                                                    set='test', rng=rng_test, digits=[0, 2, 4, 6, 8])

test_data_iter2 = data_iter.BaseTestBatchSeqDataIterator(seq_len=seq_len,
                                                         set='test',
                                                         rng=rng_test,
                                                         digits=[1, 3, 5, 7, 9])

obs_shape = train_data_iter.get_observation_size()  # (seq_len, 28,28,1)
print('obs shape', obs_shape)

ndim = np.prod(obs_shape[1:])