Are neural nets (the weights file) copyrightable?

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Are neural nets (the weights file) copyrightable?

Post by Michel »

dkappe wrote: Mon Feb 22, 2021 5:49 pm
Michel wrote: Mon Feb 22, 2021 5:42 pm
dkappe wrote: Mon Feb 22, 2021 5:22 pm My understanding is that ChessBase is distributing a slightly modified stockfish and providing the source code. Is that not the case?
As I see it they are distributing a modified SF and another program (the net) which is loaded into SF's address space and which is vital for SF to work properly. With this reasoning the net distributed by ChessBase falls under the GPL (just like a dll would).

People claim that the because the net is not directly executed by the CPU but instead is interpreted by SF it is exempt from the GPL. I do not buy this. I consider the method by which code is translated into actions irrelevant.
The GPL FAQ is your friend. https://www.gnu.org/licenses/gpl-faq.html
If a programming language interpreter is released under the GPL, does that mean programs written to be interpreted by it must be under GPL-compatible licenses?

When the interpreter just interprets a language, the answer is no. The interpreted program, to the interpreter, is just data; a free software license like the GPL, based on copyright law, cannot limit what data you use the interpreter on. You can run it on any data (interpreted program), any way you like, and there are no requirements about licensing that data to anyone.

However, when the interpreter is extended to provide “bindings” to other facilities (often, but not necessarily, libraries), the interpreted program is effectively linked to the facilities it uses through these bindings. So if these facilities are released under the GPL, the interpreted program that uses them must be released in a GPL-compatible way. The JNI or Java Native Interface is an example of such a binding mechanism; libraries that are accessed in this way are linked dynamically with the Java programs that call them. These libraries are also linked with the interpreter. If the interpreter is linked statically with these libraries, or if it is designed to link dynamically with these specific libraries, then it too needs to be released in a GPL-compatible way.

Another similar and very common case is to provide libraries with the interpreter which are themselves interpreted. For instance, Perl comes with many Perl modules, and a Java implementation comes with many Java classes. These libraries and the programs that call them are always dynamically linked together.

A consequence is that if you choose to use GPLed Perl modules or Java classes in your program, you must release the program in a GPL-compatible way, regardless of the license used in the Perl or Java interpreter that the combined Perl or Java program will run on.
I’ve dump one of my networks in a hex editor and been over the nnue code. I don’t see anywhere where the network is making a call or binding to code in the binary. Is that not correct?
I have explained my point and you do not address it. So it seems you are just trolling. I have better things to do than continuing this discussion.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
gonzochess75
Posts: 208
Joined: Mon Dec 10, 2018 3:29 pm
Full name: Adam Treat

Re: Are neural nets (the weights file) copyrightable?

Post by gonzochess75 »

dkappe wrote: Mon Feb 22, 2021 5:52 pm
gonzochess75 wrote: Mon Feb 22, 2021 5:47 pm It is not reality, but your own ignorance that is getting in the way. Try asking yourself... is the CC0 a GPL compatible license? Oh wait it is??!! That means that they've adhered to the GPL just like they must??!!!

But wait, did CB distribute FF2 net under CC0?? NO??!!! Ok, but did they distribute it under any GPL compatible license??!!! Oops. Making sense to your very slow learning process yet???
So now you’re not making an argument, just spicing up your post with lots of punctuation and trying to turn it into a food fight. No point in engaging further.
Was actually trying to simplify it for you. It is hard for you to understand so I thought the extra exclams would help you process. The point/argument is your attempt at refuting that CB needs to adhere to GPL by pointing out that SF itself releases networks under CC0 and not GPL is totally missing the story. As I've said before in this thread ... CB needs to release their net/plugin under a GPL compatible license and you pointing out that the SF project releases their nets under a GPL compatible license does ZERO to refute that. Rather you're just providing more evidence against what CB is doing.

Did that help or you still don't understand?
dkappe
Posts: 1632
Joined: Tue Aug 21, 2018 7:52 pm
Full name: Dietrich Kappe

Re: Are neural nets (the weights file) copyrightable?

Post by dkappe »

Michel wrote: Mon Feb 22, 2021 5:53 pm I have explained my point and you do not address it. So it seems you are just trolling. I have better things to do than continuing this discussion.
OK, let me try again. The GPL FAQ addresses this explicitly. If a program operates on data, that data is not covered by the GPL. The only exceptions are enumerated under that FAQ and do not apply here.

As an example, I have made several networks available. Some people are distributing them with versions of stockfish. You are suggesting I lose my copyright because of that?
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Are neural nets (the weights file) copyrightable?

Post by Michel »

dkappe wrote: Mon Feb 22, 2021 6:02 pm
Michel wrote: Mon Feb 22, 2021 5:53 pm I have explained my point and you do not address it. So it seems you are just trolling. I have better things to do than continuing this discussion.
OK, let me try again. The GPL FAQ addresses this explicitly. If a program operates on data, that data is not covered by the GPL. The only exceptions are enumerated under that FAQ and do not apply here.

As an example, I have made several networks available. Some people are distributing them with versions of stockfish. You are suggesting I lose my copyright because of that?
As I explained a net is not data. It is a program.

Indeed a neural network is just a particular representation of a function and this is exactly the same as a program written in a conventional programming language. So you cannot distinguish between the two.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Are neural nets (the weights file) copyrightable?

Post by Michel »

dkappe wrote: Mon Feb 22, 2021 6:02 pm As an example, I have made several networks available. Some people are distributing them with versions of stockfish. You are suggesting I lose my copyright because of that?
And this is a strawman. Of course you can never lose copyright because of what other people do with your stuff.
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
dkappe
Posts: 1632
Joined: Tue Aug 21, 2018 7:52 pm
Full name: Dietrich Kappe

