How are metrics computed in Keras?

后端 未结 3 1725
醉酒成梦
醉酒成梦 2021-02-15 16:57

I am wondering how does Keras compute a metric (a custom one or not).

For example, suppose I have the following metric which yields the maximal error between the predict

3条回答
  •  清歌不尽
    2021-02-15 17:37

    There is a difference between the metric on training dataset and on validation dataset. For the val set the metric is calculated at epoch end for your whole val dataset. For the train set: The metric is calculated on batch end and the average keeps getting updated till epochs end.

    As you can see the metric for the train set is evaluated on the fly with each batch was evaluated using different weights. That's why the train metric shows sometimes strange behaviour.

提交回复
热议问题