A big part of calculating the error metric such as mean square error (MSE) is initialization and starting a new TensorFlow session. Here is how we proceed with it.
This section provides the requirements for starting a new TensorFlow session used to compute the error metric.
mnist
data is loaded in the environment- The TensorFlow graph for the RBM is loaded
This section provides the steps for optimizing the error using reconstruction from an RBM:
- Initialize the current and previous vector of biases and matrices of weights:
cur_w = tf$Variable(tf$zeros(shape = shape(num_input, num_hidden), dtype=tf$float32)) cur_vb = tf$Variable(tf$zeros(shape = shape(num_input), dtype=tf$float32)) cur_hb = tf$Variable(tf$zeros(shape = shape(num_hidden), dtype=tf$float32)) prv_w = tf$Variable(tf$random_normal(shape=shape(num_input, num_hidden), stddev=0.01, dtype=tf$float32)) prv_vb = tf$Variable(tf$zeros(shape = shape(num_input),...