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

[Question]: Why is expand_context set to false when training (TransformerEmbeddings)? #3166

Closed
kobiche opened this issue Mar 28, 2023 · 2 comments
Labels
question Further information is requested

Comments

@kobiche
Copy link

kobiche commented Mar 28, 2023

Question

I was debugging the behaviour of the model during training, I landed on this peculiar behaviour.
If I understand it correctly, the expand_context is set to false if we are training the model. Why? Why is the context expanded only during inference?

@kobiche kobiche added the question Further information is requested label Mar 28, 2023
@alanakbik
Copy link
Collaborator

Hello @kobiche the context is always expanded during inference. During training, we apply a "context dropout" where the context is only expanded if the random number is above the dropout value. The idea is to make the model robust to work without context as well (for instance, if someone wants to predict for only a single sentence.)

@kobiche
Copy link
Author

kobiche commented Mar 28, 2023

Thanks for the clarification, I think I misinterpreted the if-condition.

@kobiche kobiche closed this as completed Mar 28, 2023
alanakbik added a commit that referenced this issue Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants