August 2017
Intermediate to advanced
288 pages
8h 6m
English
This section provides the steps to set up the script for running the RBM model using TensorFlow:
X = tf$placeholder(tf$float32, shape=shape(NULL, num_input)) prob_h0= tf$nn$sigmoid(tf$matmul(X, W) + hb) h0 = tf$nn$relu(tf$sign(prob_h0 - tf$random_uniform(tf$shape(prob_h0))))
Use the following code to execute the graph created in TensorFlow:
sess$run(tf$global_variables_initializer()) s1 <- tf$constant(value = c(0.1,0.4,0.7,0.9)) cat(sess$run(s1)) s2=sess$run(tf$random_uniform(tf$shape(s1))) cat(s2) cat(sess$run(s1-s2)) cat(sess$run(tf$sign(s1 - s2))) cat(sess$run(tf$nn$relu(tf$sign(s1 - s2))))
Read now
Unlock full access