Live data from Hacker News

Tinn: A tiny neural network library written in C99

github.com

31–40 of 62 posts

Re: Tinn: A tiny neural network library written in C99

#32
post #11
post #9

Earlier quoted context omitted.

Bullshit. These days installing any major NN framework is pretty much just "pip install X". Unless you want GPU support, in which case it's just slightly more complicated.

The page referenced is an April Fools Day joke. "We are finally at our April 1 Release (v4.1.2018)."

The whole project is tongue-in-cheek, but it's real and it works.

Disclaimer: I'm a contributor ;)

Re: Tinn: A tiny neural network library written in C99

#35
post #29
post #19

Just curious, is there a reason for passing around the Tinn struct by-value? Will it get optimized?

I'm curious too. Even if it will be optimized isn't it still be better to pass-by-reference?

It might be easier to answer if you explained why you think it would be better.

There may be cases where by-reference (yes, that's an absolutely acceptable thing to say, even in C) is more efficient: If the struct is a kind of "this pointer" (as in object-oriented programming) that is passed to a bunch of functions but relatively rarely used, then passing it by reference causes much less register pressure. Passing it by value would mean occupying a lot of registers with values that are probably not accessed.

On the other hand, if you expect the callee to do actual computation on all or most of the fields of the struct you pass in, passing it by value should probably be the way to go. This way, the values to be processed are already in registers and don't have to be stored to the stack by the caller and loaded back from the stack by the callee.

There is no general answer that is uniformly best, it depends on the characteristics of the actual program and their interactions with the compiler's optimizations. With inlining in particular, which should often allow the compiler to generate the same code for both versions.

Re: Tinn: A tiny neural network library written in C99

#36

Earlier quoted context omitted.

Generally when I see links to github projects on HN I expect something useful or extraordinary and this looks like my Neural Networks 101 assignment, only far more polished. But people seem to like it(over 400 stars right now) so maybe I am missing something.

So... if its usefulness is equal to something you've made, AND it's available to the public, AND it's more polished... why exactly are you shitposting about it? Let people enjoy things.

It's not shitposting.

One of the core requirements of modern deep neural networks is performance. The high accuracy you get from very fast training over large amounts of data is the only reason to look at neural networks over very fast, very accurate systems like XGBoost.

If something doesn't deliver that, then it's worth pointing out that it is inadequate for anything but toy tasks.

Re: Tinn: A tiny neural network library written in C99

#37
post #36

Earlier quoted context omitted.

So... if its usefulness is equal to something you've made, AND it's available to the public, AND it's more polished... why exactly are you shitposting about it? Let people enjoy things.

It's not shitposting. One of the core requirements of modern deep neural networks is performance. The high accuracy you get from very fast training over large amounts of data is the only reason to look at neural networks over very fast, very accurate systems like XGBoost. If something doesn't deliver that, then it's worth pointing out that it is inadequate for anything but toy tasks.

It's not really worth pointing this out when the thing in question is a 200 line C library. People won't be expecting it to save the world and/or butter their toast.

Re: Tinn: A tiny neural network library written in C99

#38
post #29
post #19

Just curious, is there a reason for passing around the Tinn struct by-value? Will it get optimized?

I'm curious too. Even if it will be optimized isn't it still be better to pass-by-reference?

I would expect it would depend on what the function actually did with the data.

Re: Tinn: A tiny neural network library written in C99

#40
post #29

Earlier quoted context omitted.

I'm curious too. Even if it will be optimized isn't it still be better to pass-by-reference?

It might be easier to answer if you explained why you think it would be better. There may be cases where by-reference (yes, that's an absolutely acceptable thing to say, even in C) is more efficient: If the struct is a kind of "this pointer" (as in object-oriented programming) that is passed to a bunch of functions but relatively rarely used , then passing it by reference causes much less register pressure. Passing i…

> There may be cases where by-reference (yes, that's an absolutely acceptable thing to say, even in C)

I don't want to be nit-picking. But I would like to know why "by-reference" is an acceptable thing to say.

When I learnt C, C++, Java, etc. I was repeatedly told that pass by reference exists only in C++. In C, a pointer is passed by value. In Java, a reference is passed by value.

Doesn't calling "pass pointer by value" as "pass by reference" lead to confusion and distortion of the true meaning of "by reference"?

Post reply on HN