-
Notifications
You must be signed in to change notification settings - Fork 105
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
TransformerSenderReinforce max_len parameter #247
Comments
True, docstrings have not been updated after we went with the "force eos" decision. Do you want to open a PR about this as well? :) |
I think these two issues are related, but require a bit more refactoring as it's not straightforward to change the behavior of |
Can we assume length is always > 0 unless the input is something like an empty tensor? We do check that length is greater than one in EGG so that should not break when call |
I was referring to the solution 2 you proposed here: #138 |
Technically a message starting with EOS should not be accepted. How would you handle it? |
To my mind the problem is this issue in pytorch. |
But we'll never have a sequence of len 0. This is because 2/ if the user sets max_len equals to 1 and, though unlikely, the sender generates only the EOS, we would have a message of size 2: the sender-generated EOS and the one automatically appended to each message. This tensor is then given to the receiver RNN in case of a RNN receiver and all the EOS handling is done in the Game instance, see e.g. https://github.com/facebookresearch/EGG/blob/main/egg/core/reinforce_wrappers.py#L579-L588 For the such reasons I don't think we'll encounter the above error |
If we consider the solution 2 you proposed here (#138), |
Yes, but I think this was before we appended an EOS to every message, so that proposal is outdated. Do you have anything in mind? :) |
The docstring of
TransformerSenderReinforce
mentions that themax_len
parameter includes the EOS token: https://github.com/facebookresearch/EGG/blob/main/egg/core/reinforce_wrappers.py#L687However, the transformer can create a message of
max_len
(without EOS) and the EOS token will be appended afterwards: https://github.com/facebookresearch/EGG/blob/main/egg/core/reinforce_wrappers.py#L835So, to my understanding, the
max_len
parameter does actually not include the EOS token?The text was updated successfully, but these errors were encountered: