Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Pass Opt to TransformerEncoder/Decoder #3486

Merged
merged 8 commits into from
Mar 5, 2021
Merged

Pass Opt to TransformerEncoder/Decoder #3486

merged 8 commits into from
Mar 5, 2021

Conversation

spencerp
Copy link
Contributor

@spencerp spencerp commented Mar 4, 2021

Patch description
Since the RFC was well received (#3470) here's a PR against master (the other PR was branched off of tf-components #3466).

Testing steps
Make sure CircleCI passes.

@jaseweston
Copy link
Contributor

....and what will happen with parlai_internal?

@spencerp
Copy link
Contributor Author

spencerp commented Mar 4, 2021

....and what will happen with parlai_internal?

I'm getting an internal PR ready now!

:param bool embeddings_scale: Scale embeddings relative to their dimensionality.
Found useful in fairseq.
:param bool reduction: If true, returns the mean vector for the entire encoding
sequence.
:param int n_positions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will these comments appear somewhere else then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the opt declaration! I just noticed that not all of opt flags have descriptions, though, so I'll fill them in from here where applicable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suppose that's one thing we lose by getting rid of this, but the net negative lines is so enticing...

@jaseweston
Copy link
Contributor

....and what will happen with parlai_internal?

I'm getting an internal PR ready now!

👍
👍

@spencerp
Copy link
Contributor Author

spencerp commented Mar 4, 2021

Hm, Transresnet tests are failing consistently. That's concerning... Will need to get to the bottom of that before merging.

Copy link
Contributor

@klshuster klshuster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this looks good - definitely a fan of net negative lines.

I think Jason made a good point about the field/attr descriptions. I like how they're in the opt, but would it also be possible to include a note in the docstring of where to find those descriptions? like, "For more information regarding model parameters, see :file:" or something like that

:param bool embeddings_scale: Scale embeddings relative to their dimensionality.
Found useful in fairseq.
:param bool reduction: If true, returns the mean vector for the entire encoding
sequence.
:param int n_positions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suppose that's one thing we lose by getting rid of this, but the net negative lines is so enticing...

parlai/agents/transformer/modules.py Outdated Show resolved Hide resolved
@facebookresearch facebookresearch deleted a comment from klshuster Mar 4, 2021
@stephenroller
Copy link
Contributor

Big improvement.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants