-
Notifications
You must be signed in to change notification settings - Fork 132
Generalize DotLayer
to allow sparse inputs
#741
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
Comments
Why do you think it was a mistake to handle both, did you ever run into issues with this? If you think about this sparse dim as just another (implicit) dim in the shape, I think it makes a lot of sense. Just like we would probably also add these sparse dims to |
No. I thought it might be maybe unintuitive. But maybe not. Or maybe only for people coming from other frameworks.
Well, I think
Yes, I see this viewpoint. But then
Although it might be a bit unintuitive for the user to realize when |
Hm okay, I do see some dangers with sparse tensors now. E.g. if you have a sparse |
Hm, yeah, I don't know. (in the code, we can of course clean this up and for both |
Is this only for sparse tensors interpreted as implicit dense tensors, but not for expansions because of implicit dims via But it's also a matter of interpretation and definition, what the |
Ah true, it's actually a quite similar issue as #721. In both cases you need to make all those implicit dims explicit.
My interpretation was that sparse dims should always behave like they are implicitly dense. |
There is some danger in this for Note that many (almost all?) layers really ignore the So this viewpoint of interpreting it as a one-hot dense tensor, if we consider all the layers buggy which don't do that correctly, and if we would "fix" this, this could potentially break a lot of configs. And maybe this viewpoint is not always useful, except in some cases. I'm not sure... When we have #706 and the user somehow specifies the implicit dimensions more explicitly, then this is maybe less an issue. |
Although, to add, it is also rare that we actually have tensors with |
Extending on this thought, and getting back to the issue, so you say we should do this? I tend to agree. |
Ok, no further comments here, so the conclusion: This should be implemented. |
DotLayer
to allow sparse inputs?DotLayer
to allow sparse inputs
This basically would unify
GatherLayer
andDotLayer
.This is the same logic as for
LinearLayer
, which also works with either dense or sparse input.I'm not really suggesting to do this, I just want to raise the question here, whether this makes sense.
Maybe it is more clean however to not do this, and make it more explicit for the user.
Maybe it also was a mistake that
LinearLayer
does this. Other frameworks usually have a separateEmbedding
orEmbeddingLayer
for the case of sparse inputs.The text was updated successfully, but these errors were encountered: