From 168fa6359394e33523b976ce8192db4b883f3f32 Mon Sep 17 00:00:00 2001 From: Joe Moudrik Date: Mon, 13 May 2013 18:58:58 +0200 Subject: [PATCH] clanek_go_congress_initial --- clanek_go_congress/Makefile | 29 ++++ clanek_go_congress/clanek.tex | 70 ++++++++++ clanek_go_congress/psgo.sty | 304 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 403 insertions(+) create mode 100644 clanek_go_congress/Makefile create mode 100644 clanek_go_congress/clanek.tex create mode 100644 clanek_go_congress/psgo.sty diff --git a/clanek_go_congress/Makefile b/clanek_go_congress/Makefile new file mode 100644 index 0000000..c39f25b --- /dev/null +++ b/clanek_go_congress/Makefile @@ -0,0 +1,29 @@ +all: pdf + +# Vyroba PDF primo z DVI by byla prijemnejsi, ale vetsina verzi dvipdfm nici obrazky +# clanek.pdf: clanek.dvi +# dvipdfm -o $@ -p a4 -r 600 $< +# +pdf: clanek.pdf +dvi: clanek.dvi +ps: clanek.ps +show: pdf + okular clanek.pdf & + +clanek.pdf: clanek.ps + ps2pdf $< $@ + +clanek.ps: clanek.dvi + dvips -o $@ -D600 -t a4 $< + +# LaTeX je potreba spustit dvakrat, aby spravne spocital odkazy +clanek.dvi: clanek.tex $(wildcard *.tex) clanek.bib Makefile $(wildcard ./img/*.eps) $(wildcard ./*.sty) + rm -f *bbl + cslatex $< + #bibtex clanek + cslatex $< + cslatex $< + cslatex $< + +clean: + rm -f *.log *.dvi *.aux *.toc *.lof *.out *.bbl *.blg clanek.ps clanek.pdf diff --git a/clanek_go_congress/clanek.tex b/clanek_go_congress/clanek.tex new file mode 100644 index 0000000..f3eda96 --- /dev/null +++ b/clanek_go_congress/clanek.tex @@ -0,0 +1,70 @@ +\documentclass[12pt,a4paper]{report} + +%% Použité kódování znaků: obvykle latin2, cp1250 nebo utf8: +\usepackage[utf8]{inputenc} + +%% Ostatní balíčky +\usepackage[titletoc]{appendix} +\usepackage{graphicx} +\usepackage{wrapfig} +\usepackage{color} +\usepackage[multiple]{footmisc} +\usepackage{amsthm} +\usepackage{amsmath} +\usepackage{threeparttable} +\usepackage{longtable} +\usepackage{tabularx} +\usepackage{amsfonts} +\usepackage{caption} +\usepackage[lined, ruled, boxed, linesnumbered]{algorithm2e} + +\usepackage[round]{natbib} % sazba pouzite literatury + +\usepackage{psfrag} + +\usepackage{psgo,array} +\usepackage{url} % sazba URL + +\usepackage[ps2pdf,unicode]{hyperref} % Musí být za všemi ostatními balíčky +\usepackage{breakurl} + + +\hypersetup{pdftitle=Meta-learning methods for analyzing Go playing trends} +\hypersetup{pdfauthor=Josef Moudřík} + +\begin{document} +% +% paper title +% can use linebreaks \\ within to get better formatting as desired +\title{On Move Pattern Trends\\in Large Go Games Corpus} + +% use \thanks{} to gain access to the first footnote area +% a separate \thanks must be used for each paragraph as LaTeX2e's \thanks +% was not built to handle multiple paragraphs +\author{Josef~Moud\v{r}\'{i}k,~Petr~Baudi\v{s}% +\thanks{J. Moud\v{r}\'{i}k is student at the Faculty of Math and Physics, Charles University, Prague, CZ.}% +\thanks{P. Baudi\v{s} is student at the Faculty of Math and Physics, +Charles University, Prague, CZ, and also does some of his Computer +Go research as an employee of SUSE Labs Prague, Novell CZ.}} +\maketitle + +\begin{abstract} +%\boldmath + +We propose a~way of extracting a per-move evaluation of sets of Go game records. +The evaluations capture different aspects of the games such as patterns played +or statistics of sente/gote sequences (among others); using machine learning +algorithms, they can be used to predict arbitrary relevant target variables. +We apply this methodology to predict strength and playing style +(e.g. territoriality or aggressivity) of a player and realize this as an online +tool as a part of the GoStyle project. +By inspecting the dependencies between the evaluations and the target variable, +we are able to tell which patterns are bad or good (in case of strength as the +target variable), or which moves e.g. constitute the territorial style of play. +We propose a number of possible applications including seeding real-work ranks +of internet players, aiding in Go study and tuning of Go-playing programs, or +contribution to Go-theoretical discussion on the scope of ``playing style''. +\end{abstract} + + +\end{document} diff --git a/clanek_go_congress/psgo.sty b/clanek_go_congress/psgo.sty new file mode 100644 index 0000000..369e155 --- /dev/null +++ b/clanek_go_congress/psgo.sty @@ -0,0 +1,304 @@ +%% psgo.sty +%% Copyright 2004, 2003,2001 V. Bos +% +% This program may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either version 1.2 +% of this license or (at your option) any later version. +% The latest version of this license is in +% http://www.latex-project.org/lppl.txt +% and version 1.2 or later is part of all distributions of LaTeX +% version 1999/12/01 or later. +% +% This program consists of the files: +% +% psgo.sty +% psgomanual.tex +% psgomanual.ps +% +% RCS-ID: $Id: psgo.sty,v 1.7 2004/02/24 10:20:11 vbos Exp $ +% +\NeedsTeXFormat{LaTeX2e}% +\ProvidesPackage{psgo}[2008/09/04, v0.17] +\message{`PSGO', <2008/09/04>, v0.17} +\RequirePackage{pstricks,pst-node,calc,ifthen} + +\newcommand{\psgo}{\textsf{psgo}} +\newsavebox{\stmarkbox} +\newcounter{gomove} +\setcounter{gomove}{-1} +\newcounter{boardsize} +\newboolean{blackmove} +\setboolean{blackmove}{true} +\newcommand{\toggleblackmove}{% + \ifthenelse{\boolean{blackmove}}{\setboolean{blackmove}{false}}{\setboolean{blackmove}{true}}% +} +\newlength{\goxunit} +\newlength{\goyunit} +\newcommand{\setgounit}[1]{\setlength{\goxunit}{#1}\setlength{\goyunit}{1.115\goxunit}} +\setgounit{0.6cm} +\newcommand{\hatchangle}{-42.5} +\newlength{\tmplx} +\newlength{\tmply} +\newlength{\tmpxa}% +\newlength{\tmpxb}% +\newlength{\tmpya}% +\newlength{\tmpyb}% +\newcounter{gotmpc} +\newcommand{\pointbox}[1]{\raisebox{-0.5\height+0.5\depth}[0pt][0pt]{\makebox[0pt]{#1}}} +\newcommand{\golabelformat}[1]{{\sffamily #1}} +\newcommand{\goxposition}[1]{% + \ifx#1a 0\else% + \ifx#1b 1\else% + \ifx#1c 2\else% + \ifx#1d 3\else% + \ifx#1e 4\else% + \ifx#1f 5\else% + \ifx#1g 6\else% + \ifx#1h 7\else% + \ifx#1j 8\else% + \ifx#1k 9\else% + \ifx#1l 10\else% + \ifx#1m 11\else% + \ifx#1n 12\else% + \ifx#1o 13\else% + \ifx#1p 14\else% + \ifx#1q 15\else% + \ifx#1r 16\else% + \ifx#1s 17\else% + \ifx#1t 18\else% + \relax% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% +}% +\newcommand{\goyposition}[1]{% + \ifnum#1=1 0\else% + \ifnum#1=2 1\else% + \ifnum#1=3 2\else% + \ifnum#1=4 3\else% + \ifnum#1=5 4\else% + \ifnum#1=6 5\else% + \ifnum#1=7 6\else% + \ifnum#1=8 7\else% + \ifnum#1=9 8\else% + \ifnum#1=10 9\else% + \ifnum#1=11 10\else% + \ifnum#1=12 11\else% + \ifnum#1=13 12\else% + \ifnum#1=14 13\else% + \ifnum#1=15 14\else% + \ifnum#1=16 15\else% + \ifnum#1=17 16\else% + \ifnum#1=18 17\else% + \ifnum#1=19 18\else% + \relax% + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi% +}% + +\newenvironment{gomoves}{% + \newcommand{\mdd}[4]{% + \setlength{\tmpxa}{\goxposition{##1}\goxunit}\addtolength{\tmpxa}{-0.5\goxunit}% + \setlength{\tmpxb}{\goxposition{##3}\goxunit}\addtolength{\tmpxb}{0.5\goxunit}% + \setlength{\tmpya}{\goyposition{##2}\goyunit}\addtolength{\tmpya}{-0.5\goyunit}% + \setlength{\tmpyb}{\goyposition{##4}\goyunit}\addtolength{\tmpyb}{0.5\goyunit}% + \psframe[dimen=middle,fillstyle=vlines,hatchsep=2pt,hatchwidth=0.2pt,hatchangle=\hatchangle,linestyle=none]% + (\tmpxa,\tmpya)(\tmpxb,\tmpyb)% + }% + \newcommand{\placesymbol}[3]{% + \ifthenelse{\value{boardsize} > \goxposition{##2}% + \and \value{boardsize} > \goyposition{##3}}{% + \rput(\goxposition{##2},\goyposition{##3}){##1}% + }{}% + }% + \newcommand{\markpos}[3]{\placesymbol{\psframebox[dimen=inner,fillcolor=white,fillstyle=solid,linestyle=none,boxsep=false,framesep=0.3\goxunit]{##1}}{##2}{##3}}% + \newcommand{\blackstone}[3][\relax]{% + \placesymbol{\pscircle[linewidth=0.4pt,fillstyle=solid,fillcolor=black](0,0){0.5\goxunit}% + {\psset{linecolor=white,fillcolor=white,hatchcolor=gray}\color{white}##1}}{##2}{##3}% + }% + \newcommand{\whitestone}[3][\relax]{% + \placesymbol{\pscircle[linewidth=0.4pt,fillstyle=solid,fillcolor=white](0,0){0.5\goxunit}% + {\psset{linecolor=black,fillcolor=black,hatchcolor=gray}\color{black}##1}}{##2}{##3}% + }% + \renewcommand{\stone}[4][\nomark{\relax}]{% +% \def\stmark{\raisebox{-0.5\height+0.5\depth}[0.5\totalheight][0.5\totalheight]{\makebox[0pt]{##1}}}% + \def\stmark{\pointbox{##1}} + \ifthenelse{\equal{##2}{black}}% + {\blackstone[\stmark]{##3}{##4}}% + {\whitestone[\stmark]{##3}{##4}}% + }% + \newcommand{\move}{\@ifstar{\movestar}{\movenostar}}% + \newcommand{\movestar}[3][\nomark]{% + \ifthenelse{\boolean{blackmove}}% + {\stone[##1]{black}{##2}{##3}}% + {\stone[##1]{white}{##2}{##3}}% + \toggleblackmove% + }% + \newcommand{\movenostar}[3][\nomark]{% + \refstepcounter{gomove}% + \ifthenelse{\boolean{blackmove}}% + {\stone[##1\rput(0,0){\golabelformat{\thegomove}}]{black}{##2}{##3}}% + {\stone[##1\rput(0,0){\golabelformat{\thegomove}}]{white}{##2}{##3}}% + \toggleblackmove% + }% + \newcommand{\pass}{\@ifstar{\passstar}{\passnostar}}% + \newcommand{\passstar}{\toggleblackmove}% + \newcommand{\passnostar}{\refstepcounter{gomove}\toggleblackmove}% + \newcommand{\goline}[4]{\psline[linewidth=1.4pt,linecolor=black,linestyle=solid]% + (\goxposition{##1},\goyposition{##2})(\goxposition{##3},\goyposition{##4})% + }% + \newcommand{\goarrow}[4]{\psline[linewidth=1.4pt,linecolor=black,linestyle=solid,arrowscale=1.5]% + {->}% + (\goxposition{##1},\goyposition{##2})(\goxposition{##3},\goyposition{##4})% + }% + }{}% +\newcommand{\xpositionmarks}[2]{% + \whiledo{\value{#1} < #2}{% + \rput[t](\value{#1},-\goyunit){% + \addtocounter{#1}{1}% + \ifthenelse{\value{#1} > 8}% + {\addtocounter{#1}{1}\golabelformat{\Alph{#1}}\addtocounter{#1}{-1}}% + {\golabelformat{\Alph{#1}}}% + \addtocounter{#1}{-1}}% + \setlength{\tmply}{#2\goyunit}% + \rput[B](\value{#1},\tmply){% + \addtocounter{#1}{1}% + \ifthenelse{\value{#1} > 8}% + {\addtocounter{#1}{1}\golabelformat{\Alph{#1}}\addtocounter{#1}{-1}}% + {\golabelformat{\Alph{#1}}}% + \addtocounter{#1}{-1}}% + \stepcounter{#1}% + }% + }% +\newcommand{\ypositionmarks}[2]{% + \whiledo{\value{#1} < #2}{% + \addtocounter{#1}{1}% + \edef\ypos{\arabic{#1}}% + \addtocounter{#1}{-1}% + \rput[r](-\goxunit,\value{#1}){\golabelformat{\ypos}}% + \setlength{\tmplx}{#2\goxunit}% + \rput[l](\tmplx,\value{#1}){\golabelformat{\ypos}}% + \stepcounter{#1}% + }% + }% + +\def\psgosetboardsizes(#1,#2)(#3,#4){% + \def\psgollx{#1}% + \def\psgolly{#2}% + \ifthenelse{#3 > \value{boardsize}}{\def\psgourx{\value{boardsize}}}{\def\psgourx{#3}}% + \ifthenelse{#4 > \value{boardsize}}{\def\psgoury{\value{boardsize}}}{\def\psgoury{#4}}% +} +\newboolean{withindices}% +\setboolean{withindices}{true}% +\newenvironment{psgopartialboard}[2][19]{% + \setcounter{boardsize}{#1}% + \psgosetboardsizes#2% + \psset{xunit=\goxunit,yunit=\goyunit}% + \ifthenelse{\boolean{withindices}}% + {\def\xoffset{2\goxunit}\def\yoffset{2\goyunit}}% + {\def\xoffset{.5\goxunit}\def\yoffset{.5\goyunit}}% + \ifthenelse{\psgollx = 1 \or \psgollx < 1}% + {\def\psgollxval{-\xoffset}}% + {\setlength{\tmplx}{\psgollx\goxunit - 1\goxunit}\edef\psgollxval{\the\tmplx}}% + \ifthenelse{\psgolly = 1 \or \psgolly < 1}% + {\def\psgollyval{-\yoffset}}% + {\setlength{\tmply}{\psgolly\goyunit - 1\goyunit}\edef\psgollyval{\the\tmply}}% + \ifthenelse{\psgourx = \value{boardsize} \or \psgourx > \value{boardsize}}% + {\setlength{\tmplx}{\value{boardsize}\goxunit - \goxunit + \xoffset}% + \edef\psgourxval{\the\tmplx}}% + {\def\psgourxval{\psgourx\goxunit}}% + \ifthenelse{\psgoury = \value{boardsize} \or \psgoury > \value{boardsize}}% + {\setlength{\tmply}{\value{boardsize}\goyunit - \goyunit + \yoffset}% + \edef\psgouryval{\the\tmply}}% + {\def\psgouryval{\psgoury\goyunit}}% + \begin{pspicture}(\psgollxval,\psgollyval)(\psgourxval,\psgouryval)% + \ifthenelse{\psgollx = 1 \or \psgollx < 1}% + {\def\psgollxval{-\xoffset}}% + {\setlength{\tmplx}{\psgollx\goxunit - 1.5\goxunit}\edef\psgollxval{\the\tmplx}}% + \ifthenelse{\psgolly = 1 \or \psgolly < 1}% + {\def\psgollyval{-\yoffset}}% + {\setlength{\tmply}{\psgolly\goyunit - 1.5\goyunit}\edef\psgollyval{\the\tmply}}% + \ifthenelse{\psgourx = \value{boardsize} \or \psgourx > \value{boardsize}}% + {\setlength{\tmplx}{\value{boardsize}\goxunit - \goxunit + \xoffset}% + \edef\psgourxval{\the\tmplx}}% + {\setlength{\tmplx}{\psgourx\goxunit - .5\goxunit}% + \edef\psgourxval{\the\tmplx}}% + \ifthenelse{\psgoury = \value{boardsize} \or \psgoury > \value{boardsize}}% + {\setlength{\tmply}{\value{boardsize}\goyunit - \goyunit + \yoffset}% + \edef\psgouryval{\the\tmply}}% + {\setlength{\tmply}{\psgoury\goyunit - .5\goyunit}% + \edef\psgouryval{\the\tmply}}% + %% uncomment the following line to get a visual bounding box + %% \psframe[linecolor=green,linewidth=0.4pt](\psgollxval,\psgollyval)(\psgourxval,\psgouryval) + \psclip{\psframe[linecolor=white,linewidth=0](\psgollxval,\psgollyval)(\psgourxval,\psgouryval)}% + \setlength{\tmply}{\value{boardsize}\goyunit + 0.5\goyunit}% + \setlength{\tmplx}{\value{boardsize}\goxunit + 0.5\goxunit}% + \addtolength{\tmply}{-1.5\goyunit}% + \addtolength{\tmplx}{-1.5\goxunit}% + \multips(0,0)(1,0){\value{boardsize}}{\psline[linewidth=0.2pt](0,0)(0,\tmply)}% + \multips(0,0)(0,1){\value{boardsize}}{\psline[linewidth=0.2pt](0,0)(\tmplx,0)}% + \psframe[linewidth=1pt](0,0)(\tmplx,\tmply)% + \ifthenelse{\boolean{withindices}}{% + \setcounter{gotmpc}{0}% + \xpositionmarks{gotmpc}{\value{boardsize}}% + \setcounter{gotmpc}{0}% + \ypositionmarks{gotmpc}{\value{boardsize}}% + }{\relax}% + \ifthenelse{\equal{\value{boardsize}}{19}}{% + \multips(3,3)(0,6){3}{\pscircle[fillstyle=solid,fillcolor=black](0,0){.15\goxunit}}% + \multips(9,3)(0,6){3}{\pscircle[fillstyle=solid,fillcolor=black](0,0){.15\goxunit}}% + \multips(15,3)(0,6){3}{\pscircle[fillstyle=solid,fillcolor=black](0,0){.15\goxunit}}% + }{\relax}% + \begin{gomoves}% + }% + {\end{gomoves}% + \endpsclip% + \end{pspicture}% + }% +\newenvironment{psgoboard}[1][19]{% + \begin{psgopartialboard}[#1]{(0,0)(#1,#1)}% +}{% + \end{psgopartialboard}% +} + +\newenvironment{psgopartialboard*}[2][19]{% + \setboolean{withindices}{false}% + \begin{psgopartialboard}[#1]{#2}% +}{\end{psgopartialboard}} + +\newenvironment{psgoboard*}[1][19]{% + \begin{psgopartialboard*}[#1]{(0,0)(#1,#1)}% +}{% + \end{psgopartialboard*}% +} + +\newcommand{\nomark}{\relax}% +\newcommand{\factor}{0.28284271247461901}% = 2/5 * sin(1/4 * pi) +\newcommand{\markma}{% + \psline[linewidth=1.4pt](-\factor,-\factor)(\factor,\factor)% + \psline[linewidth=1.4pt](-\factor,\factor)(\factor,-\factor)% + } +\newcommand{\marktr}{% + \rput(0,-0.3\goxunit){\pstriangle(-0.66\goxunit,0.66\goxunit)}% + }% +\newcommand{\markcr}{% + \pscircle(0,0){0.33\goxunit}% + } +\newcommand{\marksq}{% + \psframe(-0.33\goxunit,-0.33\goxunit)(0.33\goxunit,0.33\goxunit)% + } +\newcommand{\marklb}[1]{% + \rput(0,0){\golabelformat{#1}}% + }% +\newcommand{\marksl}{% + \psframe[fillstyle=solid,fillcolor=gray,linecolor=gray](-0.22\goxunit,-0.22\goxunit)(0.22\goxunit,0.22\goxunit)% + }% +\newcommand{\markdd}{% + \psframe[dimen=middle,fillstyle=vlines,hatchsep=2.3pt,hatchwidth=0.2pt,hatchangle=\hatchangle,linestyle=none]% + (-0.5\goxunit,-0.5\goyunit)(0.5\goxunit,0.5\goyunit)% + }% +\newcommand{\stone}[2][\relax]{% + \setlength{\tmply}{-0.5\goxunit + 0.5ex}% + \raisebox{\tmply}{\psset{unit=\goxunit}\begin{pspicture}(-0.5,-0)(0.5,1)% + \pscircle[fillstyle=solid,fillcolor=#2](0,0.5){0.5}% + \ifthenelse{\equal{#2}{black}}% + {\rput(0,0.5){{\psset{linecolor=white}\color{white}\golabelformat{#1}}}}% + {\rput(0,0.5){{\psset{linecolor=black}\color{black}\golabelformat{#1}}}}% + \end{pspicture}}} -- 2.11.4.GIT