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

Correct Indices calculation compares first element with ground truth for ENTIRE batch #1

Open
apurvakokate opened this issue Mar 5, 2023 · 0 comments

Comments

@apurvakokate
Copy link

apurvakokate commented Mar 5, 2023

Starting with line 389 in train.py:
preds = torch.cat(preds) concatenates all predictions into a 1D tensor, the predictions for training samples is returned by the method

then at line 112 preds = output_train the output is assigned to preds

then at line 207 pred=preds[idx] the prediction is indexed by the index of the batch, however as a side effect of the concatenation this returns a single value

finally,
at line 249 cor_idx = np.where(pred.cpu() == gtruth)[0] the code returns a list of indices where the single value of pred is found in the ground truth. Numpy's where function does not throw an error as it internally manages its operations.

Logically, pred at line 249 should be a list of predictions with size equal to batch size and not a single value so the correct indices can be calculated properly

@apurvakokate apurvakokate changed the title Correct Indices calculation chooses first element as ground truth for ENTIRE batch Correct Indices calculation compares first element with ground truth for ENTIRE batch Mar 5, 2023
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