pluskid / Mocha.jl

Deep Learning framework for Julia
Other
1.29k stars 254 forks source link

Elementwise multiply two blobs along a particular dimension? #161

Closed jeff-regier closed 8 years ago

jeff-regier commented 8 years ago

Is there a way to element-wise multiply the outputs of two layers that have different dimensions using broadcasting? For example, layer A in my network outputs 5-vectors and layer B outputs 51x51x5-tensors and I'd like to multiply the output of A by each of the 51^2 5-vectors the make up the output of B. Thanks in advance!

pluskid commented 8 years ago

It should be easy to write such a layer in CPU backend and just use Julia's broadcasting feature. However, for GPU, a bit work is required. There is no existing layer that could do this.