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

amino Bret langugae model loss #3

Merged
merged 2 commits into from Aug 14, 2021
Merged

amino Bret langugae model loss #3

merged 2 commits into from Aug 14, 2021

Conversation

DrHB
Copy link

@DrHB DrHB commented Aug 13, 2021

Loss Function for AminoBret

you can test it by running following

vocab_size = 24
bs = 20
logit_out = torch.rand(bs, 10, vocab_size)
logit_chunk_perm = torch.rand(bs, 2)
target = torch.randint(1, 20, (bs, 10))
chunk_perm = torch.randint(0, 2, (bs,))

loss_func = AminoBretLoss(vocab_size=vocab_size)

loss = loss_func(logit_out, logit_chunk_perm, target, chunk_perm)
print(loss)

@hypnopump
Copy link
Owner

Wanna put the test under /tests ? You can check everything works by running python setup.py test

@DrHB
Copy link
Author

DrHB commented Aug 13, 2021

sounds good!

@DrHB
Copy link
Author

DrHB commented Aug 13, 2021

Done.

@hypnopump hypnopump merged commit 7da04aa into hypnopump:main Aug 14, 2021
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