From d94507696277b80d422a7b324c5ac26131fcf5d5 Mon Sep 17 00:00:00 2001 From: Joe Moudrik Date: Tue, 4 Jun 2013 14:51:17 +0200 Subject: [PATCH] remove old README --- README | 116 +++++------------------------------------------------------------ 1 file changed, 8 insertions(+), 108 deletions(-) rewrite README (98%) diff --git a/README b/README dissimilarity index 98% index 2b669cb..f3b9af6 100644 --- a/README +++ b/README @@ -1,108 +1,8 @@ -Hello!! - -This repository includes various tools used to analyze Go-players style. - -It has two parts: - - the neural network (NN) training and running code (see subfolder `gnet') - - simple Python library used for - - creating neural network train files from pattern files - - doing PCA analysis of pattern files - -Python gostyle library and example programs: - gostyle.py - library code - make_train_set.py - script that makes a train set for a NN - make_input_vector.py - used to create input vectors for trained NN - pca.py - performs a PCA analysis on vectors made from pattern files and prints it in gnuplot-friendly format - data_about_players.py - contains data about players and their strategies - -gostyle.py - Suppose you want to generate input vectors from player patfiles and output vectors based on an expert-knowledged-information. - 1. Create an InputGenerator object: - >>> i = InputVectorGenerator(main_pat_filename, num_features) - 2. Then you can print some input vectors - pattern files (e.g. 'Superman') must exist,.. - >>> for name in [ 'Cho-Chikun', 'Superman', 'Toya Koyo']: - ... print i(name) - 3. Now you reaalized you want to do PCA: - >>> list_of_input_vectors = [ i(name) for name in [ 'Cho-Chikun', 'Superman', 'Toya Koyo']] - >>> pca = PCA(input_vectors, reduce=True) - >>> reduced_list_of_vectors = pca.process_list_of_vectors( list_of_input_vectors ) - 4. Now we generate output vectors: - >>> dict = { 'Cho-Chikun' : [1,1], 'Superman' : [666,666], 'Toya Koyo' : [1, 5] } - >>> output_vectors = [ dict[name] for name in ['Cho-Chikun', 'Superman', 'Toya Koyo']] - 5. You may also have written - this does the same, but you may use different output vector object, while keep your current code - >>> dict = { 'Cho-Chikun' : [1,1], 'Superman' : [666,666], 'Toya Koyo' : [1, 5] } - >>> o = PlanarOutputVectorGenerator(dict) - >>> output_vectors = [ o(name) for name in ['Cho-Chikun', 'Superman', 'Toya Koyo']] - - See the densely commented code for other examples... - ----------- -If you want to understand what is going on - -What we do is that we try to determine players' strategies and characteristics by inspecting pattern files. A pattern file is a file that -has patterns in it :-) A pattern is a set of features (such as a distance from a border, a shape of stones on the goban, ..) for each move. -TODO - - ----------- -PREPARING THE DATASET: - -1. Assemble a list of players you are interested in, one name per line, - to some file, e.g. players.list. - -2. Get large SGF collection with index file listing games by players. - - We use GoGoD 2008 Winter as our reference database. - -3. Get Pachi source tree, and build yourself the binary. Copy over these - files: zzgo sgf2gtp.pl patterns.spat pattern_byplayer.sh - -4. Create a directory where you will stash raw lists of patterns for each - player encountered - e.g. rawpat_files/. - -5. For each game in the SGF collection where at least one of the players - is interesting, run ./pattern_byplayer.sh rawpat_files/ $SGFFILE. You can - ignore warnings/errors sometimes printed for individual files. - - If importing from GoGoD, you can use: - - ./data_gogod.sh $PATH_TO_GOGOD players.list rawpat_files/ - - See its header for usage details. - -6. Create a directory where the pattern summaries by frequency for - interesting players will go - e.g. pat_files/. - -7. Fill up pat_files/ from rawpat_files/ based on players.list. You can use a - pre-made script, run ./data_summarize.sh players.list rawpat_files/ pat_files/. - -8. pat_files/ now contains the dataset that can be analyzed by other tools - in the suite. - - ---------- -RANDOM RECIPES: - -To extract questionnaire data, use - - echo "import data_about_players; data_about_players.questionare_variance()" | python - -To test Bayes MSE, use - - k=30; for d in `seq 2 15`; do echo -n "$d "; (echo -n '('; for i in `seq 1 $k`; do ./bayes.pl 0 $d; done | tr '\n' '+';echo '1)/'$k;) | bc -l; done - # k is number of iterations, d is number of output classes; bc computes average - -When investigating patterns influencing the PCA generated by pca.py, -this may be useful: - -- Look at the dimension-pattern weights: - - sed -n 's/^1 \([0-9]*\) \(.*\)/\2 \1/p' pca.dimdata | sort -nr - -- Look at the most prominent players of a given pattern: - - grep s:17389 ../pdb-cont/pat_files/ -r | sort -n -k 2 - -- Look for given spatial pattern in actual games: - - grep -F Naiwei /srv/mm/go/GoGoD-2008-Winter/GoGoD/GameList.txt | cut -d ' ' -f 1 | while read sgf; do ./sgf2gtp.pl /srv/mm/go/GoGoD-2008-Winter/Database/*/$sgf.sgf | ./zzgo -e patternscan -d 3 2>&1; done | less # /s:1234 +Hello!! + +This repository includes various tools used to analyze Go-players style. + +The readme will be updated sometimes soon. + + + -- 2.11.4.GIT