Life In 19x19
http://www.lifein19x19.com/

New android app "BadukAI"
http://www.lifein19x19.com/viewtopic.php?f=18&t=17784
Page 14 of 27

Author:  Amigo [ Sat Nov 28, 2020 10:12 am ]
Post subject:  Re: New android app "BadukAI"

the opening book is easier, even a few moves would be good. it is also a way to make your program available to everyone, not just the “elite”. that is, almost everything that is now, move to "special settings". it remains just a game. for example 15k - 9d. when choosing, for example, 5k, the opening book and the network corresponding to the level are connected, etc.

Author:  akigo [ Sat Nov 28, 2020 11:15 am ]
Post subject:  Re: New android app "BadukAI"

I made a new version (0.19) which adds some features for solving tsumego and L&D problems with KataGo (of course there are specialized programs for that, but to my knowledge they don't run natively on android).

In the following explanation I assume that it is black's turn in the problem. The basic workflow is as follows:

1) Start KataGo with a 20b network and use AnalysisWideRootNoise=0.03 in the configuration. This widens KataGo's search so that "apparently bad" moves also receive proper attention (these contra-intuitive moves which are often the solution of a difficult problem).

2) Enter the problem position (you can use "pass" to enter several stones of the same color in a row). Make sure to end with a white stone so that it's black's turn.

3) Tap the dashed rectangle in the top row to restrict KataGo's analysis to the problem area: Set the "number of moves to restrict to region" to a high number (e.g. 30) to make sure that the whole analysis sequence is inside the problem area. Then click "Ok" and draw a rectangle on the board which includes the whole problem (by dragging from the top left corner to the bottom right one). Make it as small as possible to speed up search.

4) Tap "ponder" and wait until a clear favourite move emerges. This should be the solution.

Often this basic workflow will be sufficient. But there are some hard problems which require a little "tuning":

a) In L&D problems one side is enclosed. On an otherwise empty board this will give the enclosing side a winrate near 100% whether it kills or not. So the winrate difference between killing and non-killing moves will be very low which makes it very hard for an AI to find the killing one. To ease this you should "balance" the position by adding a few stones of the enclosed side in the empty corners.

b) In some L&D problems the outside is not completely solid, so that it requires some reading to see that breaking through is impossible. This is no issue for human problem solvers since they know by "convention" that breaking through is not the aim. But KataGo doesn't know this and will waste a lot of time by analysing attempts to break through. To prevent this you may add some stones to the outside (as long as they don't affect any liberties or prevent forcing moves)

And then there is this nasty thing called "ko": As the analysis is restricted to the problem rectangle there are no ko threats (with the rare exception of local ones). So KataGo will regard a sequence with a favourable ko as equally good as an unconditional one, and it will regard a sequence with an unfavourable ko as always failing. So if
1) the basic workflow doesn't yield a solution and you want to check for a solution with an unfavourable ko or
2) the basic workflow detects a solution with a favourable ko and you want to check for an unconditional solution,
then you should add another local position to the board which provides a big ko threat for the relevant color. I use this one in the top left corner

----wb
wwwwwb
wwwwwb
bbbbbb


to provide a huge threat for black. To allow KataGo executing and defending the threat you must modify the basic workflow slightly: In the popup dialog "Region" you must enter the coordinates of the threat (B19) in "Moves allowed outside rectangle for black" and the coordinates of the defense (C19) in "Moves allowed outside rectangle for white".

Keep in mind that KataGo was not designed for this use case, so don't blame it if you find a problem where all this still doesn't yield the correct solution. But in my experience it works quite often and it's fun to try.

Author:  akigo [ Thu Dec 03, 2020 12:42 pm ]
Post subject:  Re: New android app "BadukAI"

I made a new version (0.20) where I added an opening book after all. So you can now
a) make a weak network's opening stronger
b) get an "old school" human-style opening against any network if you are in the mood to do so

The opening book can be switched on and off any time in the settings.

Author:  And [ Thu Dec 03, 2020 1:57 pm ]
Post subject:  Re: New android app "BadukAI"

@akigo

here, seriously, you are a superman in terms of programming !!! as if by magic, you fulfill almost any request! and speed! superman (superbrain)! I'm no kidding. thanks!!! :clap:

Author:  And [ Fri Dec 04, 2020 7:12 am ]
Post subject:  Re: New android app "BadukAI"

if you start a new game (edit config, save), and before that the "opening book" and "play b" were enabled, then the first move is not saved to the log file. also this leads to errors. for example, if after the first move d16 you press the "ponder", then among the possible moves there is also the move d16! can be done after (edit config, save) to turn off "play b"?

Author:  akigo [ Fri Dec 04, 2020 12:49 pm ]
Post subject:  Re: New android app "BadukAI"

And wrote:
if you start a new game (edit config, save), and before that the "opening book" and "play b" were enabled, then the first move is not saved to the log file. also this leads to errors. for example, if after the first move d16 you press the "ponder", then among the possible moves there is also the move d16! can be done after (edit config, save) to turn off "play b"?


Yes, I will add that in the next version.

