[HN Gopher] Show HN: Richard - A CNN written in C++ and Vulkan (...
       ___________________________________________________________________
        
       Show HN: Richard - A CNN written in C++ and Vulkan (no ML or math
       libs)
        
       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.  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.  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.  I'll be continuing to add new features over the coming
       months.
        
       Author : rjinman
       Score  : 109 points
       Date   : 2024-03-15 13:58 UTC (1 days ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | stanleykm wrote:
       | Very cool. I always find doing these kinds of toy projects is a
       | great way of dipping your toes in the deep end of a new subject.
        
       | sieste wrote:
       | Very nice project, congratulations! Have you done any performance
       | comparisons with tensorflow or pytorch?
        
         | toasted-subs wrote:
         | Those are not the same thing.
         | 
         | You seem like a recruiter looking for buzz words, not practical
         | or profession skills.
        
           | nickpsecurity wrote:
           | People make CNN's in both. There's classes for them, too.
           | It's reasonable to ask how a readable implementation compares
           | to an optimized one.
           | 
           | You shouldn't be so quick to accuse people of wrongdoing. It
           | helps to try to understand where they're coming from. In this
           | case, evaluating multiple styles of implementation.
        
           | nurettin wrote:
           | They both let you build and train a model of nn layers.
           | Tensorflow via keras and pytorch via torch.nn.Module.
           | 
           | How is that not functionally the same?
        
           | andy99 wrote:
           | One of the main reasons (the other being personal learning)
           | people write these minimal dependency free implementations is
           | exactly for speedup, so it's a fair question. If the author
           | has other motivations that's fine, but it's very interesting
           | to see how fast you can get once you strip out some of the
           | overhead of the common frameworks.
        
           | cbarrick wrote:
           | The performance comparison would be interesting to me.
           | 
           | I'm curious to know how close we can get to these frameworks
           | by directly using Vulkan for GPGPU.
           | 
           | Especially as an indicator of the feasibility of rewriting
           | core components like cuFFT and cuDNN in Vulkan.
        
           | sevagh wrote:
           | PyTorch and Tensorflow are arguably the two most practical
           | neural network frameworks in the profession.
        
       | Eager wrote:
       | 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.
       | 
       | I'm definitely going to be looking at this. Hope you had fun
       | making it.
        
       | olliej wrote:
       | I liked the original post title that left me momentarily confused
       | going "why is CNN writing articles in C++?????"
        
       | sevagh wrote:
       | Lots of C++ inference code out there but this does training as
       | well - impressive.
        
       ___________________________________________________________________
       (page generated 2024-03-16 23:00 UTC)