sabakihq / gtp Goto Github PK
View Code? Open in Web Editor NEWA Node.js module for handling GTP engines.
License: MIT License
A Node.js module for handling GTP engines.
License: MIT License
Hi, thanks for this awesome library.
I'm testing it with leela-zero and I'm wondering how to use it with the lz-analyze
command. If I check leelaz logs, I see a list of possible plays with their continuations, and what I think are winrates:
>>lz-analyze
=
NN eval=0.464540
S6 -> 318 (V: 25.03%) (LCB: 21.75%) (N: 57.42%) PV: S6 S4 S7 P8 K11 R9 S9 S10 S11 R11 R2 S2 R10 M12 L12 R11 S1
O8 -> 135 (V: 26.38%) (LCB: 21.20%) (N: 12.21%) PV: O8 O9 S6 S4 P8 Q8 Q9 R9 P9 R8 K11 M12 L13
Q9 -> 18 (V: 20.52%) (LCB: 10.47%) (N: 7.76%) PV: Q9 P8 S6 S4 S7 R9 S9 R8
S4 -> 17 (V: 23.62%) (LCB: 10.62%) (N: 3.93%) PV: S4 S3 S6 T4 R7 Q6 O8 O9 P8 Q8 Q9 R9 P9 R8 K11
R2 -> 6 (V: 18.50%) (LCB: 0.00%) (N: 3.16%) PV: R2 S3 R3 Q4 S4
R3 -> 4 (V: 15.71%) (LCB: 0.00%) (N: 2.29%) PV: R3 S3 R2 Q4
P8 -> 4 (V: 15.65%) (LCB: 0.00%) (N: 2.37%) PV: P8 Q8 S6 S4
But I don't get any of that information in node. Is there some way to handle this?
Thanks!
Hello?
As I'm not a programmer so am not sure about this, but my idea is as follows.
If it'll be possible please let me know how to do it.
It'll gonna be great if possible.
Cheers,
Leela Zero's printsgf command dumps the SGF with many newlines. But GTP response in this lib only has the first line, which doesn't even contain any moves...
const file = "./leelaz.exe";
const args = [ "-g", "-q", "--noponder", "-w ./network.gz" ];
const leela = new Controller(file, args);
leela.start();
const {id, content, error} = await leela.sendCommand({name: "genmove", args: ["B"]});
if (error) throw new Error("Leela throwed an error!");
console.log(content);
await leela.stop();
When I run this example, I just get an UnhandledPromiseRejectionWarning: Error: GTP engine has stopped
error message.
By contrast, when I execute the ./leelaz.exe -g -q --noponder -w ./network.gz
command directly from the commandline I get a working GTP session, and can perform the genmove and even get an answer.
I'm just getting started with this, so I'm probably missing something obvious.
I tried adding / removing the "-q" option to make the other debug output silent.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.