Conversation
|
Glad you're doing this! Have you managed to train a decent chess bot with this? |
| if gameResult == -1: | ||
| if gameResult == 1: | ||
| oneWon += 1 | ||
| elif gameResult == 1: | ||
| elif gameResult == -1: |
There was a problem hiding this comment.
This seems to precisely invert the logic of which party won; was this done to fix a bug?
There was a problem hiding this comment.
I think the original code is correct, this was not a bug.
Note a few lines up the order of the players was inverted, and also in Arena.py it normalizes for player ID via curPlayer * self.game.getGameEnded(board, curPlayer) here.
There was a problem hiding this comment.
This may be because the getGameEnded(self, board, player) method of ChessGame returns 1 if player 1 won instead of the given player won. Suggest multiplying the return value in ChessGame.getGameEnded by the function parameter player, instead of modifying the code here.
| sym = self.game.getSymmetries(canonicalBoard, pi) | ||
| for b, p in sym: | ||
| trainExamples.append([b, self.curPlayer, p, None]) | ||
| trainExamples.append([self.game.toArray(b), self.curPlayer, p, None]) |
There was a problem hiding this comment.
I think this would break Coach.py for all other games
Note the same comment holds for the change in MCTS.py
| if gameResult == -1: | ||
| if gameResult == 1: | ||
| oneWon += 1 | ||
| elif gameResult == 1: | ||
| elif gameResult == -1: |
There was a problem hiding this comment.
I think the original code is correct, this was not a bug.
Note a few lines up the order of the players was inverted, and also in Arena.py it normalizes for player ID via curPlayer * self.game.getGameEnded(board, curPlayer) here.
| import sys | ||
| sys.path.append('../../') | ||
| from utils import * | ||
| from pytorch_classification.utils import Bar, AverageMeter |
There was a problem hiding this comment.
I think we can from utils import AverageMeter, where is pytorch_classification.utils.Bar though?
Resurrect PR Chess prototype #147 by @namin
self.playstage, as i re-implement the functiongetGameEndedArena.pywhere it showed some weird behaviour.stockfishplayer.Once again, thanks @namin for the code implementation.