Code Monkey home page Code Monkey logo

ray's Introduction

Installation

  1. 'cd' to the directory which includes 'Makefile'
  2. Type 'make' to compile

How to run

By default settings, Ray will consume 10 seconds each move on a single CPU and require 800MB of memory.

./ray

Ray has some options :

Setting the total number of playouts per move (3000 PO/move). Default is 10000.

./ray --playout 3000

Ray plays with time settings 30:00 (1800 seconds).

./ray --time 1800       

Ray runs on 13x13. Default is 19x19 (Maximum is also 19x19). You can ignore it if GTP sends 'boardsize' command.

./ray --size 13         

Ray considers 5 seconds each move.

./ray --const-time 5

Setting the number of threads. Default is 1 (Maximun is 32).

./ray --thread 4

Setting komi value. Default is 6.5. You can ignore this command if GTP sends 'komi' command.

./ray --komi 7.5        

Setting the number of handicap stones for test. This makes Ray ignore komi command from GTP.

./ray --handicap 4      

This makes Ray use subtree if it exist. Default is off. This command saves Ray's remaining time.

./ray --reuse-subtree   

This makes Ray think during the opponent's turn. (Automatically, this command turns 'reuse-subtree mode' on)

./ray --pondering

Setting the number of uct nodes. Default is 16384. If you want to run Ray with many threads and a long time setting, I recommend you to use this command. The number of nodes must be 2^n.

./ray --tree-size

Ray never print Ray's log.

./ray --no-debug        

Ray avoids positional-superko move.

./ray --superko         

e.g.

Playing with 4 sec/move with 8 threads

./ray --const-time 4 --thread 8

Playing with 1000 playouts/move with 1 threads

./ray --playout 1000

Playing with 16 threads and 65536 uct nodes. Time setting is 30 minutes. Ray thinks during the opponent's turn.

./ray --time 1800 --thread 16 --tree-size 65536 --pondering

License

Ray is distributed under the BSD License. Please see the "COPYING" file.

Contact

[email protected] (Yuki Kobayashi)

ray's People

Contributors

k-matsuzaki avatar kobanium avatar y-ich avatar zakki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ray's Issues

Displaying good (but not best) sequences in terminal

Hi zakki,

I am the author of GoReviewPartner, a tool that uses Go bots to review games. (code is on github) It currently works pretty well using Leela or GnuGo.

