summaryrefslogtreecommitdiff
path: root/extract.sh
diff options
context:
space:
mode:
authortslil <tslil@posteo.de>2021-01-09 17:16:13 -0500
committertslil <tslil@posteo.de>2026-08-28 19:37:41 +0100
commit81948394f575f682700edee57626f784f6397dcc (patch)
treec5e235544655c06a809a2dc94050587144aa15f4 /extract.sh
parent08db5599e3a9ba94b26916a88002361606a98353 (diff)
Two inputs to model, stacks and flat counts
Diffstat (limited to 'extract.sh')
-rwxr-xr-xextract.sh19
1 files changed, 9 insertions, 10 deletions
diff --git a/extract.sh b/extract.sh
index 89518dd..b36ae02 100755
--- a/extract.sh
+++ b/extract.sh
@@ -5,8 +5,8 @@ db_file=games_anon.db
query() {
query="(size == $1) and (result != '1-0') and (result != '0-1') and (result != '0-0')"
selct=""
- # for player in rabbitboy84 fwwwwibib archvenison Simmon AaaarghBot; do
- for player in; do
+ for player in rabbitboy84 fwwwwibib archvenison Simmon AaaarghBot; do
+ # for player in; do
selct="$selct(player_black == '$player') or (player_white == '$player') or "
done;
if [ -n "$selct" ]; then
@@ -30,14 +30,13 @@ process() {
num_games=$2
./pptdb "$size" "data/playtak-$size" > "data/check-$size"
tail -n22 "data/check-$size"
- echo -ne "\tStripping overflows and illegal games..."
+ echo -ne "\tStripping overflows and illegal games... "
grep -Fvxf "data/check-$size" "data/playtak-$size" > "data/good-playtak-$size"
- echo -e "Done\n\tChoosing $num_games from what remains ..."
+ echo -en "Done.\n\tChoosing $num_games from what remains... "
shuf -n $num_games "data/good-playtak-$size" > "data/smalltak-$size"
- echo -en "Done\n\tGenerating training data... "
+ echo -en "Done.\n\tGenerating training data... "
./pptdb "$size" "data/smalltak-$size" generate
- echo -e "\tDone, $(wc -l data/training-$size.csv | cut -d\ -f1) samples."
- echo -en "\tShuffling... "
+ echo -en "\tShuffling $(wc -l data/training-$size.csv | cut -d\ -f1) samples... "
head -n 1 "data/training-$size.csv" > "data/shuf-$size.csv"
tail -n+2 "data/training-$size.csv" | shuf >> "data/shuf-$size.csv"
mv "data/shuf-$size.csv" "data/training-$size.csv"
@@ -46,14 +45,14 @@ process() {
rm "data/training-$size.csv.gz"
fi
gzip "data/training-$size.csv"
- echo -e "Done!\n\tCompressed version available in data/training-$size.csv.gz"
+ echo "Done, available in data/training-$size.csv.gz"
}
make pptdb
for size in 5 6; do
- extract $size notation,result
- process $size 20000
echo
+ extract $size notation,result
+ process $size 30000
done