keras: Why is the training loss much higher than the testing loss?

来源:互联网 发布:linux 网络编程本地ip 编辑:程序博客网 时间:2024/06/07 16:30

Why is the training loss much higher than the testing loss?

A Keras model has two modes: training and testing. Regularization mechanisms, such as Dropout and L1/L2 weight regularization, are turned off at testing time.

Besides, 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.

阅读全文
0 0
原创粉丝点击