Author:  akigo [ Sun Dec 06, 2020 1:25 pm ]
Post subject:  Re: New android app "BadukAI"

I made a new version (0.21). It fixes the strange effect that And discovered in his last post (thanks for reporting). Moreover, I added a new option "b/w board" in the settings: If ticked, the board, stones and markers are displayed in black and white which should improve readability on e-ink displays.

Author:  go4thewin [ Mon Dec 07, 2020 11:03 am ]
Post subject:  Re: New android app "BadukAI"

all these changes seem too good to be true, i never thought an app like this would exist. So if one uses the kyu-rank mode with the faster, optimized 20b net, will it still be as strong as the old 20b kyu rank bots? Its alot faster than leela zero now. it seems like no loss of strength from the old version playing against kyu rank 10. wow

Author:  akigo [ Mon Dec 07, 2020 12:28 pm ]
Post subject:  Re: New android app "BadukAI"

go4thewin wrote:
So if one uses the kyu-rank mode with the faster, optimized 20b net, will it still be as strong as the old 20b kyu rank bots?


Yes, according to my test matches between the "optimized 20b" version and the "old 20b" version, there should be no significant difference.

Author:  akigo [ Sat Dec 19, 2020 9:48 am ]
Post subject:  Re: New android app "BadukAI"

I made a new version (1.0) which is now also available on google play store: https://play.google.com/store/apps/details?id=net.kir.baduk_ai

The 32 bit version now includes the same optimizations as the 64 bit version, so the KG 20b network is much faster. Moreover, both versions use much less storage than previous ones.

Author:  And [ Sat Dec 19, 2020 10:00 am ]
Post subject:  Re: New android app "BadukAI"

fantasy!!! Thank you very much !!!

Author:  Vargo [ Sun Dec 20, 2020 2:51 am ]
Post subject:  Re: New android app "BadukAI"

Fantastic program, thanks a lot :clap: , LZ is OK, but KG doesn't work in this new version (KG is dead/crashed)
(Samsung S20+, Android 11)
Attachment:
Screenshot_20201220-104340_BadukAI.jpg
Screenshot_20201220-104340_BadukAI.jpg [ 34.37 KiB | Viewed 9171 times ]

Author:  And [ Sun Dec 20, 2020 5:54 am ]
Post subject:  Re: New android app "BadukAI"

on my tablet, the new version, KG 20b is 5-6 times faster, and does not slow down at all !!!

Author:  And [ Sun Dec 20, 2020 7:07 am ]
Post subject:  Re: New android app "BadukAI"

it seems impossible, but the optimized KG 20b network works just as well as the original! in the position from
https://lifein19x19.com/viewtopic.php?p=244851#p244851
the new network finds the right move very quickly and shows the win!!! incredible !!!

Author:  akigo [ Sun Dec 20, 2020 4:18 pm ]
Post subject:  Re: New android app "BadukAI"

Vargo wrote:
Fantastic program, thanks a lot :clap: , LZ is OK, but KG doesn't work in this new version (KG is dead/crashed)
(Samsung S20+, Android 11)


I'm very sorry for that. Unfortunately, I can't test on android 11, since my device wasn't updated yet. So finding the cause of this crash requires some guesswork. I went through the changes from the last version and found one slightly "suspicious" part. So I changed that, thereby producing version 1.1. It's a shot in the dark, but please try if that version improves things for you.

If it still crashes, it would be revealing to know if this also happens with the 10b network or only with the 20b one.

Author:  Vargo [ Sun Dec 20, 2020 8:30 pm ]
Post subject:  Re: New android app "BadukAI"

akigo wrote:
... producing version 1.1
Thank you !

I installed it. KG still doesn't work with Android 11 (10b or 20b makes no difference, KG crashes instantly) but LZ works fine.

I installed v.1.1 on my backup phone (Android 9) and everything is fine, both KG and LZ work :tmbup:

Author:  akigo [ Mon Dec 21, 2020 10:47 am ]
Post subject:  Re: New android app "BadukAI"

@Vargo

Thank you for checking all that. So it seems that something is different on android 11 which the code doesn't handle correctly. I found a change between android 10 and 11 which might be responsible for that and made a test release where this is handled
https://github.com/aki65/aki65.github.io/releases/download/v1.2.0-test1/baduk_ai__arm64-v8a-rel-1.2.apk
It would be very nice if you could check if that resolves the issue.

Author:  Vargo [ Mon Dec 21, 2020 10:27 pm ]
Post subject:  Re: New android app "BadukAI"

akigo wrote:
... check if that resolves the issue
Yes it does :clap:

Everything works perfectly (KG 10b, 20b, and LZ 15b, 40b).
Thank you again for this great app.

Author:  akigo [ Tue Dec 22, 2020 1:20 pm ]
Post subject:  Re: New android app "BadukAI"

Thanks for testing.

So I made an official release (1.2) with this change (available on my github page and in play store).

Author:  And [ Wed Dec 23, 2020 11:53 am ]
Post subject:  Re: New android app "BadukAI"

@akigo

are you planning on making an optimized KG 40b network? maybe optional?

Page 14 of 27 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/