This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
options( | |
warnPartialMatchArgs = TRUE, | |
warnPartialMatchAttr = TRUE, | |
warnPartialMatchDollar = TRUE, | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// type of neural network to train | |
const NETWORK_TYPE = 'CNN'; | |
// number of games to play | |
const LEARN_TIMES = 10000; | |
// learningRate is progressively decreased with the number of games until | |
// the final value LR_INIT/LR_FINAL_FRACTION | |
const LR_INIT = 0.0001; | |
const LR_FINAL_FRACTION = 10; | |
// epsilon is the ratio between exploration and exploitation | |
// it can evolve along the games played |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
const NeuralNetwork = require('./NeuralNetwork'); | |
exports.trainOnPreviousPlays = ( | |
networkType: string, | |
myNetwork: any, | |
myTrainer: any, | |
boards: Array<any>, | |
plays: Array<number>, | |
learningRate: number, |