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 4D arrays #217

Open
Monnoroch opened this issue Nov 2, 2017 · 4 comments
Open

Support 4D arrays #217

Monnoroch opened this issue Nov 2, 2017 · 4 comments
Labels
tbd
Milestone

Comments

@Monnoroch
Copy link

@Monnoroch Monnoroch commented Nov 2, 2017

The documentation says this library only supports kernels working with 1,2,3D arrays. How hard it would be to support 4D arrays?

@robertleeplummerjr
Copy link
Member

@robertleeplummerjr robertleeplummerjr commented Nov 18, 2017

Currently, it'd be hard. But long term, it may be a good move. Are you talking hypothetically, or do you have a use case where you have 4d+ arrays?

@harish2704
Copy link

@harish2704 harish2704 commented Jan 14, 2018

  • gpu.js will be very much helpful if we want to run evaluation of any pre-trained neural network models in client side.
  • In the case of Neural netowk/Machine learning, most of common use case of 4D array is 2DConvolution.
    • 2DConvoulution will transform one 2D image ( or 2D array ) into array of 2D images ( 3D array ).
  • Applying 2D convolution on array of 2DImages (3DArray ) will result a 4D array which is an example use of 4D array.

-just an info

@robertleeplummerjr
Copy link
Member

@robertleeplummerjr robertleeplummerjr commented Jan 14, 2018

  • gpu.js will be very much helpful if we want to run evaluation of any pre-trained neural network models in client side.

Agreed! But we want to as well ensure that gpu.js can be used to train neural networks, and that vision will be achieved more in version 2 when OpenCL is added (node) and WebGL 2 is supported (client and node), however training does work as of now in both environments.

  • In the case of Neural netowk/Machine learning, most of common use case of 4D array is 2DConvolution.
    • 2DConvoulution will transform one 2D image ( or 2D array ) into array of 2D images ( 3D array ).
  • Applying 2D convolution on array of 2DImages (3DArray ) will result a 4D array which is an example use of 4D array.

Here (brain.js) is an example of a convolution that runs on gpu.js. While there are several layers of of looping, the result is still three dimensional: https://github.com/BrainJS/brain.js/blob/ff66428f828c528c1cf61379c761c1eb7f50c471/src/layer/convolution.js#L61

Does that help at all?

@harish2704
Copy link

@harish2704 harish2704 commented Jan 14, 2018

Thanks. brain.js was very useful link.

Regarding Opencl: Opencl backend will be super cool feature .. I will be waiting for it..

@robertleeplummerjr robertleeplummerjr added this to the v3.0.0 milestone May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.