C2_W3 Assignment: Why is the Neural Network's loss (cost function) value after the last epoch different than the accuracy shown when comparing the categorization errors?

For Tensorflow Keras Neural Networks I know they use the word ‘loss’ to mean cost function. In the assignment I noticed that after training the NN on 1000 epochs it outputs a loss of 0.0172
image
But when comparing the errors of the training set to the cv set, it says the training error’s value is 0.003


Why does it not say it is 0.0172? Because after it finished training that’s what the loss value was according to the first image.

Is it perhaps using some other metric when outputting the error value?
Thanks!

1 Like

The two numbers are related but substantially different.

For classification, the loss (cost) value is calculated using the logarithms of the error, scaled by the number of examples, and maybe including some additional cost due to regularization terms.

The categorization error (i.e. accuracy) is simply the ratio of the examples that were predicted correctly.

1 Like