Comments (6)
The inputs to the neural-network model require 8 moves of history, so the engine can understand kos, etc. So if you're using the GTP protocol, the best thing is to push the SGF history in via play move
commands and then use genmove
the script here: https://github.com/tensorflow/minigo/blob/master/oneoffs/position_pv.py#L45
does some of what you want. It loads many sgfs, takes the final position in them, and asks a set of models for the 'principal variation' from that point.
from minigo.
The GTP spec is here: http://www.lysator.liu.se/~gunnar/gtp/gtp2-spec-draft2/gtp2-spec.html
Unfortunately, all AlphaGo-style engines need at least a partial history of the most recent N
moves to accurately suggest a next move. The Minigo model uses the most recent 8 board positions, which is how it handles ko, triple ko, etc. The model doesn't have an explicit ko input, it learns ko rules by example (though the tree search does enforce ko rules).
When using Minigui to suggest the best move for an arbitrary position in an SGF, the engine builds this move history by clearing the board and then replaying moves until it reaches the desired position. This is a common approach in many engines that use the GTP protocol (even engines that aren't based on AlphaGo).
Can you explain a little more about what you're trying to accomplish?
from minigo.
@amj thanks for pointing out the function. Unfortunately, the documentation is very laconic.
What I do:
- for each move, I create a new board,
- I play the stones using
play move
going through the board (from up left to right and the next line, so it's possible that one player will move 8 stones "one by one" in let's say end game) - I set move to white
- I call
genmove
@tommadams I recorder the video that describes my problem and the current state:
https://www.youtube.com/watch?v=yBu3X1Ykh_w
Basically it works awesome, I have fun playing against minigo and especially I'm automatically creating the tagged dataset of images. I like the fact that I can add an eye for myself wherever I like ;) It's not resistant to KO, but for me it's ok; unfortunately, it's possible it's not playing the best it can, does it? The 8 past moves are messed up.
by clearing the board and then replaying moves until it reaches the desired position.
This is interesting, so this is implemented? Can you explain it? I can't imagine right now how to replay the moves to reach the desired position, it seems like some huge search.
from minigo.
That's awesome! Thanks for sharing the video, it's a really cool demo. It also very clearly illustrates your problem.
We don't have any use cases where we need to start from a completely arbitrary position, in all cases we know the entire move history that lead up to a particular position. This comes from either loading an SGF file via the loadsgf
command or from interactions with a user in Minigui. In the Minigui case, we maintain a tree of all variations ever played during a session and the user is free to click around on that tree to jump between previously played positions. Whenever the user clicks, we clear the board and then play the sequence of moves to reach the clicked node in the tree. You can see a portion of the tree near the top right of this Minigui screenshot:
You could have some limited support for trying different variations using the undo
GTP command. When you want to try a different variation, you would undo several moves, then play out variation start. For the specific example in your video, you'd undo twice, then play the black stone.
Unfortunately, it looks like we haven't implemented the undo
command in the Python engine yet:
Line 96 in 77ed838
I don't suppose you're using the C++ engine are you? If not and you think the "undo" approach would work, please file a github issue and I'll try and get to implementing it this week.
from minigo.
from minigo.
Thanks for the trick @brilee
@tommadams I think that undo function would be useful to me but it's not enough. I suspect I have to create some engine that will interpret the state of the current board and somehow replay it in a sensible, possible way, with the ability at the same time to remember the history, undo moves, and be somewhat resistant to ko, everything on the side of my program. It's a pretty big project and I'm not sure it's worth doing before I collect a huge database of annotated GO boards images, which Is my priority right now.
Right now my recognizer has problems with shadows and changing lights but I think it could be robust to that.
Nevertheless thanks for the feedback. I think it's a very solid repository and Minigo community is very helpful!
from minigo.
Related Issues (20)
- run concurrent selfplay without bazel HOT 1
- Running minigo with Sabaki GUI HOT 2
- Problem while building tpu-image HOT 3
- Problem in features.stone_features HOT 1
- Onscreen buttons in lw_demo don't toggle (work)
- Minigo not working on Coral accelerator HOT 4
- Add Edge TPU support to C++ engine HOT 1
- Decouple the conv data format from the input feature layout HOT 8
- How strong is the model in kyu/dan? HOT 7
- 000990-cormorant: stderr thread died HOT 1
- Wrong argument passed in minigui/fetch-and-run.sh HOT 1
- How to communicate with engine easily outside stdin HOT 2
- Looking for 9x9 model files in .minigo file format HOT 7
- Error on Minigo v15(990)
- tensorflow.python.framework.errors_impl.InvalidArgumentError: 2 root error(s) found. (0) Invalid argument: Assign requires shapes of both tensors to match HOT 3
- The setting of num_readouts to get strongest of minigo
- train.sh in cloud tpu
- Minigo training using Coral Dev Board HOT 1
- ./cc/configure_tensorflow.sh HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minigo.