Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accuracy calculation mistake #8

Open
Yajiang opened this issue Jul 29, 2020 · 0 comments
Open

accuracy calculation mistake #8

Yajiang opened this issue Jul 29, 2020 · 0 comments

Comments

@Yajiang
Copy link

Yajiang commented Jul 29, 2020

` for i in range(batch_size):
if corr_weight is not None:
loss += tf.reduce_sum(tot_loss[i][inlier_mask[i]]) /
(tf.reduce_sum(corr_weight[i][inlier_mask[i]]) + 1e-6)
else:
loss += tf.reduce_mean(tot_loss[i][inlier_mask[i]])
cnt_err_row = tf.count_nonzero(
err_row[i][inlier_mask[i]], dtype=tf.float32)
cnt_err_col = tf.count_nonzero(
err_col[i][inlier_mask[i]], dtype=tf.float32)
tot_err = cnt_err_row + cnt_err_col
accuracy += 1. -
tf.math.divide_no_nan(tot_err, tf.cast(
inlier_num[i], tf.float32)) / batch_size / 2.

matched_mask = tf.logical_and(tf.equal(err_row, 0), tf.equal(err_col, 0))
matched_mask = tf.logical_and(matched_mask, inlier_mask)

loss /= batch_size
accuracy /= batch_size`

As I noticed, there maybe a little mistake in accuracy calculation. I don't think the accuracy calculation should divide batch_size as in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant