What is the difference between Loss, accuracy, validation loss, Validation accuracy?

后端 未结 3 1875
长情又很酷
长情又很酷 2021-02-07 12:50

At the end of each epoch, I am getting for example the following output:

Epoch 1/25
2018-08-06 14:54:12.555511: 
2/2 [==============================] - 86s 43s/s         


        
相关标签:
3条回答
  • 2021-02-07 13:06

    I think here is another answer that worth notifying:

    val_loss is the value of cost function for your cross-validation data and loss is the value of cost function for your training data

    https://datascience.stackexchange.com/a/25269

    0 讨论(0)
  • 2021-02-07 13:16

    In your model.compile function you have defined a loss function and a metrics function.

    Your "loss" is the value of your loss function (unknown as you do not show your code) Your "acc" is the value of your metrics (in this case accuracy) The val_* simply means that the value corresponds to your validation data.

    Only the loss function is used to update your model's parameters, the accuracy is only used for you to see how well your model is doing.

    You should seek to minimize your loss and maximize your accuracy. Ideally the difference between your validation data results and your training data results should be similar (allthough some difference are expected)

    0 讨论(0)
  • 2021-02-07 13:22

    When we mention validation_split as fit parameter while fitting DL model, it splits data into two parts for every epoch i.e. training data and validation data. It trains the model on training data and validate the model on validation data by checking its loss and accuracy.

    Usually with every epoch increasing, loss goes lower and accuracy goes higher. But with val_loss and val_acc, many cases can be possible:

    1. val_loss starts increasing, val_acc starts decreasing(means model is cramming values not learning)

    2. val_loss starts increasing, val_acc also increases.(could be case of overfitting or diverse probability values in cases softmax is used in output layer)

    3. val_loss starts decreasing, val_acc starts increasing(Correct, means model build is learning and working fine)

    This is a link to refer as well in which there is more description given. Thanks. How to interpret "loss" and "accuracy" for a machine learning model

    I have tried to explain at https://www.javacodemonk.com/difference-between-loss-accuracy-validation-loss-validation-accuracy-when-training-deep-learning-model-with-keras-ff358faa

    0 讨论(0)
提交回复
热议问题