在 TensorFlow 中使用 RMSE 损失时,我收到的损失值非常小,小于 1
When using RMSE loss in TensorFlow I receive very small loss values smalerl than 1
你好,我有一个网络可以生成这样的 logits/输出:
logits = tf.placeholder(tf.float32, [None, 128, 64, 64]) // outputs
y = tf.placeholder(tf.float32, [None, 128, 64, 64]) // ground_truth, targets
--> y ground truth values are downscaled from [0, 255] to [0, 1]
为了增加 perforce 因为我读过最好使用范围 [0, 1]
现在我想像这样计算 RMSE / EuclideanLoss:
loss = tf.reduce_mean(tf.square(logits - y))
或
loss = tf.sqrt(tf.reduce_mean(tf.square(tf.subtract(y, logits))))
不确定哪个更好。
这样做时,我的损失值大约从 1.
开始,然后迅速下降到 2.5e-4
。当我在 Caffe 中为同一个网络使用 EuclideanLoss
时,我的损失值大约从 1000
开始下降到 200
。我在 Tensorflow 中做错了什么或者为什么损失值那么小?我无法真正跟踪 tensorboard
中的损失值,因为它们太小了。谁能帮帮我?
您建议的第一个损失更好(第二个引入了不必要的 sqrt
)。
等于或小于 1 的值似乎是唯一可能的值,因为您提供的值范围在 0 和 1 之间 - 因此最大可能的错误是 1。
如果您无法在 tensorboard 中可视化损失,请尝试使用对数刻度(图表下方的两个按钮之一)显示图表
你好,我有一个网络可以生成这样的 logits/输出:
logits = tf.placeholder(tf.float32, [None, 128, 64, 64]) // outputs
y = tf.placeholder(tf.float32, [None, 128, 64, 64]) // ground_truth, targets
--> y ground truth values are downscaled from [0, 255] to [0, 1]
为了增加 perforce 因为我读过最好使用范围 [0, 1]
现在我想像这样计算 RMSE / EuclideanLoss:
loss = tf.reduce_mean(tf.square(logits - y))
或
loss = tf.sqrt(tf.reduce_mean(tf.square(tf.subtract(y, logits))))
不确定哪个更好。
这样做时,我的损失值大约从 1.
开始,然后迅速下降到 2.5e-4
。当我在 Caffe 中为同一个网络使用 EuclideanLoss
时,我的损失值大约从 1000
开始下降到 200
。我在 Tensorflow 中做错了什么或者为什么损失值那么小?我无法真正跟踪 tensorboard
中的损失值,因为它们太小了。谁能帮帮我?
您建议的第一个损失更好(第二个引入了不必要的 sqrt
)。
等于或小于 1 的值似乎是唯一可能的值,因为您提供的值范围在 0 和 1 之间 - 因此最大可能的错误是 1。
如果您无法在 tensorboard 中可视化损失,请尝试使用对数刻度(图表下方的两个按钮之一)显示图表