Laird Breyer
contents introduction tutorial spam fun man related
previous next

Another improvement

If you've tried the case "-w 7", then you may have noticed a true improvement over the previous attempts. But while dbacl no longer plays quite so randomly, the overall game seems touch and go. Openings are sometimes recognized, but there's no strategy and frequently dbacl seems to forget what it was doing. Also, there aren't many attempts to protect the 8th row from even direct attacks.

We can explain this type of behaviour with what we already know about the dbacl model. Since one chess move needs two words in PGN notation, then even with "-w 7", the longest connected word sequences are just over 3 chess moves long. These sequences aren't under dbacl's control since you play White, so when they break, this causes confusion and another potential sequence is followed. That's why dbacl seems to lose interest.

Another problem is that dbacl's model has no concept of opening, middle and endgame. If row 8 is attacked, it has no way of knowing if there are pawns which protect the piece, and whether there is room to move away, because the training patterns are averaged over many games. We'll come back to this observation later.

So far we've treated half-moves as fundamental, but perhaps it makes more sense to base our models on full moves? Since our engine always plays Black, then the completed gamelines will always have an even number of words. Moreover, the '-w 7" model shall truly be seven chess moves long, not three and a half. Let's try it. We can combine pairs of moves by replacing the space between them with underscores as follows (

% cat test.gameline
e4 c5 Nf3 e6 d3 Nc6
% cat >
sed -e 's/$/ Z/' -e 's/ \([^ ]* *[^ ]\)/_\1/g' -e 's/[ ]*Z$//'
% chmod +x
% cat test.gameline | ./
e4_c5 Nf3_e6 d3_Nc6

Now we have to adapt the training sets, and change the code of slightly. I've called this modification

% cd gamefiles
% cat BlackWinDraw.txt | ../ > BlackWinDraw-1.txt
% cat BlackWin.txt | ../ > BlackWin-1.txt
% cd ..

Naturally, we must learn the new dataset. You might want to make a cup of coffee while you wait.

% ./dbacl/src/dbacl -T text -l ./BlackWin-1 -e graph -L uniform \
  -j -w 7 -H 23  ./gamefiles/BlackWin-1.txt

One last safety check and we'll be ready:

% cat test.gameline | ./ \
  | ./dbacl/src/dbacl -nv -c ./BlackWin-1 -f 1 -d
# categories: BlackWin-1 
# format: avg_score * complexity
   128.93 * 0.1         []e4_c5[](1)
   -11.83 * 0.3         []e4_c5[]Nf3_e6[](1)
    37.71 * 0.4         []Nf3_e6[](1)
    17.15 * 0.6         []e4_c5[]Nf3_e6[]d3_Nc6[](1)
   -20.69 * 0.7         []Nf3_e6[]d3_Nc6[](1)
     7.60 * 0.9         []d3_Nc6[](1)
Okay, it seems to be working.
% chmod +x
% xboard -fcp ./
previous next
contents introduction tutorial spam fun man related