Giter Club home page Giter Club logo

hybrid_leelazero's Introduction

1. Hybrid_LeelaZero

Idea come from the leela zero issue #814 leela-zero/leela-zero#814

This program will auto hybrid 2 or more weight file by HybridParameter, and auto test to find the strongest hybrid weight

2. How to run

2.1 requirment

Python 3.5 or higher (https://www.python.org/)

Leela Zero (https://github.com/gcp/leela-zero)

GoGUI (https://sourceforge.net/projects/gogui/) -> Install file is here (https://sourceforge.net/projects/gogui/files/gogui/1.4.9/)

2.2 Download the Parent weights

Download leela zero weights you loved from

http://zero.sjeng.org/

http://zero.sjeng.org/networks/

And put the xxxxxxxx.gz file into parents\ fold

Just look like

parents\

   0c5522ba97ddafb9b854889451a651ef0fce19fb0e10dd6b0ba9ca1af476b793.gz

   9efb2c7a8b03f134b7f0436d6dc8aa991fe9eddea7293c7782167d0788a78964.gz

   27af5a26c264cc90ad9949b5cfccf3d03f44827e5b19b5373c181037e029e52c.gz

   ... ...

2.3 Modify the config file

Please open config.py, modify parameters:

 LEELAZERO_CMD   :  LeelaZero Command (no blank in dir)
 
 GOGUI_TWOGTP_CMD  :  GOGUI gogui-twogtp  Command (no blank in dir)
 
 MATCH_PER_GAMES  :  Match when generated N game in child
 
 MATCH_PLAYOUT  :  Match Playout to test which weight is strong
 
 MATCH_TIMES  :  Math times Count to test which weight is strong,
 
 HYBRID  :  Hybrid Parameter
     
     HybridParameter: Max 9 weight to Hybrid , if wanner more, please modify hybrid.py->gen_children
     
     RandomInherit: percent to random inherited from one parent, for Mutation porpose

It's very easy to understand, if not know , please see the program commet.

2.4 run

In windows or linux, use

 python main.py

It will do something like

 a. Generate hybrid child with Hybrid Parameter and parent weights
 
 b. Test to find the best child when generated child count > MATCH_PER_GAMES

 c. Move the best child into best\ direction

 d. Repeat STEP b and c to generate 1 best child in MATCH_PER_GAMES games

 e. At last, find the best weight in best\ direction

All the result you can see from the console output and matchlog\match.log, just like below:

----------------------------------------------------------------
-- START ROUND TO FIND THE BEST OF CHILD --
0c5-27a_1-1.txt vs 0c5-54b_1-1.txt :10(100.0%) : 0(0.0%)
0c5-27a_1-1.txt vs 0c5-9ef_1-1.txt :5(50.0%) : 5(50.0%)
0c5-27a_1-1.txt vs 27a-54b_1-1.txt :5(50.0%) : 5(50.0%)
----------------------------------------------------------------
-- MATCH WITH PARENT AND OTHER BEST WEIGHT --
0c5-27a_1-1.txt vs 0c5522ba97ddafb9b854889451a651ef0fce19fb0e10dd6b0ba9ca1af476b793.txt :10(100.0%) : 0(0.0%)
0c5-27a_1-1.txt vs 27af5a26c264cc90ad9949b5cfccf3d03f44827e5b19b5373c181037e029e52c.txt :5(50.0%) : 5(50.0%)
0c5-27a_1-1.txt vs 54bfb7b8324539c486cf191214abeb9d10dce667ba7469ac12e34069718f219a.txt :5(50.0%) : 5(50.0%)
0c5-27a_1-1.txt vs 9efb2c7a8b03f134b7f0436d6dc8aa991fe9eddea7293c7782167d0788a78964.txt :5(50.0%) : 5(50.0%)
----------------------------------------------------------------
This ROUND Hybrid Child KING is 0c5-27a_1-1.txt
----------------------------------------------------------------

hybrid_leelazero's People

Contributors

pangafu avatar

Watchers

James Cloos avatar  avatar

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.