April 2019
Intermediate to advanced
426 pages
11h 13m
English
The following steps describe the process of setting up a TensorFlow graph:
In [ ]: import tensorflow as tf num_features = x_train.shape[1] x = tf.placeholder(dtype=tf.float32, shape=[None, num_features]) y = tf.placeholder(dtype=tf.float32, shape=[None])
A TensorFlow operation starts with placeholders. Here, we defined two placeholders x and y for containing the network inputs and outputs, respectively. The shape parameter defines the shape of the tensor to be fed, with None meaning that the number of observations is unknown at this point. The second dimension of x is the number of features that we have, reflected in the num_features variable. ...
Read now
Unlock full access