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

bug: sequence classification acc 计算错误 #4

Closed
bo-ke opened this issue Apr 25, 2021 · 0 comments
Closed

bug: sequence classification acc 计算错误 #4

bo-ke opened this issue Apr 25, 2021 · 0 comments

Comments

@bo-ke
Copy link
Owner

bo-ke commented Apr 25, 2021

sparse_categorical_accuracy 跟 categorical_accuracy区分

if len(intent_pred.shape) == 2 and intent_pred.shape[1] == 1:
    intent_acc = tf.keras.metrics.categorical_accuracy(
        y_true=intent_true, y_pred=intent_pred)
else:
    intent_acc = tf.keras.metrics.sparse_categorical_accuracy(
        y_true=intent_true, y_pred=intent_pred)
@bo-ke bo-ke closed this as completed Apr 25, 2021
bo-ke added a commit that referenced this issue Apr 25, 2021
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