How to do it...

This section covers the steps to perform backward reconstruction and evaluation:

  1. The backward image reconstruction can be performed using the input probability vector with the following script:
prob_v1 = tf$nn$sigmoid(tf$matmul(h0, tf$transpose(W)) + vb)
v1 = tf$nn$relu(tf$sign(prob_v1 - tf$random_uniform(tf$shape(prob_v1))))
h1 = tf$nn$sigmoid(tf$matmul(v1, W) + hb)
  1. The evaluation can be performed using a defined metric, such as mean squared error (MSE), which is computed between the actual input data (X) and the reconstructed input data (v1). The MSE is computed after each epoch and the key objective is to minimize the MSE:
err = tf$reduce_mean(tf$square(X - v1)) 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset