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

question about predict value p at train_task_classifyapp.py line 417 #19

Open
wsl071134 opened this issue Dec 9, 2019 · 2 comments
Open
Assignees

Comments

@wsl071134
Copy link

wsl071134 commented Dec 9, 2019

p = model.predict_gen(generator=gen_test)[0]
In line 417, p is identified as the first element of the model.predict_gen () return value.

In my understanding, model.predict_gen () should return the list P_1 of prediction results, and the program does the same.
def predict_gen(self, generator: EmbeddingSequence) -> np.array:
...
return [i + 1 for i in indices]
Then, can we use P_1 and y_test to calculate the accuracy?
Why use p instead of P_1 in this procedure?
accuracy = p == y_test
return accuracy
classifyapp_accuracy = evaluate(NCC_classifyapp(), embeddings, folder_data, train_samples, folder_results, dense_layer_size, print_summary, num_epochs, batch_size)
print('\nTest accuracy:', sum(classifyapp_accuracy)*100/len(classifyapp_accuracy), '%')

@tbennun
Copy link
Collaborator

tbennun commented Feb 26, 2020

Thanks for reporting this! This may be an important bug that was introduced in refactoring.

@tbennun tbennun self-assigned this Feb 26, 2020
@ai-sta-website
Copy link

ai-sta-website commented Jun 26, 2020

Hello!
@tbennun @wsl071134

I have exactly the same question. p = model.predict_gen(generator=gen_test) seems to subsume all predication results across 104 labels, while p = model.predict_gen(generator=gen_test)[0] only contains the predication of the first label? Then why only measure the first label? Thank you!

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

3 participants