Added Neuroph 2.6 to lib folder and classpath. Added several pro games to data folder.

Note that the SGFParser does not currently handle these games as they use full Node names rather than abbreviations (e.g. GaMe not GM).
This commit is contained in:
Woody Folsom
2012-11-13 16:57:02 -05:00
parent 8c69c62184
commit 105b4c0187
19 changed files with 4038 additions and 11 deletions

View File

@@ -7,5 +7,6 @@
<classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/> <classpathentry kind="lib" path="lib/log4j-1.2.16.jar"/>
<classpathentry kind="lib" path="lib/kgsGtp.jar"/> <classpathentry kind="lib" path="lib/kgsGtp.jar"/>
<classpathentry kind="lib" path="lib/antlrworks-1.4.3.jar"/> <classpathentry kind="lib" path="lib/antlrworks-1.4.3.jar"/>
<classpathentry kind="lib" path="lib/neuroph-2.6.jar"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

1
data/games/README.txt Normal file
View File

@@ -0,0 +1 @@
http://files.usgo.org/usgo/interface/sample.htm

View File

@@ -0,0 +1 @@
http://files.usgo.org/usgo/games/pro9x9/

View File

@@ -0,0 +1,534 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
EVent[]
PlayerBlack[Miyamoto Naoki]
PlayerWhite[Go Seigen]
DaTe[1968]
PlaCe[]
REsult[Black wins by four points]
C[This was the first of a two game match on 9x9, played
to try to decide the proper komi for this board size.
]
;
Black[de]
;
White[fe]
;
Black[ee]
;
White[fd]
;
Black[ff]
;
White[gf]
;
Black[gg]
;
White[fg]
;
Black[ef]
;
White[gh]
;
Black[hg]
;
White[hh]
;
Black[eg]
;
White[fh]
;
Black[ge]
;
White[hf]
;
Black[he]
;
White[ig]
;
Black[fc]
;
White[gd]
;
Black[gc]
;
White[hd]
;
Black[ed]
;
White[be]
;
Black[hc]
;
White[ie]
;
Black[bc]
;
White[cg]
;
Black[cf]
;
White[bf]
;
Black[ch]
;
White[cc]
;
Black[cb]
;
White[dg]
;
Black[dh]
;
White[bh]
;
Black[eh]
;
White[dc]
;
Black[bd]
;
White[ec]
;
Black[cd]
;
White[fb]
;
Black[gb]
;
White[bb]
;
Black[eb]
;
White[db]
;
Black[fa]
;
White[ca]
;
Black[ea]
;
White[da]
;
Black[df]
;
White[bg]
;
Black[bi]
;
White[ab]
;
Black[ah]
;
White[ci]
;
Black[di]
;
White[ag]
;
Black[ae]
;
White[ac]
;
Black[ad]
;
White[ha]
;
Black[hb]
;
White[fi]
;
Black[ce]
;
White[ai]
;
Black[ci]
;
White[ei]
;
Black[ah]
;
White[ic]
;
Black[ib]
;
White[ai]
;
Black[ba]
;
White[aa]
;
Black[ah]
;
White[ga]
;
Black[ia]
;
White[ai]
;
Black[ga]
;
White[id]
;
C[Black wins by 4 points]
;
)

View File

@@ -0,0 +1,372 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
EVent[Unknown...]
PlayerBlack[Go Seigen]
PlayerWhite[Miyamoto Naoki]
DaTe[1968]
PlaCe[]
REsult[Black wins by four points]
C[This was the second and last game in a two game match on 9x9,
played to try to decide the proper komi for this board size.
]
;
Black[ee]
;
White[cc]
;
Black[cd]
;
White[bd]
;
Black[dc]
;
White[db]
;
Black[dd]
;
White[bb]
;
Black[be]
;
White[fc]
;
Black[ad]
;
White[bc]
;
Black[gc]
;
White[fb]
;
Black[fd]
;
White[eg]
;
Black[dh]
;
White[dg]
;
Black[cg]
;
White[eh]
;
Black[gg]
;
White[ch]
;
Black[bh]
;
White[di]
;
Black[bg]
;
White[gh]
;
Black[hh]
;
White[fg]
;
Black[hg]
;
White[hi]
;
Black[gb]
;
White[gf]
;
Black[hf]
;
White[ge]
;
Black[he]
;
White[ff]
;
Black[ga]
;
White[gd]
;
Black[hd]
;
White[df]
;
Black[cf]
;
White[fa]
;
Black[ba]
;
White[cb]
;
Black[da]
;
White[eb]
;
Black[bi]
;
White[ci]
;
Black[ac]
;
White[ab]
;
Black[ae]
;
White[ca]
;
Black[ih]
;
C[Black wins by 4 points]
;
)

View File

