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

Support for multidimensional data? #123

Closed
jakubMitura14 opened this issue Aug 5, 2022 · 6 comments
Closed

Support for multidimensional data? #123

jakubMitura14 opened this issue Aug 5, 2022 · 6 comments

Comments

@jakubMitura14
Copy link

jakubMitura14 commented Aug 5, 2022

Hello I have multidimensional (3 and 4 dims) data and flattening them is not an option but layers like dense seem to accept only 1 or 2D input. Am I correct or I am missing something?

Thanks For response !

@lungd
Copy link
Contributor

lungd commented Aug 5, 2022

Dense does support input arrays of arbitrary sizes by reshaping the input and the result (e.g. https://github.com/avik-pal/Lux.jl/blob/main/src/layers/basic.jl#L650)

julia> using Lux, Random

julia> d = Dense(1,2)
Dense(1 => 2)       # 4 parameters

julia> ps, st = Lux.setup(Random.default_rng(), d);

julia> x = randn(1,2,3,4,5);

julia> size(d(x, ps, st)[1])
(2, 2, 3, 4, 5)

@jakubMitura14
Copy link
Author

jakubMitura14 commented Aug 5, 2022

Ok I was refering to this in documantation

Input

x must be a Matrix of size in_dims × B or a Vector of length in_dims

In http://lux.csail.mit.edu/dev/api/layers/

Thank You for fast response !!

@avik-pal
Copy link
Member

avik-pal commented Aug 6, 2022

Thanks for pointing it out. Fixed docs in #124.

@jakubMitura14
Copy link
Author

Happy to help @avik-pal , generally with so huge speed of development like is present in this repository it is fully understendable !

just checking Lux.Conv has

Image data should be stored in WHCN order (width, height, channels, batch)

so it is truly conv2D only - hence no possibility of 3d convolutions at the moment ?

@avik-pal
Copy link
Member

avik-pal commented Aug 6, 2022

No, it works for 3d see the inputs section. It is mentioned as an example of data ordering.

@jakubMitura14
Copy link
Author

ok, fantastic ! so in this case it can be written

(width, height, channels, batch) 
or (width, height,depth, channels, batch)

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

3 participants