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

Add optional masking for reward #4

Open
thejaminator opened this issue Feb 26, 2023 · 0 comments
Open

Add optional masking for reward #4

thejaminator opened this issue Feb 26, 2023 · 0 comments

Comments

@thejaminator
Copy link
Owner

Currently we make the reward mandatory for all training ( and inference examples ).

# DecisionGPT2LMHeadModel
def forward(
        self,
        target_rewards: torch.Tensor,
...

This isn't ideal, it is possible that sometimes we don't want to train with a specified reward.

Perhaps we should take in an optional rewards_mask

def forward(
        self,
        target_rewards: torch.Tensor,
       rewards_mask: Optional[torch.BoolTensor], # same length as target_rewards
...

We'll then need to modify our attention mask in a corresponding manner to ignore the target_reward for that sequence.

Alternatively, maybe we can detect that when target_rewards is nan, we'll just modify our attention mask according?
That way we don't need a separate rewards_mask param. IDK if this could lead to more bugs though.

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