【问题标题】:What is the mathematical meaning of loss function?损失函数的数学意义是什么?
【发布时间】:2019-05-02 09:08:46
【问题描述】:

我是 tensorflow 新手,想了解以下示例的每一步:

c = tf.square(a - b)                                                           
MSE = tf.reduce_mean(c)  

d = tf.reduce_sum(tf.square(a-b),reduction_indices=[1])
e = tf.reduce_mean(d)

e 变量的值代表什么?我想知道数学表达式。

【问题讨论】:

  • tf.reduce_mean 仅仅意味着我们取d中的值的平均值

标签: python tensorflow


【解决方案1】:

d = tf.reduce_sum(tf.square(a-b),reduction_indices=[1])
e = tf.reduce_mean(d)

a 是真正的 y。 b 是预测的 y。

mse = avg(sum((a-b) 的平方得到 +))

所以,它可以是当前模型如何预测 y 实际 y 正在关闭的损失函数。

【讨论】:

    【解决方案2】:

    这是平均值;即,给定值的总和除以值的数量。

    tensorflow.math.reduce_mean 在功能上等同于numpy.mean;它取给定张量的平均值。

    【讨论】:

      猜你喜欢
      • 2019-08-19
      • 2018-02-26
      • 1970-01-01
      • 2020-04-09
      • 1970-01-01
      • 1970-01-01
      • 2017-08-10
      • 2018-01-13
      • 2021-02-28
      相关资源
      最近更新 更多