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

Why doesn't exist F.mul function(element-wise multiplication)? #4480

Closed
machanic opened this issue Mar 17, 2018 · 1 comment
Closed

Why doesn't exist F.mul function(element-wise multiplication)? #4480

machanic opened this issue Mar 17, 2018 · 1 comment
Assignees

Comments

@machanic
Copy link

I mean, F.mul is element-wise multiplication.
My network produce two scores, I want to multiply the two scores to produce final score
score = F.mul(s1, s2) I did not find F.mul or F.multiply
So, I am writing the following code:
score = s1 * s2

Can this work and back propagation?

@machanic machanic changed the title Why is there F.mul function? Why doesn't exist F.mul function(element-wise multiplication)? Mar 17, 2018
@kmaehashi
Copy link
Member

kmaehashi commented Mar 19, 2018

score = s1 * s2

Yes, this operation supports backprop. __mul__ operator is defined for Variables. https://github.com/chainer/chainer/blob/v4.0.0b4/chainer/functions/math/basic_math.py#L865

Please use Stack Overflow for generic questions.

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

No branches or pull requests

2 participants