@@ -0,0 +1,327 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Yamada Kimio (4 dan)]
PlayerWhite[Nakamura Shinya (2 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[White forfeits on time]
Comment[
Black: Yamada Kimio (4 dan)
White: Nakamura Shinya (2 dan)
]
;
Black[gd]
;
White[ef]
;
Black[ce]
;
White[ed]
;
Black[gf]
;
White[cg]
;
Black[dc]
;
White[gc]
;
Black[hc]
;
White[dd]
;
Black[cd]
;
White[cc]
;
Black[cb]
;
White[bc]
;
Black[db]
;
White[bb]
;
Black[ba]
;
White[ec]
;
Black[bd]
;
White[hb]
;
Black[fg]
;
White[he]
;
Black[hd]
;
White[ge]
;
Black[hf]
;
White[fe]
;
Black[ie]
;
White[eg]
;
Black[fh]
;
White[ib]
;
Black[gb]
;
White[fc]
;
Black[ha]
;
White[fb]
;
Black[hh]
;
White[bf]
;
Black[ci]
;
White[dh]
;
Black[di]
;
White[bi]
;
Black[eh]
;
White[ch]
;
Black[ei]
;
White[bh]
;
Black[de]
C[White forfeits on time]
;
)

View File

@@ -0,0 +1,312 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Kitano Ryo (2 dan)]
PlayerWhite[Kin Pyon Min (1 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[White wins by 11 1/2]
Comment[
Black: Kitano Ryo (2 dan)
White: Kin Pyon Min (1 dan)
(61 moves, 42 recorded)
]
;
Black[ed]
;
White[eg]
;
Black[ff]
;
White[ef]
;
Black[ee]
;
White[fg]
;
Black[gf]
;
White[gg]
;
Black[df]
;
White[dg]
;
Black[cf]
;
White[gd]
;
Black[ge]
;
White[ec]
;
Black[dc]
;
White[db]
;
Black[fc]
;
White[eb]
;
Black[gc]
;
White[cc]
;
Black[cd]
;
White[bd]
;
Black[be]
;
White[dd]
;
Black[de]
;
White[ce]
;
Black[hg]
;
White[hh]
;
Black[cd]
;
White[hf]
;
Black[bc]
;
White[bb]
;
Black[ad]
;
White[he]
;
Black[fd]
;
White[ab]
;
Black[hd]
;
White[bg]
;
Black[fb]
;
White[ea]
;
Black[dc]
;
White[cb]
C[White wins by 11 1/2 point]
;
)

View File

@@ -0,0 +1,327 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Yata Naoki (5 dan)]
PlayerWhite[Yanagawa Hiromasa (5 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[Black wins by 1/2 point]
Comment[
Black: Yata Naoki (5 dan)
White: Yanagawa Hiromasa (5 dan)
]
;
Black[ce]
;
White[fe]
;
Black[ff]
;
White[cf]
;
Black[ee]
;
White[fd]
;
Black[ed]
;
White[gf]
;
Black[gg]
;
White[ec]
;
Black[df]
;
White[fg]
;
Black[ef]
;
White[hg]
;
Black[fc]
;
White[gh]
;
Black[ge]
;
White[gd]
;
Black[gc]
;
White[hd]
;
Black[hc]
;
White[he]
;
Black[dc]
;
White[eb]
;
Black[db]
;
White[cg]
;
Black[be]
;
White[ic]
;
Black[ib]
;
White[id]
;
Black[gb]
;
White[bh]
;
Black[bf]
;
White[bg]
;
Black[dg]
;
White[dh]
;
Black[eg]
;
White[eh]
;
Black[ag]
;
White[af]
;
Black[ae]
;
White[ah]
;
Black[af]
;
White[ha]
;
Black[ea]
C[Black wins by 1/2 point]
;
)

View File

@@ -0,0 +1,369 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Sasaka Shiro (4 dan)]
PlayerWhite[Kin Pyon Min (1 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[White wins by 4 1/2]
Comment[
Black: Sasaka Shiro (4 dan)
White: Kin Pyon Min (1 dan)
]
;
Black[fg]
;
White[fd]
;
Black[ed]
;
White[fc]
;
Black[ee]
;
White[fe]
;
Black[ff]
;
White[be]
;
Black[ec]
;
White[he]
;
Black[hf]
;
White[cg]
;
Black[hd]
;
White[eb]
;
Black[db]
;
White[fb]
;
Black[ge]
;
White[dc]
;
Black[ce]
;
White[cc]
;
Black[bd]
;
White[de]
;
Black[bf]
;
White[ef]
;
Black[eg]
;
White[cf]
;
Black[ae]
;
White[dd]
;
Black[bc]
;
White[bb]
;
Black[bg]
;
White[bh]
;
Black[dh]
;
White[ch]
;
Black[cd]
;
White[ac]
;
Black[ag]
;
White[ab]
;
Black[ad]
;
White[gd]
;
Black[ie]
;
White[hc]
;
Black[ic]
;
White[hb]
;
Black[dg]
;
White[df]
;
Black[ib]
;
White[ah]
;
Black[ci]
;
White[bi]
;
Black[di]
;
White[ha]
C[White wins by 4 1/2 point]
;
)

View File

@@ -0,0 +1,279 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Saito Tadashi (4 dan)]
PlayerWhite[Kin Pyon Min (1 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[Black wins by 1/2]
Comment[
Black: Saito Tadashi (4 dan)
White: Kin Pyon Min (1 dan)
]
;
Black[ee]
;
White[ge]
;
Black[ce]
;
White[be]
;
Black[bd]
;
White[cf]
;
Black[de]
;
White[dg]
;
Black[eg]
;
White[eh]
;
Black[fh]
;
White[fg]
;
Black[ef]
;
White[ch]
;
Black[ei]
;
White[dh]
;
Black[gd]
;
White[hd]
;
Black[gc]
;
White[gg]
;
Black[hc]
;
White[he]
;
Black[bf]
;
White[bg]
;
Black[ae]
;
White[ic]
;
Black[ib]
;
White[id]
;
Black[hb]
;
White[fe]
;
Black[fd]
;
White[df]
;
Black[ff]
;
White[gf]
;
Black[ag]
;
White[ah]
;
Black[af]
C[Black wins by 1/2 point]
;
)

View File

@@ -0,0 +1,267 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Aragaki Shumu (6 dan)]
PlayerWhite[Yanagawa Hiromasa (5 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[Black wins by 5 1/2]
Comment[
Black: Aragaki Shumu (6 dan)
White: Yanagawa Hiromasa (5 dan)
]
;
Black[ff]
;
White[dd]
;
Black[de]
;
White[ce]
;
Black[ed]
;
White[ec]
;
Black[ee]
;
White[fc]
;
Black[cd]
;
White[dc]
;
Black[cf]
;
White[be]
;
Black[bf]
;
White[ge]
;
Black[gf]
;
White[hf]
;
Black[hg]
;
White[bd]
;
Black[hd]
;
White[hc]
;
Black[bc]
;
White[cc]
;
Black[ad]
;
White[gd]
;
Black[ae]
;
White[bb]
;
Black[cd]
;
White[he]
;
Black[if]
;
White[ie]
;
Black[ig]
;
White[ab]
;
Black[fe]
;
White[ac]
;
Black[bd]
C[Black wins by 5 1/2 point]
;
)

View File

@@ -0,0 +1,375 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Enda Hideki (6 dan)]
PlayerWhite[Aragaki Shumu (6 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[White wins by 3 1/2]
Comment[
Black: Enda Hideki (6 dan)
White: Aragaki Shumu (6 dan)
]
;
Black[ee]
;
White[ce]
;
Black[cd]
;
White[dd]
;
Black[de]
;
White[cc]
;
Black[bd]
;
White[cf]
;
Black[dg]
;
White[cg]
;
Black[dc]
;
White[ed]
;
Black[fd]
;
White[ec]
;
Black[db]
;
White[eb]
;
Black[cb]
;
White[fe]
;
Black[eg]
;
White[be]
;
Black[bc]
;
White[gd]
;
Black[ch]
;
White[bh]
;
Black[gf]
;
White[ff]
;
Black[fg]
;
White[gg]
;
Black[ge]
;
White[fc]
;
Black[hg]
;
White[gh]
;
Black[hh]
;
White[dh]
;
Black[ef]
;
White[fd]
;
Black[hd]
;
White[hc]
;
Black[he]
;
White[ei]
;
Black[fh]
;
White[gb]
;
Black[ic]
;
White[ib]
;
Black[id]
;
White[ad]
;
Black[ac]
;
White[ae]
;
Black[eh]
;
White[ci]
;
Black[ea]
;
White[fa]
;
Black[da]
C[White wins by 3 1/2 point]
;
)

View File

@@ -0,0 +1,381 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Kurahashi Masayuki (6 dan)]
PlayerWhite[Ishida Atsushi (5 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[White wins on time]
Comment[
Black: Kurahashi Masayuki (6 dan)
White: Ishida Atsushi (5 dan)
]
;
Black[eg]
;
White[fc]
;
Black[fd]
;
White[ec]
;
Black[de]
;
White[gd]
;
Black[ge]
;
White[be]
;
Black[gc]
;
White[hd]
;
Black[gb]
;
White[he]
;
Black[fe]
;
White[gf]
;
Black[dc]
;
White[cc]
;
Black[db]
;
White[ed]
;
Black[dd]
;
White[ee]
;
Black[ff]
;
White[ef]
;
Black[fg]
;
White[df]
;
Black[cf]
;
White[dg]
;
Black[gg]
;
White[fb]
;
Black[ce]
;
White[hf]
;
Black[hg]
;
White[hb]
;
Black[dh]
;
White[cg]
;
Black[ch]
;
White[bg]
;
Black[bf]
;
White[af]
;
Black[bd]
;
White[ae]
;
Black[ad]
;
White[ag]
;
Black[bb]
;
White[ig]
;
Black[ih]
;
White[if]
;
Black[hh]
;
White[bh]
;
Black[bi]
;
White[eh]
;
Black[fh]
;
White[ai]
;
Black[ah]
;
White[ci]
C[Black forfeits on time]
;
)

View File

@@ -0,0 +1,387 @@
(
;
GaMe[1]
VieW[]
SiZe[9]
KoMi[5 1/2]
EVent[TV game]
PlayerBlack[Aragaki Shumu (6 dan)]
PlayerWhite[Ishida Atsushi (5 dan)]
DaTe[1992]
PlaCe[Osaka]
REsult[Black wins by 4 1/2]
Comment[
Black: Aragaki Shumu (6 dan)
White: Ishida Atsushi (5 dan)
]
;
Black[ff]
;
White[fc]
;
Black[ce]
;
White[cf]
;
Black[de]
;
White[df]
;
Black[ef]
;
White[be]
;
Black[bd]
;
White[bf]
;
Black[dc]
;
White[bc]
;
Black[gd]
;
White[cc]
;
Black[db]
;
White[hd]
;
Black[he]
;
White[gc]
;
Black[fd]
;
White[hb]
;
Black[id]
;
White[ic]
;
Black[hc]
;
White[ed]
;
Black[ec]
;
White[hd]
;
Black[ie]
;
White[ge]
;
Black[fe]
;
White[gf]
;
Black[gg]
;
White[hf]
;
Black[hc]
;
White[cd]
;
Black[ib]
;
White[dd]
;
Black[fb]
;
White[eh]
;
Black[fh]
;
White[eg]
;
Black[fg]
;
White[cb]
;
Black[ei]
;
White[da]
;
Black[gb]
;
White[dh]
;
Black[di]
;
White[ci]
;
Black[fi]
;
White[ch]
;
Black[ea]
;
White[ee]
;
Black[ca]
;
White[ba]
;
Black[da]
C[Black wins by 4 1/2 point]
;
)

BIN
lib/neuroph-2.6.jar Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
package net.woodyfolsom.msproj.ann;
public class FusekiLearner {
}

View File

@@ -0,0 +1,5 @@
package net.woodyfolsom.msproj.ann;
public class JosekiLearner {
}

View File

@@ -0,0 +1,79 @@
package net.woodyfolsom.msproj.ann;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FilenameFilter;
import java.io.IOException;
import net.woodyfolsom.msproj.sgf.SGFLexer;
import net.woodyfolsom.msproj.sgf.SGFNodeCollection;
import net.woodyfolsom.msproj.sgf.SGFParser;
import org.antlr.runtime.ANTLRInputStream;
import org.antlr.runtime.ANTLRStringStream;
import org.antlr.runtime.CommonTokenStream;
import org.antlr.runtime.RecognitionException;
import org.junit.Test;
public class PassLearner {
private File[] getDataFiles(String dirName) {
File file = new File(dirName);
return file.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
// TODO Auto-generated method stub
return name.toLowerCase().endsWith(".sgf");
}
});
}
public static void main(String[] args) {
new PassLearner().learnANN();
}
private void learnANN() {
for (File sgfFile : getDataFiles("data/games/pro9x9")) {
System.out.println("Parsing " + sgfFile.getPath() + "...");
parseSGF(sgfFile);
}
}
public void parseSGF(File sgfFile) {
FileInputStream fis;
try {
fis = new FileInputStream(sgfFile);
ANTLRStringStream in;
try {
in = new ANTLRInputStream(fis);
SGFLexer lexer = new SGFLexer(in);
CommonTokenStream tokens = new CommonTokenStream(lexer);
SGFParser parser = new SGFParser(tokens);
SGFNodeCollection nodeCollection;
try {
nodeCollection = parser.collection();
System.out.println("To SGF:");
System.out.println(nodeCollection.toSGF());
System.out.println("");
System.out.println("To LaTeX:");
System.out.println(nodeCollection.toLateX());
System.out.println("");
} catch (RecognitionException re) {
re.printStackTrace();
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
try {
fis.close();
} catch (IOException ioe) {
System.out.println("Error closing input stream for file" + sgfFile.getPath());
}
} catch (FileNotFoundException fnfe) {
fnfe.printStackTrace();
}
}
}

View File

@@ -0,0 +1,5 @@
package net.woodyfolsom.msproj.ann;
public class ShapeLearner {
}