I very interested in adding support for Ray (also, it's a recurring request on L19). I had a look recently, using Ray rn-3.11.1, to check what information are available in the terminal for me to parse and extract. The most interesting part is the "best sequence", for example:
Best Sequence : Q4<BLACK : 210/413><28.3493/57>->R16<WHITE : 60/111><6.92834/14> as on this screenshot.

Would it be possible to display in a similar way additional sequences investigated by Ray during MCTS, together with winning % ?

Why CPU_only version so weak?

Hi zakki,

I noticed that the CGOS rn-3.9 only has 4 cpu with no GPU. Rn.3.9-4c ranked only second to Zen.

In my own testing, the DGS bot I set up has 1 GPU with 50000 playout, 2 threads in ray command option. The strength is very strong at 6d ranking now at DGS. However, the same playout number in CPU only linux machine yielded a much weaker bot, possibly several stones weaker than the GPU version. My CPU only set up is as below:
./ray --no-gpu --thread 2 --playout 50000

at 2 CPU 4 CPU like below:
./ray --no-gpu --thread 4 --playout 50000

Both CPU only has 4G memory.

I would thought the same number of playout should generate same strength regardless of GPU or CPU. Why is the difference on strength?

Shoreline

Are there updates to te model?

I've seen changes of code from Rn 3.6 to 3.11, but the model.bin seems stable. Are there updates of the trained model?

Using too much time on a move

A fellow user of OGS has been running RayN there for a bit. He's finding that it will often use more time to think than he has actually set it to. This, of course, can cause losses due to timeouts. As a work around he has set RayN to move in 10 seconds or less per move but a minimum byoyomi period of 30 seconds.

As the game gets later, it will tend to use more time than then 10 seconds. He's seen it go over 30 seconds even 4 times in a match but thankfully no timeout losses since the matches are 5 periods of 30 seconds by default.

We also did some testing in blitz games vs other bots, and with a 1 second per move target, late game RayN might be taking 7-8 seconds per move.

I think you are god

Rn(strong 8d) >>>> Zen6 analysis mode(middle 8d) >>>>>>>>>> Leela(this dude doesn't know "what is ladder 逐")

Use SoftMax policy and cntk files

I would like to know release rn.4.2.5 have use SoftMax policy?
What is the use of add cntk files?
It seems that the compiler will not use this file

Please ignore some weird people

I really love this project, and appreciate your efforts to make Rn.

btw, I'm planning to contribute my analysis mode GUI of Rn.

Is it okay to do? and how to share my works? Do you have any good idea?

Suggestion for solving endgame problem

Ray or many go ai has endgame problem except alphago.
I suggest some idea.
Make new command for endgame.
In particular part of game, with endgame command Ray use only counting result search.
Best candidate is selected for maximum counting result.
Or ray's neural network plus maximum counting search will be good choice for good endgame performance.
Is it possible?

slower than before

old version Rn was about 14000 / s playouts

new version Rn is about 9000-10000 /s playouts.

is this right situation?

furthermore . new version RN has delay and excess time limit many times.

New version Rn has better policy than old version and has also good endgame style but has so many life and death bugs than before.

many life and death bugs r critical.

what is ur opinion about life and death bugs of new Rn version(Rn 4...)
I tested many times..new version Rn has 10times worse than old version in life and death.
I am not sure the exact result..but i think u changed some life and death policy.

Questions about the project

  • How is the model trained? Is there a way we train the model ourselves or improve it?
  • Is there a TODO list for the project?
  • Is it possible to pack it with just a few libraries and an executive for release?

Breaking playout limit

As you know, I'm making Analysis Mode GUI of Rn.
In this case, breaking playout limit is important thing.
Because user may want to analyze more than tree size limit.

So I made max heap of nodes sorted by depth,
and made it remove 20000 deepest nodes from memory
whenever nodes are more than tree size - 20000.
(Of course, removed nodes are unlinked from parent nodes before it's removed)

Is it good idea?

Install on mac

Is it possible to build the program on mac os since CNTK is not available on those?

Cant fin EvalDll.dll

When I open Rn.4.2.5.exe it said that my computer loss EvalDll.dll
And I cant find EvalDll.dll on the internet

About training with sgf files..

I read ur post about training with sgf file.
Where can I find sgf files to Gtp files converter? Any recommend?
Sorry for silly question.

What is best value number for policy batch size and value batch size?

I have I7 6900k 16thread and GTX1080ti GPU 32G DDR4 ram.

Current value number of policy and value batch size is 16 and 64.

I heard value batch size 128 is best in performance in other Deep learning community.

If I change value number , is performance or strengh of Ray will be stronger?

and..then how will be thinking time of ray ?

also..what is best value number in my system?

where are the "Eval.h"?

when I built "win/ray.sln" in visual studio 2017,it have a problem:
1>....\src\UctSearch.cpp(43): fatal error C1083: 无法打开包括文件: “Eval.h”: No such file or directory

how to solve this?

Missing Eval.h

Hi,
I've tried to build this project but it turns out it lost a header file "Eval.h".
I can't find it in the src/ directory,
Do I miss something?

Thanks!

about sgf files for training

HI,zakki
How many KGS/GoGod/Tygem sgf files are used for training Policy Network and Value Network? (to generate the model file(Ray-rn-4.2.5\uct_params\model.bin,model2.bin)).
Can these sgf files be shared with us?

SLI error

Single gpu no problem.
But when I use gpu sli I got error.
Can I solve this problem?
I use window 10 .

some command question

no-expand command use only nn without MCTS.

but that command don use gpu.

gpu load is 0%.

is it right situation?

What do you think If I make Rn's Analysis Mode GUI?

Hi, zakki.

I'm enthusiastic for both of computer Go engines and computer programming.

I'm trying to make Rn's Analysis Mode GUI, something like Leela's one.

My goal is to make a rich analysis mode of Rn, which is way better than Leela's.

But I think this structure is too big, so it can't store many nodes on memory.

// 9x9 : 1828bytes
// 13x13 : 3764bytes
// 19x19 : 7988bytes
struct uct_node_t {
int previous_move1; // 1手前の着手
int previous_move2; // 2手前の着手
std::atomic move_count;
std::atomic win;
int width; // 探索幅
int child_num; // 子ノードの数
child_node_t child[UCT_CHILD_MAX]; // 子ノードの情報
statistic_t statistic[BOARD_MAX]; // 統計情報
bool seki[BOARD_MAX];
bool evaled;
//std::atomic value;
std::atomic value_move_count;
std::atomic value_win;
};

Do you have any idea about reducing this structure's size?

Thank you for reading my article.

ZS

Multiple copies at once

Is it a limitation of the CNTK library, or something that Ray needs to handle differently, for multiple copies to run simultaneously?

Unable to compile in Ubuntu 14.04?

I was trying to compile the RN 3.9 in Ubuntu linux 14.04 but failed. What did I do wrong here?
Any help would be greatly appreciated.

Here is detailed information:
Hardware: dual core Indel box, Ubuntu 14.04 64 bits. 1 GPU with GTX 1050
CUDA/torch/cntk all dependency were compiled and installed with no errors.

g++ version 4.8

In the compilation of RN 3.9 source code after make, below are the errors:
------skipped---------------
g++ -O3 -Wall -std=c++11 -g -c src/Point.cpp -o src/Point.o
g++ -O3 -Wall -std=c++11 -g -c src/Rating.cpp -o src/Rating.o
src/Rating.cpp: In function \u2018int RatingMove(game_info_t*, int, std::mt19937_64*, LGR&)\u2019:
src/Rating.cpp:290:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (((*mt)() % 100) < tgr1_rate && game->moves > 0) {
^
src/Rating.cpp:291:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_total;
^
src/Rating.cpp:292:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_hit;
^
src/Rating.cpp:293:30: error: \u2018lgr_total\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_total, 1);
^
src/Rating.cpp:298:25: error: \u2018lgr_hit\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_hit, 1);
^
src/Rating.cpp:304:30: error: \u2018lgr_hit\u2019 was not declared in this scope
cerr << "TGR1 " << (100.0 * lgr_hit / lgr_total) << "%" << std::endl;
^
src/Rating.cpp:307:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (((*mt)() % 100) < lgrf1_rate && game->moves > 0) {
^
src/Rating.cpp:308:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_total;
^
src/Rating.cpp:309:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_hit;
^
src/Rating.cpp:310:30: error: \u2018lgr_total\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_total, 1);
^
src/Rating.cpp:314:25: error: \u2018lgr_hit\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_hit, 1);
^
src/Rating.cpp:320:31: error: \u2018lgr_hit\u2019 was not declared in this scope
cerr << "LGRF1 " << (100.0 * lgr_hit / lgr_total) << "%" << std::endl;
^
src/Rating.cpp:325:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_total;
^
src/Rating.cpp:326:14: error: \u2018atomic_int64_t\u2019 in namespace \u2018std\u2019 does not name a type
static std::atomic_int64_t lgr_hit;
^
src/Rating.cpp:327:30: error: \u2018lgr_total\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_total, 1);
^
src/Rating.cpp:332:25: error: \u2018lgr_hit\u2019 was not declared in this scope
std::atomic_fetch_add(&lgr_hit, 1);
^
src/Rating.cpp:339:29: error: \u2018lgr_hit\u2019 was not declared in this scope
cerr << "LGRF2 " << (100 * lgr_hit / lgr_total) << "%" << std::endl;
^
make: *** [src/Rating.o] Error 1

