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

Problems about BertModel4Mix #2

Closed
melodysnoopy opened this issue Jan 13, 2021 · 2 comments
Closed

Problems about BertModel4Mix #2

melodysnoopy opened this issue Jan 13, 2021 · 2 comments

Comments

@melodysnoopy
Copy link

大佬们好,BertModel4Mix中的target_a和target_b对应的是unlabeled_data中的mask_id吧?mask_id的作用是什么呢,仅仅是作为target传到BertModel4Mix吗?mask_id的值只能取0或者1,那么意味着labels4train_a和labels4train_b在最后一个维度的0或1位置才能取到1,那么最后一个维度的size为什么是num_labels,这有什么意义呢?反正其他位置取不到1啊。这一块没怎么看懂,希望大佬解答。

@felixwzh
Copy link
Collaborator

Hi, thank you for your question. You are right, for unlabeled_data, the target part, i.e., the label, is not used, since we have no label info for unlabeled data. But the reason that the last dimension has the size of num_labels is that we want to have the logits, which should be of size num_labels, to compute the unsupervised loss.

@melodysnoopy
Copy link
Author

Thanks for your timely answer, I got it.

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