flags.DEFINE_float('dropout', 1, 'Dropout parameter.') assert FLAGS.dataset in ['mnist', 'cifar10', 'custom'] assert FLAGS.opt in ['gradient_descent', 'ada_grad', 'momentum', 'adam'] if __name__ == '__main__': utilities.random_seed_np_tf(FLAGS.seed) if FLAGS.dataset == 'mnist': # ################# # # MNIST Dataset # # ################# # trX, trY, vlX, vlY, teX, teY = datasets.load_mnist_dataset( mode='supervised') elif FLAGS.dataset == 'cifar10': # ################### # # Cifar10 Dataset # # ################### # trX, trY, teX, teY = datasets.load_cifar10_dataset(FLAGS.cifar_dir, mode='supervised') vlX = teX[:5000] # Validation set is the first half of the test set vlY = teY[:5000] elif FLAGS.dataset == 'custom': # ################## #
flags.DEFINE_integer('transform_gibbs_sampling_steps', 10, 'Gibbs sampling steps for the transformation of data.') assert FLAGS.dataset in ['mnist', 'cifar10', 'custom'] assert FLAGS.cifar_dir != '' if FLAGS.dataset == 'cifar10' else True assert FLAGS.visible_unit_type in ['bin', 'gauss'] if __name__ == '__main__': if FLAGS.dataset == 'mnist': # ################# # # MNIST Dataset # # ################# # trX, vlX, teX = datasets.load_mnist_dataset(mode='unsupervised') width, height = 28, 28 elif FLAGS.dataset == 'cifar10': # ################### # # Cifar10 Dataset # # ################### # trX, teX = datasets.load_cifar10_dataset(FLAGS.cifar_dir, mode='unsupervised') vlX = teX[:5000] # Validation set is the first half of the test set width, height = 32, 32 elif FLAGS.dataset == 'custom':