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

代码问题 #69

Open
ccjjs opened this issue Nov 14, 2024 · 0 comments
Open

代码问题 #69

ccjjs opened this issue Nov 14, 2024 · 0 comments

Comments

@ccjjs
Copy link

ccjjs commented Nov 14, 2024

penalty = torch.abs((policy_chosen_logps / num_non_pad_tokens[:len_chosen] - policy_rejected_logps / num_non_pad_tokens[len_chosen:]))

penalty = torch.clamp(self.relax_cofficient_1 * torch.exp(self.relax_cofficient_2 * penalty)-1, max=1.0)
这里penalty的计算用到了logits,并且没有detach,预期是penalty需要参与到梯度传播吗?

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