kaorahi / lizgoban

Leela Zero & KataGo visualizer
GNU General Public License v3.0
169 stars 28 forks source link

Remember the sgf size option that the user selected in tsumego (life and death problem) mode #107

Closed qcgm1978 closed 8 months ago

qcgm1978 commented 8 months ago

Tsumego puzzles are often located on the corners or sides of the board, rarely involving the whole board. The "as is" option should be the common case. If the user has selected this before, save the choice so that it can be automatically applied next time when pasting tsumego images. The initial value can also be set to "as is" i.e. -1.

However, this may not need to be prioritized for update, since there seem to be other areas of this tsumego feature that require more improvement first, such as image recognition, solution judgements, etc. Compared to those, this is a minor issue.


// sgf_from_image.js
function finish_electron() {
    ...
    send('read_sgf', sgf)
    send('archive_sgf_from_image', archived_data({ settings, sgf }))
+  send('save_tsumego_config', settings.param.sgf_size)
    window.close()
}
// main.js
ipc.on('save_tsumego_config', (e,size) => {
    const ret=set_stored('sgf_size', size)
    return ret
})
function open_clipboard_image() {
    ...
    const file_name = `sgf_from_image/sgf_from_image.html?sgf_size=${R.sgf_size}`
kaorahi commented 8 months ago

Have you tried using "Tsumego frame" under the Tool menu? "19x19" option is suitable for this feature.

It helps AI to solve life/death problems slightly better than mere use of "smaller board" or "region of interest".

Fill the rest of the board evenly so that katago concentrates on the problem. Set ko threats only for the opponent so that katago finds unconditional solutions (not ko solutions). This seems important in my experiences.

https://github.com/sanderland/katrain/issues/498

So I always use "19x19" (and then "Tsumego frame") in the app. The option "as is" has been added just for the standalone web tool, that is a side product in this project.

http://kaorahi.github.io/lizgoban/src/sgf_from_image/sgf_from_image.html

If you still prefer "as is" even after trying "Tsumego frame", please let me know your use case. In some cases, it might be better to use the download link in the web tool rather than to modify the app, for example.

Anyway, yes, both image recognition and puzzle solving are currently far from convenient; they're just a slight improvement over having nothing at all. (#91)

qcgm1978 commented 8 months ago

I somewhat misunderstood the difference between how AI and humans approach solving life and death problems in Go. AI is based on holistic thinking and may be superior, even though tsumego as a means for humans to improve their Go skills likely focuses more on local positions. I tried using the tsumego framing, which seems to make the problem more complex. Perhaps when using AI, we need to break away from past conceptions about Go and consider problems from a global perspective. If so, what is considered the "correct" solution may not be what was previously thought - a local result without judgment of the global context may not actually be correct. Perhaps there are two answers to tsumego problems - the human solution and the AI solution - and the two need not be consistent. The insight AI provides me is the relationship between local life and death situations and the global board context.