We proceed with the recipe as follows:
- The first step is to change the loss function; though for classification, it is better to use the cross-entropy loss function. We presently continue with the mean square error (MSE):
loss = tf.reduce_mean(tf.square(y - y_hat, name='loss'))
- Next, we use the GradientDescentOptimizer:
optimizer = tf.train.GradientDescentOptimizer(learning_rate= learning_rate) train = optimizer.minimize(loss)
- With just these two changes, we get an accuracy of only 61.3 percent for the test dataset for the same set of hyperparameters. Increasing the max_epoch, we can increase the accuracy, but that will not be an efficient use of TensorFlow abilities.
- This is a classification problem, so it will be better ...