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

NLP Usage #1

Closed
muhammadfhadli1453 opened this issue Jun 18, 2021 · 2 comments
Closed

NLP Usage #1

muhammadfhadli1453 opened this issue Jun 18, 2021 · 2 comments

Comments

@muhammadfhadli1453
Copy link

Hi, can you add more documentation for the Usage? I'm a little bit confused about how to use the model for training until getting the final result. Thank you

@jaketae
Copy link
Owner

jaketae commented Aug 24, 2021

Hey @muhammadfhadli1453, thanks for filing this issue, and apologies for the belated reply.

I'll certainly try to add more documentation on model usage. For the time being, I'll try to explain more on this thread in the hopes of answering your question.

You've probably already seen this from the README:

>>> from g_mlp import gMLPForLanguageModeling
>>> model = gMLPForLanguageModeling()
>>> tokens = torch.randint(0, 10000, (8, 256))
>>> model(tokens).shape
torch.Size([8, 256, 256])

You can consider gMLPForLanguageModeling as a BERT-like encoder model. Since this is an encoder model, you would train this model via masked language modeling (MLM), where some parts of the tokens are replaced with [MASK] and the model has to predict the actual token for each mask token.

If anything is unclear, let me know. Thanks!

@jaketae
Copy link
Owner

jaketae commented Jun 9, 2022

Closing this for now, feel free to ping me if you have any questions!

@jaketae jaketae closed this as completed Jun 9, 2022
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

2 participants