Tensorflow中Estimator中的自定义eval_metric_ops

Tensorflow中Estimator中的自定义eval_metric_ops,第1张

Tensorflow中Estimator中的自定义eval_metric_ops

eval_metric_ops
需要按名称键入度量指标的字典。dict的值是调用度量函数的结果。您可以使用
tf.metrics
以下指标来实现您的指标功能:

 def metric_fn(labels, predict):    SST, update_op1 = tf.metrics.mean_squared_error(labels, tf.reduce_mean(labels))    SSE, update_op2 = tf.metrics.mean_squared_error(labels, predictions )    return tf.subtract(1.0, tf.div(SSE, SST)), tf.group(update_op1, update_op2))


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5642926.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存