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

[Feature] Filter negative labels #244

Merged
merged 10 commits into from
Nov 24, 2023

Conversation

xiaohangguo
Copy link
Contributor


在数据集处理时,如果训练集中input过长,超过了max_length,这种数据虽然在tokenizer部分被标记成了-100,但仍然会参与向前计算和损失函数的计算,这会浪费计算资源,因此写了一个filter_out_all_negative_labels函数来过滤掉负标签的样本。这样使得负样本不会参与向前传播的计算和损失函数的计算。


During dataset processing, if the input in the training set is too long and exceeds max_length, such data, although marked as -100 in the tokenizer section, will still participate in the forward computation and loss function calculation, which can waste computational resources. Therefore, a function named filter_out_all_negative_labels was written to filter out samples with negative labels. This ensures that samples with negative labels do not participate in forward propagation and loss function calculations.

@LZHgrla LZHgrla self-requested a review November 24, 2023 04:18
Copy link
Collaborator

@LZHgrla LZHgrla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
LGTM

@LZHgrla LZHgrla merged commit 97905af into InternLM:main Nov 24, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

None yet

2 participants