deephealthproject / eddl

European Distributed Deep Learning (EDDL) library. A general-purpose library initially developed to cover deep learning needs in healthcare use cases within the DeepHealth project.
https://deephealthproject.github.io/eddl/
MIT License
34 stars 10 forks source link

Support n-dimensional dense #323

Closed salvacarrion closed 2 years ago

salvacarrion commented 2 years ago

Currently, the Dense layer only supports 2D operations (excluding the batch dimension). However, it should be fairly trivial to support n-dimensional operations through a reshape operation.

Example:

Idea:
(b, a1, b1, c1, d1) * (b, a2, b2, c2, d2) => (b, a1==a2 b1==b2, (c1,c2)x(d1,d2) )   // c2==d1

Tensors A, B + [reshape(A), reshape(B)] + C=Operation(A, B) + reshape(C)
(b, a1, b1, c1, d1) * (b, a2, b2, c2, d2) => (b*a1*b1, c1, d1) * (b*a2*b2, c2, d2) => (b*a*b,(c1,c2)x(d1,d2) ) => (b, a1==a2 b1==b2, c1, d2)
salvacarrion commented 2 years ago

Added in a9165dc98908805f997a8b87bc66e38f5d0d2217