Previous-passed-policy experiment

How about this experiment?

Not using only pure policy network as policy, also using policy network output of previous move, but for my turn(enemy passed).
I did this experiment to some other commercial Go engine, by hacking its engine. and made it like more tenukis than before.

It should be fun to try.

Linux mint installation not working

The error I'm getting is:
src/UctSearch.cpp:41:18: fatal error: Eval.h: No such file or directory
#include "Eval.h"

compilation terminated.

Any clue how I can fix this?

Gogui analysis

Can u make gogui analysis mode for 3.11?
I wanna some test.
Rn 3.11 has some bugs and weak end game.
But it has fast speed advantage compared to rn4.25. I want some tests with 3.11 gogui analysis.
Really thx for ur efforts.

I think it's better to simplify the GTP Shell

I like to refer the GTP Shell. But at the present time, reading the contents of Rayon's GTP Shell is somewhat difficult. In my opinion, game board at the GTP Shell is unnecessary and it is degrading readability.

Also, when using the pondering option, there is no need to show the long-line computer thinking.(currently, it shows every data(on average, 20~40lines) per 1000 counts - like 180000,181000,182000'''. totally hundreds and thousands of long lines per each move)

I think we can simplify and make clear the information of GTP Shell. And it'll enhance the efficiency for user's game analysis.

I run ray throwing an error! help me

(/root/anaconda3/envs/cntk-py35) root@leenux:/Ray# ./ray
Init CNTK
terminate called after throwing an instance of 'Microsoft::MSR::CNTK::ExceptionWithCallStackstd::runtime_error'
what(): no closing " found in parameters
已放弃 (核心已转储)
(/root/anaconda3/envs/cntk-py35) root@leenux:
/Ray#

I wonder it's optimal to evaluate VN like now

Currently, RN evaluates value network by calculating simple average.
But I'm wondering if it's optimal policy.
As you know, deeper node values have less error than shallower ones.
and later values are more accurate than earlier ones (since later reading is more precise).
Hence I suppose you not to calculate simple average, but average with some heuristics.
For example, I think we can try some moving average algorithms and some hand-crafted adjusting heuristics(i.e. emphasizing losing values when winning much).
I want to discuss about this.

How to run Rn on board 9*9

I can't run Rn on board 9*9, I set the boardsize to 9, but when it genmove b or w,it closed automatically,how can I solve it? Thanks.
image

Oh my god jesus christ!! RN4.2 is not just "go AI". wow

it's revolution and the origin of skynet, i think!!

oh my god, it is slaughtering all of 9D progamers. holly shit!!

nobody cannot stop me! oh my goodness... :D :D :D

i think it will threaten "all of human mankind" beyond the Go-board soon... holy holy ...

👍 👍 👍 👍 👍 👍 👍 👍

RN 4.2 = Alphago 🥇 >>>>>>>>>>>>>> Deepzengo=Fineart 👎👎 👎

Can you add alphago's joseki?

as you may know, alphago showed us new lots of joseki when it played "go" at the tygem(Korea baduk site) and foxwq(China weiqi site).

and if you need records of them(60games sgf files), i can send you.

Plus, if you need Fineart(China AI)'s game records(sgf files), either i can send them to you too.(maybe over 100games)

"EVAL QUEUE FULL " error

hi:
i use 3.10.2.7 " EVAL QUEUE FULL" error occurred ,compute very slowly.why ? please help me.
thank you!

GTP command info:

--thread 4 --playout 15000 --no-debug
list_commands
Init CNTK
ok

boardsize
clear_board
name
protocol_version
genmove
play
known_command
list_commands
quit
komi
get_komi
final_score
time_settings
time_left
version
genmove_black
genmove_white
black
white
showboard
final_status_list
fixed_handicap
place_free_handicap
set_free_handicap
kgs-genmove_cleanup
features_planes_file
_clear
_store
_dump
_stat

boardsize 19

=

komi 6.5

clear_board

play b Q16

genmove w
EVAL QUEUE FULL
EVAL QUEUE FULL
--playout 15000 --no-debug
name
Init CNTK
ok
= Rayon

version
= 8.0.1

list_commands

boardsize
clear_board
name
protocol_version
genmove
play
known_command
list_commands
quit
komi
get_komi
final_score
time_settings
time_left
version
genmove_black
genmove_white
black
white
showboard
final_status_list
fixed_handicap
place_free_handicap
set_free_handicap
kgs-genmove_cleanup
features_planes_file
_clear
_store
_dump
_stat

--playout 15000 --no-debug
list_commands
Init CNTK
ok

boardsize
clear_board
name
protocol_version
genmove
play
known_command
list_commands
quit
komi
get_komi
final_score
time_settings
time_left
version
genmove_black
genmove_white
black
white
showboard
final_status_list
fixed_handicap
place_free_handicap
set_free_handicap
kgs-genmove_cleanup
features_planes_file
_clear
_store
_dump
_stat

boardsize 19

=

komi 6.5

clear_board

play b Q16

genmove w
EVAL QUEUE FULL
EVAL QUEUE FULL
EVAL QUEUE FULL
10000.D17: move 412 policy 10.6269 DP: 46.6019 DV: 49.9905 => 48.2962 0.499196 V:0.499905 LM:0.5 P:0.482962 UCB:0.508693
10000.O17: move 12 policy 0.281536 DP: 33.3333 DV: 48.7059 => 41.0196 0.499196 V:0.487059 LM:0.5 P:0.410196 UCB:0.487119
10000.C16: move 445 policy 0.834121 DP: 51.6854 DV: 49.5561 => 50.6208 0.499196 V:0.495561 LM:0.5 P:0.506208 UCB:0.50845
10000.D16: move 2192 policy 19.7469 DP: 50.3193 DV: 49.722 => 50.0207 0.499196 V:0.49722 LM:0.5 P:0.500207 UCB:0.509211
10000.R14: move 19 policy 0.244599 DP: 42.1053 DV: 49.5788 => 45.842 0.499196 V:0.495788 LM:0.5 P:0.45842 UCB:0.50842
10000.R11: move 62 policy 0.0012854 P:0.491534 UCB:0.507407
10000. R5: move 55 policy 1.08102 DP: 49.0909 DV: 48.1236 => 48.6073 0.499196 V:0.481236 LM:0.5 P:0.486073 UCB:0.505376
10000. C4: move 180 policy 1.35077 DP: 50.5556 DV: 49.5288 => 50.0422 0.499196 V:0.495288 LM:0.5 P:0.500422 UCB:0.507885
10000. D4: move 3853 policy 31.734 DP: 50.0389 DV: 50.0982 => 50.0686 0.499196 V:0.500982 LM:0.5 P:0.500686 UCB:0.50892
10000. Q4: move 2401 policy 18.2844 DP: 50.3957 DV: 49.8713 => 50.1335 0.499196 V:0.498713 LM:0.5 P:0.501335 UCB:0.508947
10000. R4: move 193 policy 7.638 DP: 43.5233 DV: 50.1549 => 46.8391 0.499196 V:0.501549 LM:0.5 P:0.468391 UCB:0.507762
10000. D3: move 81 policy 1.37161 DP: 49.3827 DV: 48.6334 => 49.0081 0.499196 V:0.486334 LM:0.5 P:0.490081 UCB:0.506808
10000. Q3: move 95 policy 0.571203 DP: 48.4211 DV: 50.9184 => 49.6697 0.499196 V:0.509184 LM:0.5 P:0.496697 UCB:0.507114
EVAL QUEUE FULL
EVAL QUEUE FULL
Eval NN Policy : 933
Eval NN Value : 2501
Eval NN : 896/2496
Count Captured : 0
Score : -4.5
= Q4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.