December 2018
Intermediate to advanced
764 pages
18h 18m
English
Before we get into building and training the regression model using TensorFlow, let's define some important variables and operations. We find out the number of output and input variables from X_train and y_train and then use these numbers to define the x(x_tensor), y (y_tensor), weights (w), and bias (b):
num_outputs = y_train.shape[1] num_inputs = X_train.shape[1]x_tensor = tf.placeholder(dtype=tf.float32, shape=[None, num_inputs], name="x") y_tensor = tf.placeholder(dtype=tf.float32, shape=[None, num_outputs], name="y")w = tf.Variable(tf.zeros([num_inputs,num_outputs]), dtype=tf.float32, name="w") b = tf.Variable(tf.zeros([num_outputs]), dtype=tf.float32, name="b")
Read now
Unlock full access