We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
` 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.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
` 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.
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.
The text was updated successfully, but these errors were encountered: