This started out as a personal effort to learn more about machine learning. It's currently a CLI app where you give it a JSON file specifying your network architecture and hyperparameters and point it to your training data, then invoke it again in 'eval' mode with some data it's not seen before and it will try to classify each sample.<p>I don't see many other people using Vulkan for GPGPU, and there may be many good reasons for that, but I wanted to try something a bit different.<p>I've made every attempt to make the code very clean and readable and I've written up the math in documentation/math.pdf, so hopefully this is a useful learning resource for anyone interested in how neural nets work under the hood.<p>I'll be continuing to add new features over the coming months.
Interestingly, I have a similar project with C# for the higher-level pieces, and Direct3D 11 GPU API instead of Vulkan: <a href="https://github.com/Const-me/Cgml">https://github.com/Const-me/Cgml</a><p>> don't see many other people using Vulkan for GPGPU, and there may be many good reasons for that<p>I think the main of these reasons is nVidia’s contributions to the ecosystem. It’s much easier to call library functions implemented by cuDNN or cuBLAS first-party library, than it is to write and dispatch compute shaders to multiply these matrices.<p>However, for use cases when hardware costs are substantial compared to software development costs, using Vulkan or D3D can be a reasonable thing to do. nVidia is too greedy, in the EULA of their drivers they forbid to use GeForce GPUs in data centres. For people who need GPGPU on their servers, that paragraph of text sometimes makes nVidia hardware an order of magnitude more expensive than AMD hardware.
What a great project! One of my favorite things to see is when people implement as much as possible themselves. It really makes a big difference to have control over what is going on. And it is great for educational purposes of course.<p>I'm definitely going to be looking at this. Hope you had fun making it.
> I don't see many other people using Vulkan for GPGPU, and there may be many good reasons for that, but I wanted to try something a bit different.<p>A big reason is that C++ for Vulkan (SPIR-V) isn't quite there, while CUDA does C, C++20 (minus modules currently), Fortran, Haskell, Java, C#, Julia, Python JITs, and anything else that might target PTX.<p>SPIR was a late response after Khronos realized the world wasn't willing to be stuck with C for GPGPU, and the tooling is still catching up to PTX.
That reminds me of a small project I did to classify drawings of cats and dogs 10 years ago with machine learning <a href="https://jeena.net/catdog" rel="nofollow">https://jeena.net/catdog</a> but no neural networks back then, just things like Canny edge detector, Hough transform, k-nearest neighbor, etc.
Can you comment :<p>how well does Vulcan api fit Neural Net primitives [ matmul / relu / backprop / tensor arrays ] ?<p>Also.. do you think the in-browser WebGPU api, the successor to webGL, is a good api for NN ?