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

weight problem #16

Open
litongxin666 opened this issue Mar 31, 2019 · 5 comments
Open

weight problem #16

litongxin666 opened this issue Mar 31, 2019 · 5 comments

Comments

@litongxin666
Copy link

weights = torch.zeros(targets_var.shape)
for i in range(targets_var.shape[0]):
for j in range(targets_var.shape[1]):
if targets_var.data.cpu()[i, j] == -1:
weights[i, j] = weight_neg[j]
elif targets_var.data.cpu()[i, j] == 1:

if targets_var.data.cpu()[i, j] == -1: should be changed to targets_var.data.cpu()[i, j] == 0

@dangweili
Copy link
Owner

@litongxin666 I re-config the weight in train_deepmar_resnet50.py, line 344-352

@abnercloud
Copy link

Hello, @dangweili ,Thanks to the great codebase! I has some confusions as follow:

In train_deepmar_resnet50.py, line 355:
targets_var[targets_var == -1] = 0
What is the meaning of this line?

In evaluate.py, line 45-46:
pt_result[pt_result>=0] = 1
pt_result[pt_result<0] = 0
And, why do we use 0 here?

In demo.py, line 129, 137:
if score[0, idx] >= 0:
Why do we think that greater than 0 means this attribute?

@abnercloud
Copy link

criterion = F.binary_cross_entropy_with_logits
After logits, do sigmoid operation. Therefore, 0 is the boundary?

@abnercloud
Copy link

What I am confused about is why the label is set to -1 when the data set is loaded.

@abnercloud
Copy link

What I am confused about is why the label is set to -1 when the data set is loaded.

Of course, 0 and -1 do not matter.

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