Skip to content

Data: sparse_dim: DimensionTag to unify sparse, dim, vocab #722

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

Closed
albertz opened this issue Oct 21, 2021 · 4 comments · Fixed by #754
Closed

Data: sparse_dim: DimensionTag to unify sparse, dim, vocab #722

albertz opened this issue Oct 21, 2021 · 4 comments · Fixed by #754

Comments

@albertz
Copy link
Member

albertz commented Oct 21, 2021

It would be nice to have a DimensionTag which describes the sparse dim (when Data.sparse is True).

@albertz albertz changed the title Data.sparse_dim: DimensionTag or so, to unify Data.sparse and Data.dim Data: sparse_dim: DimensionTag to unify sparse, dim, vocab Oct 21, 2021
@albertz
Copy link
Member Author

albertz commented Oct 21, 2021

DimensionTag currently does not contain vocab but we can move it there.

@Zettelkasten
Copy link
Member

Zettelkasten commented Oct 21, 2021

This is also nice/required for when we add an axis/in_dim argument to LinearLayer. (#597)

@Zettelkasten
Copy link
Member

Would this be part of Data.dim_tags, or not (because there can only be one of these tags for each Data instance)?
Maybe it's nice if a sparse dim is just another dim like all others. But I guess many layers would need special handling for this dim tag, so maybe it makes sense to make this more explicit. I'm not sure about the implications.

@albertz
Copy link
Member Author

albertz commented Oct 21, 2021

Data.dim_tags corresponds to the dims which are really present in the tensor. So to batch_shape. Or we have the property Data.placeholder.ndim == len(Data.dim_tags). I would leave that behavior of dim_tags.

However, we can make a separate implicit_dim_tags or so. Very similar as what I proposed as out_implicit_shape in #706.

albertz added a commit that referenced this issue Nov 21, 2021
@albertz albertz linked a pull request Nov 21, 2021 that will close this issue
albertz added a commit that referenced this issue Nov 21, 2021
albertz added a commit that referenced this issue Nov 22, 2021
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

Successfully merging a pull request may close this issue.

2 participants