arrayfire / arrayfire-rust

Rust wrapper for ArrayFire
BSD 3-Clause "New" or "Revised" License
815 stars 58 forks source link

Add Neural Network Example #312

Closed MichaelMcCulloch closed 2 years ago

MichaelMcCulloch commented 2 years ago

This will be my first contribution. I thought this would be the fastest way to get feedback on why my re-implementation of the neural network in rust is so very slow.

This pr adds the MNIST-rust package to download and unpack the mnist dataset, which is then loaded into arrayfire and processed on the GPU.

If you have any feedback of anykind, I'd love to hear it.

MichaelMcCulloch commented 2 years ago

I just noticed it is ingesting 50K training samples here, whereas the C++ example used a subset of just over 6000, so that would explain the speed decrease.

9prady9 commented 2 years ago

I just noticed it is ingesting 50K training samples here, whereas the C++ example used a subset of just over 6000, so that would explain the speed decrease.

Glad you made some progress, I won't be able to get to it until the weekend. I will let you know if I find anything when I try. Thank you for the contribution and using rust wrapper and arrayfire :)

9prady9 commented 2 years ago

@MichaelMcCulloch Does this work as expected after the sample count drop ?

MichaelMcCulloch commented 2 years ago

Yes, it just moves a bit quicker. I think I also need to modify the way the error is calculated, but currently that doesn't stop it from working as expected, it still converges

9prady9 commented 2 years ago

If it is not an elaborate fix, can you please do it now itself. thanks once again.

MichaelMcCulloch commented 2 years ago

There you go! :)