How to do it...

This section provides the steps to set up the visible and hidden layers of an RBM using TensorFlow:

  1. Start a new interactive TensorFlow session:
# Reset the graph 
tf$reset_default_graph()
# Starting session as interactive session
sess <- tf$InteractiveSession()
  1. Define the model parameters. The num_input parameter defines the number of nodes in the visible layer and num_hidden defines the number of nodes in the hidden layer:
num_input<-784L 
num_hidden<-900L
  1. Create a placeholder variable for the weight matrix:
W <- tf$placeholder(tf$float32, shape = shape(num_input, num_hidden)) 
  1. Create placeholder variables of the visible and hidden biases:
vb <- tf$placeholder(tf$float32, shape = shape(num_input)) 
hb <- tf$placeholder(tf$float32, shape = shape(num_hidden))
..................Content has been hidden....................

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