In keras, is the loss value of model.fit the average over batches or over samples?
The training loss is a running mean of the loss values across batches, during training, after each batch update. The weights are changing during training so you cannot compare this loss to to making predictions with fixed weights and then computing a loss.
This means that if you compute the average (or even running mean) over batches, you will get a different result.
The background for this question is that I am trying to debug a TensorFlow pipeline. I manually computed the loss for each example based on the network's current prediction and averaged the error terms. The number I get is different from what Keras is reporting, so the question is if I found my bug, or if I am computing the wrong thing to compare to the value reported as "loss".
What exactly is Keras computing here?