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

Autoencoder evaluation seems to be incorrect #6

Open
hitvoice opened this issue Aug 9, 2017 · 0 comments
Open

Autoencoder evaluation seems to be incorrect #6

hitvoice opened this issue Aug 9, 2017 · 0 comments

Comments

@hitvoice
Copy link

hitvoice commented Aug 9, 2017

Line 242-244 function evaluate_autoencoder, train.py:

all_accuracies += \
    torch.mean(max_indices.eq(masked_target).float()).data[0]
bcnt += 1

Since masks in batches are different, in each batch there'll be a different number of indices being compared. The average of average is equal to the average of all if and only if all the chunks are of the same size, which is not the case here. The all_accuracies calculated here is inaccurate.

Besides, in line 233 in function evaluate_autoencoder, train.py:

output = autoencoder(source, lengths, noise=True)

During the evaluation, the autoencoder seems to be "cheating" here. The correct word vector of the last word is given, and this is not the case when the autoencoder is doing the real inference. The actual accuracy will be a lot lower. The sentence-level accuracy is way lower than word-level accuracies as well. When the decoder fails to generate "<eos>", the whole sentence is wrong, but in word-level accuracies, the sentence is (n-1)/n correct.

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