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

Per-factor embedding dimensions when concatenating #986

Open
eltorre opened this issue Apr 5, 2023 · 0 comments
Open

Per-factor embedding dimensions when concatenating #986

eltorre opened this issue Apr 5, 2023 · 0 comments

Comments

@eltorre
Copy link

eltorre commented Apr 5, 2023

Feature description

Right now, factors-dim-emb takes a single INT. Then, in Layers::Embedding creates a matrix where every embedding has the same dimension:

      FactorEmbMatrix_
          = graph_->param("factor_" + name, {numberOfFactors, dimFactorEmb}, initFunc, fixed);

Then, embedWithConcat (and maybe data::factored_vocab?) take this into account.

I feel like this is not too good when dealing with factors with very different vocab sizes, for example capitalization of a word (vocab size 3) vs word inflection (vocab size ~100 for some languages). This forces either a too small embedding for the second factor, or a too large embedding for the first, which seems wasteful.

Example

factors-dim-emb should behave like dim-vocabs when --factors-combine=concat

Comments

This seems easy enough to implement
Famous last words

I'd appreciate if somebody with a good knowledge of the codebase would gauge the size of the footgun beforehand.

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

No branches or pull requests

1 participant