-
Notifications
You must be signed in to change notification settings - Fork 22
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
support R-DPO #25
base: main
Are you sure you want to change the base?
support R-DPO #25
Conversation
chosen_lens: int | None, | ||
rejected_lens: int | None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не очень нравится идея добавлять штуку в общий абстрактный класс которая только в одном лоссе используется
хочется как-то внутри более изолировано и чисто внутри лосса это считать мб
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен, что это не оч красиво. Делал по примеру precomputed_margins, ща мб попробую переписать без этого
|
||
unscaled = self.beta * logits | ||
|
||
if chosen_lens is not None and rejected_lens is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
обязательно же не None должно быть
unscaled = self.beta * logits | ||
|
||
if chosen_lens is not None and rejected_lens is not None: | ||
unscaled -= self.alpha * rejected_lens - self.alpha * chosen_lens |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
мне визуально так приятней и проще, но и так как у тебя ок
unscaled -= self.alpha * rejected_lens - self.alpha * chosen_lens | |
unscaled += self.alpha * (chosen_lens - rejected_lens) |
@@ -85,6 +86,12 @@ class APODownLossSettings(DPOLossSettings): | |||
loss_type: Literal[DPOLossesType.APO_DOWN] | |||
|
|||
|
|||
class RDPOLossSettings(DPOLossSettings): | |||
loss_type: Literal[DPOLossesType.RDPO] | |||
beta: float = 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beta: float = 0.1 |
No description provided.