How to do it...

  1. The following function is used to return randomly initialized weights:
# Weight Initialization
weight_variable <- function(shape) {
initial <- tf$truncated_normal(shape, stddev=0.1)
tf$Variable(initial)
}
  1. The following function is used to return constant biases:
bias_variable <- function(shape) {
initial <- tf$constant(0.1, shape=shape)
tf$Variable(initial)
}
..................Content has been hidden....................

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