How to understand loss acc val_loss val_acc in Keras model fitting

后端 未结 2 826
花落未央
花落未央 2021-01-31 17:34

I\'m new on Keras and have some questions on how to understanding my model results. Here is my result:(for your convenience, I only paste the loss acc val_loss val_acc after eac

2条回答
  •  情深已故
    2021-01-31 18:07

    Answering your questions:

    1. As described on official keras FAQ

    the training loss is the average of the losses over each batch of training data. Because your model is changing over time, the loss over the first batches of an epoch is generally higher than over the last batches. On the other hand, the testing loss for an epoch is computed using the model as it is at the end of the epoch, resulting in a lower loss.

    1. Training should be stopped when val_acc stops increasing, otherwise your model will probably overffit. You can use earlystopping callback to stop training.

    2. Your model seems to achieve very good results. Keep up the good work.

提交回复
热议问题