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

support R-DPO #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

support R-DPO #25

wants to merge 1 commit into from

Conversation

leksious
Copy link
Collaborator

No description provided.

@leksious leksious requested a review from syrn1k September 25, 2024 14:41
Comment on lines +100 to +101
chosen_lens: int | None,
rejected_lens: int | None,
Copy link
Collaborator

Choose a reason for hiding this comment

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

не очень нравится идея добавлять штуку в общий абстрактный класс которая только в одном лоссе используется

хочется как-то внутри более изолировано и чисто внутри лосса это считать мб

Copy link
Collaborator Author

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:
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

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

мне визуально так приятней и проще, но и так как у тебя ок

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
beta: float = 0.1

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.

2 participants