Hacker News new | past | comments | ask | show | jobs | submit login
Genann – Simple neural network library in ANSI C (github.com/codeplea)
117 points by codeplea on July 5, 2018 | hide | past | favorite | 12 comments



This looks like a clearly written, compact, and easy-to-use neural network library. It could be useful for pedagogy, but the README should also mention (unless I missed it) for naive readers that it is pretty much completely inappropriate for production since it uses no vector instructions nor GPU computation. It will be slow compared to any more sophisticated neural network library for anything but the most trivial applications.

For a similar equivalent in Swift see my project: https://github.com/davecom/SwiftSimpleNeuralNetwork


> it is pretty much completely inappropriate for production since it uses no vector instructions nor GPU computation

Many platforms do not have GPUs or special instructions, for example, at the edge.


Sure, but we don't typically do sophisticated machine learning on them. The vast majority of modern CPUs have vector instructions. Even a Raspberry Pi's ARM has NEON.


Not necessarily true. You might want to run ANNs on micro-controllers at the edge for many different reasons.


Excuse me if this sounds stupid but, vector instructions are assembly. I know we can use inline assembly or compile and link assembly alongside C but isn't it the compiler that is in charge of using vector instructions ?

IIRC GCC has -mmx, -sse(2|3|4) options to enable this kind of instructions.


Sure, if the compiler can find optimizations by inserting vector instructions, it will. But, typically you'll want to specifically format your code using matrices/a library like BLAS to maximize performance and use as many vector instructions as possible.


Honourable mention for FANN - Fast Artificial NN, also in C, has a nice set of features and was a pleasure to use.

https://github.com/libfann/fann


This is from 2016. Interesting that the authors most recent post is a tool for finding when your projects are being mentioned on HN or Reddit :)


Wow! I had to implement a small 3 layer network in C for a class, and it was interesting. It was a ton of work though, but I learnt a lot.

Will go through the source code for the kicks. Thanks!


Beautiful, properly documented code.


With some assertions missing to assure there are no actions upon null pointers (e. g. return by failed init functions).


If the most interesting thing you can say about your project is which language you used, you might not have aimed high enough.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: