Classifying the NotMNIST dataset with a DBN
Let's look at the NotMNIST dataset, which we explored in Chapter 2, Deep Feedforward Networks, in the Implementing feedforward networks section with images, and see how our DBN works for that dataset.
We will leverage the same pickle file, notMNIST.pickle
, created in Chapter 2, Deep Feedforward Networks. The initialization parameters and imports are listed here:
import tensorflow as tf import numpy as np import cPickle as pickle from common.models.boltzmann import dbn from common.utils import datasets, utilities flags = tf.app.flags FLAGS = flags.FLAGS pickle_file = '../notMNIST.pickle' image_size = 28 num_of_labels = 10 RELU = 'RELU' RELU6 = 'RELU6' CRELU = 'CRELU' SIGMOID = 'SIGMOID' ELU = 'ELU' SOFTPLUS = 'SOFTPLUS'
Implementation remains more or less similar to the MNIST dataset. The main implementation listing is given here:
if __name__ == '__main__': utilities.random_seed_np_tf(-1) with open(pickle_file, 'rb') as f: save...