-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multilinear map #26527
Labels
function request
A request for a new function or the addition of new arguments/modes to an existing function.
module: nn
Related to torch.nn
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Comments
colesbury
added
enhancement
Not as big of a feature, but technically not a bug. Should be easy to fix
module: operators
triage review
labels
Sep 20, 2019
FWIW, einsum is implemented in C++. (Tensor networks may be relevant). Also cc @zou3519 |
VitalyFedyunin
added
the
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
label
Sep 24, 2019
@santient Is this implemented? If so, could you post a link to your implementation or PR? |
Just FYI, I updated my implementation using einsum to support batched vectors |
mruberry
added
function request
A request for a new function or the addition of new arguments/modes to an existing function.
module: nn
Related to torch.nn
and removed
enhancement
Not as big of a feature, but technically not a bug. Should be easy to fix
module: operators (deprecated)
labels
Oct 8, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
function request
A request for a new function or the addition of new arguments/modes to an existing function.
module: nn
Related to torch.nn
triaged
This issue has been looked at a team member, and triaged and prioritized into an appropriate module
馃殌 Feature
Multilinear layer: a generalization of the Linear and Bilinear layers/functions to any configurable number of variables. This should be a learnable multilinear map that does the equivalent of this function, plus a bias (from the Multilinear map Wikipedia page):
Details
Implement the following:
torch.nn.functional.multilinear((input1, ..., inputN), weight, bias=None)
torch.nn.Multilinear((in1_features, ..., inN_features), out_features, bias=True)
I think the rank of the weight tensor would be the number of input features plus one.
Motivation
This is useful for situations where you want to combine more than two vectors using a learnable function that is linear in all variables. A good use case would be tensor fusion with more than two variables.
I plan to implement this for use in a project. It should be fairly easy to implement using something like
torch.einsum
, but a native C++ implementation could speed things up significantly.Should I submit a PR when this is done?
cc @albanD @mruberry
The text was updated successfully, but these errors were encountered: