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

about the labels #22

Closed
Amadeus-JD opened this issue Apr 19, 2021 · 4 comments
Closed

about the labels #22

Amadeus-JD opened this issue Apr 19, 2021 · 4 comments

Comments

@Amadeus-JD
Copy link

I see there a line of code before output the loss
that is
if labels is not None:
labels = [torch.tensor(label) for label in labels]
labels = torch.cat(labels, dim=0).to(logits)
loss = self.loss_fnt(logits.float(), labels.float())
output = (loss.to(sequence_output),) + output

and i also tried
why sometimes the label could be none???
am I got something wrong?

@wzhouad
Copy link
Owner

wzhouad commented Apr 19, 2021

The labels can be None in inference.

@Amadeus-JD
Copy link
Author

The labels can be None in inference.

不好意思我可以用中文回复吗。。。。请问这个in inferenc是在你们的设想中还是在模型的推理中呢。。
我有print过报错那轮的hts和predict。。显示是有很多需要判断的关系的。。为什么在同一轮label是none呢。。
。。我是想换一个loss试试的。。但是不知道为什么这里label有时候会变成none。。我实验的语料是CDR这种二分类。。
label是none的时候的意思可以理解成那一轮的所有关系都是负例吗?。。。可是集使都是负例应该也是都是【0,1】这种形式吧,,,请问label为none有什么具体含义吗?

sry could i reply you in Chinese? could you tell me this 'in inference' is in your inference or in models'?..
I have printed the hts and logits in that round... it shows many relaitons need to predict and that's what model done...why the label could be none?... Is there any meaning when the label is none? I test your model in CDR dataset,. for those 2-classes classify....is label==none means all hts's label should be negative?.....I think i have some misunstanding....
actually i just want to change a loss type to make absolution experments..

@wzhouad
Copy link
Owner

wzhouad commented Apr 20, 2021

None不是代表正负类而是代表ground truth labels是否已知。在模型训练阶段,模型需要拟合训练集上的ground truth label,这个时候labels不是None;在模型测试阶段,ground truth label未知,模型需要预测labels,这个时候labels是None

@Amadeus-JD
Copy link
Author

None不是代表正负类而是代表ground truth labels是否已知。在模型训练阶段,模型需要拟合训练集上的ground truth label,这个时候labels不是None;在模型测试阶段,ground truth label未知,模型需要预测labels,这个时候labels是None

谢谢。。。。我重新看了一下代码。。发现了。。你在测试阶段。。。验证集和测试集的label没有传到模型里去。。。
明白了。。谢谢

@wzhouad wzhouad closed this as completed Apr 20, 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

2 participants