In the previous chapter, we how to set up TensorBoard with Keras. However, as mentioned, TensorBoard can also be used with TensorFlow (among others). In this recipe, we will show you how to use TensorBoard with TensorFlow when classifying Fashion-MNIST.
- Let's start by TensorFlow and a to load
mnist
datasets, as follows:
import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data
- Next, we specify the Fashion MNIST dataset and load it:
mnist = input_data.read_data_sets('Data/fashion', one_hot=True)
- Let's create the placeholders for the input data:
n_classes = 10 input_size = 784 x = tf.placeholder(tf.float32, shape=[None, input_size]) y = tf.placeholder(tf.float32, shape=[None, n_classes])
- Before we specify our network architecture, we will define a couple of functions we will be using multiple times in our model. We start with a function that creates and initializes the weights:
def weight_variable(shape): initial...