clean up
This commit is contained in:
1 parent
5ed38554ec
commit
f97586a0d4
7 files changed
+22
-17
No files matched your search
@@ -58,6 +58,7 @@ but has since grown to include a wide range of features, including:
|
|||||||
## Manual
|
## Manual
|
||||||
|
|
||||||
### Play
|
### Play
|
||||||
|
|
||||||
Under the 'play' tab you can select who is playing black and white.
|
Under the 'play' tab you can select who is playing black and white.
|
||||||
* Human is simple play with potential feedback, but without auto-undo.
|
* Human is simple play with potential feedback, but without auto-undo.
|
||||||
* Teach will give you instant feedback, and auto-undo bad moves to give you a second chance.
|
* Teach will give you instant feedback, and auto-undo bad moves to give you a second chance.
|
||||||
@@ -80,6 +81,7 @@ In short, if you are a weaker player you should mostly on large dots that are re
|
|||||||
while stronger players can pay more attention to smaller mistakes.
|
while stronger players can pay more attention to smaller mistakes.
|
||||||
|
|
||||||
#### AIs
|
#### AIs
|
||||||
|
|
||||||
Available AIs, with strength indicating an estimate for the default settings, are:
|
Available AIs, with strength indicating an estimate for the default settings, are:
|
||||||
|
|
||||||
* **[9p+]** **Default** is full KataGo, above professional level.
|
* **[9p+]** **Default** is full KataGo, above professional level.
|
||||||
@@ -115,7 +117,6 @@ Keyboard shortcuts are shown with **[key]**.
|
|||||||
* **[s]**: Equalize: Re-evaluate all currently shown next moves with the same visits as the current top move. Useful to increase confidence in the suggestions with high uncertainty.
|
* **[s]**: Equalize: Re-evaluate all currently shown next moves with the same visits as the current top move. Useful to increase confidence in the suggestions with high uncertainty.
|
||||||
* **[d]**: Sweep: Evaluate all possible next moves. This can take a bit of time even though 'fast_visits' is used, but the result is nothing if not colourful.
|
* **[d]**: Sweep: Evaluate all possible next moves. This can take a bit of time even though 'fast_visits' is used, but the result is nothing if not colourful.
|
||||||
|
|
||||||
|
|
||||||
## Keyboard and mouse shortcuts
|
## Keyboard and mouse shortcuts
|
||||||
|
|
||||||
In addition to shortcuts mentioned above, there are:
|
In addition to shortcuts mentioned above, there are:
|
||||||
@@ -136,7 +137,6 @@ In addition to shortcuts mentioned above, there are:
|
|||||||
* **[Ctrl-n]**: Load SGF from clipboard
|
* **[Ctrl-n]**: Load SGF from clipboard
|
||||||
* **[space]**: Pass
|
* **[space]**: Pass
|
||||||
|
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
Configuration is stored in `config.json`. Most settings are now available to edit in the program, but some advanced options are not.
|
Configuration is stored in `config.json`. Most settings are now available to edit in the program, but some advanced options are not.
|
||||||
@@ -173,9 +173,12 @@ If you ever need to reset to the original settings, simply re-download the `conf
|
|||||||
* The first startup of KataGo can be slow due to GPU tuning, after that it should be much faster.
|
* The first startup of KataGo can be slow due to GPU tuning, after that it should be much faster.
|
||||||
* The program is running too slowly. How can I speed it up?
|
* The program is running too slowly. How can I speed it up?
|
||||||
* Adjust the number of visits or maximum time allowed in the settings.
|
* Adjust the number of visits or maximum time allowed in the settings.
|
||||||
|
* KataGo crashes with out of memory errors, how can I prevent this?
|
||||||
|
* Try using a lower number for `nnMaxBatchSize` in `KataGo/analysis_config.cfg`, and avoid using the board size 29 version.
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
* Feedback and pull requests are both very welcome.
|
* Feedback and pull requests are both very welcome.
|
||||||
* For suggestions and planned improvements, see the 'issues' tab on github.
|
* For suggestions and planned improvements, see the 'issues' tab on github.
|
||||||
* You can also contact me on discord (Sander#3278) or [reddit](http://reddit.com/u/sanderbaduk) to give feedback, or simply show your appreciation.
|
* You can also contact me on discord (Sander#3278) or [reddit](http://reddit.com/u/sanderbaduk) to give feedback, or simply show your appreciation.
|
||||||
|
|
||||||
+1
-1
@@ -15,7 +15,7 @@ if True or bot in ["dev", "local"]:
|
|||||||
else:
|
else:
|
||||||
GTP2OGS = "node ../stable-gtp2ogs"
|
GTP2OGS = "node ../stable-gtp2ogs"
|
||||||
BOT_SETTINGS = f" --maxconnectedgames {MAXGAMES} --maxhandicapunranked 25 --maxhandicapranked 1 --boardsizesranked 19 --boardsizesunranked all --komisranked automatic,5.5,6.5,7.5 --komisunranked all"
|
BOT_SETTINGS = f" --maxconnectedgames {MAXGAMES} --maxhandicapunranked 25 --maxhandicapranked 1 --boardsizesranked 19 --boardsizesunranked all --komisranked automatic,5.5,6.5,7.5 --komisunranked all"
|
||||||
if 'beta' in bot:
|
if "beta" in bot:
|
||||||
BOT_SETTINGS += " --beta"
|
BOT_SETTINGS += " --beta"
|
||||||
else:
|
else:
|
||||||
BOT_SETTINGS += " --rankedonly"
|
BOT_SETTINGS += " --rankedonly"
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"katago": "KataGo/katago-bs",
|
"katago": "KataGo/katago-bs",
|
||||||
"model": "KataGo/models/b15-1.3.2.txt.gz",
|
"model": "KataGo/models/b15-1.3.2.txt.gz",
|
||||||
"config": "KataGo/analysis_config.cfg",
|
"config": "KataGo/analysis_config.cfg",
|
||||||
"threads": 8,
|
"threads": 16,
|
||||||
"max_visits": 500,
|
"max_visits": 500,
|
||||||
"fast_visits": 50,
|
"fast_visits": 50,
|
||||||
"max_time": 3.0,
|
"max_time": 3.0,
|
||||||
|
|||||||
+2
-2
@@ -212,7 +212,7 @@ class SGFNode:
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def next_player(self):
|
def next_player(self):
|
||||||
if "B" in self.properties or "AB" in self.properties: # root or black moved
|
if "B" in self.properties or "AB" in self.properties: # root or black moved
|
||||||
return "W"
|
return "W"
|
||||||
else:
|
else:
|
||||||
return "B"
|
return "B"
|
||||||
@@ -222,7 +222,7 @@ class SGFNode:
|
|||||||
if "B" in self.properties or "AB" in self.properties:
|
if "B" in self.properties or "AB" in self.properties:
|
||||||
return "B"
|
return "B"
|
||||||
else:
|
else:
|
||||||
return "W" # nb root is considered white played if no handicap stones are placed
|
return "W" # nb root is considered white played if no handicap stones are placed
|
||||||
|
|
||||||
|
|
||||||
class SGF:
|
class SGF:
|
||||||
|
|||||||
@@ -179,6 +179,7 @@ class ConfigPopup(QuickConfigGui):
|
|||||||
if not old_proc:
|
if not old_proc:
|
||||||
self.katrain.game.analyze_all_nodes() # old engine was broken, so make sure we redo any failures
|
self.katrain.game.analyze_all_nodes() # old engine was broken, so make sure we redo any failures
|
||||||
self.katrain.update_state()
|
self.katrain.update_state()
|
||||||
|
|
||||||
Clock.schedule_once(restart_engine, 0)
|
Clock.schedule_once(restart_engine, 0)
|
||||||
|
|
||||||
self.katrain.debug_level = self.config["debug"]["level"]
|
self.katrain.debug_level = self.config["debug"]["level"]
|
||||||
|
|||||||
+7
-3
@@ -7,6 +7,7 @@ from core.common import OUTPUT_INFO
|
|||||||
from core.engine import KataGoEngine
|
from core.engine import KataGoEngine
|
||||||
from core.game import Game, KaTrainSGF
|
from core.game import Game, KaTrainSGF
|
||||||
|
|
||||||
|
start = time.time()
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
exit(1)
|
exit(1)
|
||||||
inputfile = sys.argv[1]
|
inputfile = sys.argv[1]
|
||||||
@@ -18,9 +19,10 @@ with open("config.json") as f:
|
|||||||
game_settings = settings["game"]
|
game_settings = settings["game"]
|
||||||
trainer_settings = settings["trainer"]
|
trainer_settings = settings["trainer"]
|
||||||
|
|
||||||
#engine_settings['threads'] = 32
|
# engine_settings['threads'] = 32
|
||||||
engine_settings["max_time"] = 1000
|
engine_settings["max_time"] = 1000
|
||||||
|
|
||||||
|
|
||||||
class Logger:
|
class Logger:
|
||||||
def log(self, msg, level):
|
def log(self, msg, level):
|
||||||
if level <= OUTPUT_INFO:
|
if level <= OUTPUT_INFO:
|
||||||
@@ -32,11 +34,13 @@ logger = Logger()
|
|||||||
engine = KataGoEngine(logger, engine_settings)
|
engine = KataGoEngine(logger, engine_settings)
|
||||||
move_tree = KaTrainSGF.parse_file(inputfile)
|
move_tree = KaTrainSGF.parse_file(inputfile)
|
||||||
game = Game(logger, engine, game_settings, move_tree=None, analyze_fast=True)
|
game = Game(logger, engine, game_settings, move_tree=None, analyze_fast=True)
|
||||||
game.root=move_tree
|
game.root = move_tree
|
||||||
reverse_nodes = game.root.nodes_in_tree[::-1]
|
reverse_nodes = game.root.nodes_in_tree[::-1]
|
||||||
|
|
||||||
for n in reverse_nodes[::10]:
|
for n in reverse_nodes[::10]:
|
||||||
n.analyze(engine=engine)
|
n.analyze(engine=engine)
|
||||||
while not n.analysis_ready:
|
while not n.analysis_ready:
|
||||||
time.sleep(0.01)
|
time.sleep(0.01)
|
||||||
print(n.single_move,'done')
|
print(n.single_move, "done")
|
||||||
|
|
||||||
|
print(time.time() - start, "s")
|
||||||
@@ -7,6 +7,7 @@ from core.common import OUTPUT_INFO
|
|||||||
from core.engine import KataGoEngine
|
from core.engine import KataGoEngine
|
||||||
from core.game import Game, KaTrainSGF
|
from core.game import Game, KaTrainSGF
|
||||||
|
|
||||||
|
start = time.time()
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
exit(1)
|
exit(1)
|
||||||
inputfile = sys.argv[1]
|
inputfile = sys.argv[1]
|
||||||
@@ -18,11 +19,11 @@ with open("config.json") as f:
|
|||||||
game_settings = settings["game"]
|
game_settings = settings["game"]
|
||||||
trainer_settings = settings["trainer"]
|
trainer_settings = settings["trainer"]
|
||||||
|
|
||||||
engine_settings['threads'] = 16
|
engine_settings["threads"] = 16
|
||||||
#engine_settings['katago'] = 'KataGo/katago-bs'
|
|
||||||
engine_settings["max_time"] = 1000
|
engine_settings["max_time"] = 1000
|
||||||
engine_settings["max_visits"] = 50
|
engine_settings["max_visits"] = 50
|
||||||
|
|
||||||
|
|
||||||
class Logger:
|
class Logger:
|
||||||
def log(self, msg, level):
|
def log(self, msg, level):
|
||||||
if level <= OUTPUT_INFO:
|
if level <= OUTPUT_INFO:
|
||||||
@@ -41,9 +42,5 @@ while remaining > 0:
|
|||||||
print(f"Waiting for {remaining} queries")
|
print(f"Waiting for {remaining} queries")
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
msg = game.write_sgf(
|
msg = game.write_sgf(sgf_settings["sgf_save"], trainer_config=trainer_settings, save_feedback=sgf_settings["save_feedback"], eval_thresholds=trainer_settings["eval_thresholds"])
|
||||||
sgf_settings["sgf_save"],
|
print(time.time() - start, "s")
|
||||||
trainer_config=trainer_settings,
|
|
||||||
save_feedback=sgf_settings["save_feedback"],
|
|
||||||
eval_thresholds=trainer_settings["eval_thresholds"],
|
|
||||||
)
|
|
||||||
Reference in new issue
Block a user