Chap 3 TensorFlow
Chap 3 TensorFlow
To inspect which devices are used by the computational graph, we can initialize
our TensorFlow session with the log_device_placement set to True:
sess = tf.Session(config=tf.ConfigProto(log_device_placement=True))
Models that span multiple GPUs by
building models in a tower-like fashion
Using a specific device
If we desire to use a specific device, we may do so by using with
tf.device to select the appropriate device.
If the chosen device is not available, however, an error
will be thrown.
If we would like TensorFlow to find another available device if the
chosen device does not exist, we can pass the
allow_soft_placement flag to the session variable.
Specifying Logistic Regression Model in TensorFlow
Let’s build a simple model to tackle the MNIST dataset.
our goal is to identify handwritten digits from 28 x 28 black-and-
white images.
The first network that we’ll build implements logistic regression.
Our model uses
Matrix W represent the weights of the connections in the network
Vector b corresponding to the biases to estimate whether an input x
belongs to class I
It doesn’t have any hidden layers
We have an output softmax of size 10
Pictorial representation of the Logistic
Regression network