Deep Learning Essentials
上QQ阅读APP看书,第一时间看更新

Calculating errors

The first thing in backpropagation is to calculate the errors from forward propagation for your target value. The input provides y as a test for the accuracy of the network’s output, so we compute the following vector:

This is written in code as follows: 

# define error, which is the difference between the activation function output from the last layer and the label
error = tf.sub(a_2, y)