Re: Are neural nets (the weights file) copyrightable?

Post by dkappe »

Michel wrote: Mon Feb 22, 2021 6:06 pm As I explained a net is not data. It is a program.

Indeed a neural network is just a particular representation of a function and this is exactly the same as a program written in a conventional programming language. So you cannot distinguish between the two.
OK, I think we are getting somewhere here. If you refer to the FAQ, you’ll see that they state that programs written to be executed by a GPL’d interpreter are not generally under the GPL (they also refer to the program as being just “data,” but I think we can let that go.) So we are in agreement. The neural networks are programs to be interpreted by the chess engine (igel, sf, a0lite, etc.) and are thus not under the respective license of each chess engine.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
User avatar
hgm
Posts: 28383
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Are neural nets (the weights file) copyrightable?

Post by hgm »

gonzochess75 wrote: Mon Feb 22, 2021 5:40 pm
hgm wrote: Mon Feb 22, 2021 5:31 pm Well, it helps showing to the neutral reader you know zilch about computers, and showing you know zilch about law. You seem a pretty hopeless case, so I would certainly not expect to convince you of anything. You will just keep repeating the same nonsense as a broken record, no matter how often the knowledgeable people haf refuted you with facts.
I've written the substantial portion of a top three chess engine and meaningfully contributed to another top ten chess engine with several patches.

I've also written compilers/transcompilers for the Lambda Calculus, the SKI calculus, and even made my own toy Turing Complete languages. All licensed under the GPL btw.

For my day job part of my responsibilities include educating engineers and sales folks on the intricacies and nuances of the GPL/LGPL and commercial licensing for one of the foremost and notable companies who dual license such software. I also work on and have code in many of the devices you likely use in your everyday life including many of the cars on the road, the airplanes you fly in and the devices which might save your life if you find yourself in an emergency room/ICU due to this covid pandemic.

I've been involved with and working on GPL/LGPL software including for the better part of 20 years and have made numerous contributions to the very browser which you are using to read this message!

What have you done?
Yet you didn't know what a data-flow computer was, denied that a neural net is a kind of program, claim that data is not copyrightable...
Michel
Posts: 2292
Joined: Mon Sep 29, 2008 1:50 am

Re: Are neural nets (the weights file) copyrightable?

Post by Michel »

dkappe wrote: Mon Feb 22, 2021 6:25 pm
Michel wrote: Mon Feb 22, 2021 6:06 pm As I explained a net is not data. It is a program.

Indeed a neural network is just a particular representation of a function and this is exactly the same as a program written in a conventional programming language. So you cannot distinguish between the two.
OK, I think we are getting somewhere here. If you refer to the FAQ, you’ll see that they state that programs written to be executed by a GPL’d interpreter are not generally under the GPL (they also refer to the program as being just “data,” but I think we can let that go.) So we are in agreement. The neural networks are programs to be interpreted by the chess engine (igel, sf, a0lite, etc.) and are thus not under the respective license of each chess engine.
The FAQ is obviously written for the case where the interpreter and the interpreted program are completely independent entities.

I contend that the situation which we have here, which is that the interpreted program augments the interpreter (SF without network is 100s of Elo weaker), is not covered by the FAQ.

Look it is pretty easy. The net is a program which replaces the HCE. The HCE is covered by the GPL. Why would the net not be?
Ideas=science. Simplification=engineering.
Without ideas there is nothing to simplify.
dkappe
Posts: 1632
Joined: Tue Aug 21, 2018 7:52 pm
Full name: Dietrich Kappe

Re: Are neural nets (the weights file) copyrightable?

Post by dkappe »

Michel wrote: Mon Feb 22, 2021 6:39 pm
dkappe wrote: Mon Feb 22, 2021 6:25 pm
Michel wrote: Mon Feb 22, 2021 6:06 pm As I explained a net is not data. It is a program.

Indeed a neural network is just a particular representation of a function and this is exactly the same as a program written in a conventional programming language. So you cannot distinguish between the two.
OK, I think we are getting somewhere here. If you refer to the FAQ, you’ll see that they state that programs written to be executed by a GPL’d interpreter are not generally under the GPL (they also refer to the program as being just “data,” but I think we can let that go.) So we are in agreement. The neural networks are programs to be interpreted by the chess engine (igel, sf, a0lite, etc.) and are thus not under the respective license of each chess engine.
The FAQ is obviously written for the case where the interpreter and the interpreted program are completely independent entities.

I contend that the situation which we have here, which is that the interpreted program augments the interpreter (SF without network is 100s of Elo weaker), is not covered by the FAQ.

Look it is pretty easy. The net is a program which replaces the HCE. The HCE is covered by the GPL. Why would the net not be?
So since a0lite won’t even work without a net and is under the MIT license, that same network would be under the MIT license or whatever onerous license I put on it? Also, how do you come to a conclusion that all networks that could possibly be used with Minic would have to be under the GPL? Reading the FAQ, the getting started doc and the GPLv3, I don’t see anything that supports your theory.
Fat Titz by Stockfish, the engine with the bodaciously big net. Remember: size matters. If you want to learn more about this engine just google for "Fat Titz".
User avatar
hgm
Posts: 28383
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Are neural nets (the weights file) copyrightable?

Post by hgm »

Michel wrote: Mon Feb 22, 2021 5:42 pmPeople claim that the because the net is not directly executed by the CPU but instead is interpreted by SF it is exempt from the GPL. I do not buy this. I consider the method by which code is translated into actions irrelevant.
By that reasoning GPL'ed interpreters (or 'just-in-time compilers) could not be used to run non-GPL programs of their target language. We know that is not the case.