learn from multiple games with fresh model each
This commit is contained in:
@@ -115,7 +115,7 @@ constructModel() {
|
||||
};
|
||||
|
||||
async trainOnGames(games, setState) {
|
||||
const model = this.getModel();
|
||||
const model = this.constructModel();
|
||||
// model.dispose();
|
||||
let AllX = [];
|
||||
let AllY = [];
|
||||
|
||||
@@ -18,6 +18,8 @@ export class BoardComponent implements OnInit {
|
||||
history: any[];
|
||||
ai = new AiService();
|
||||
|
||||
games = [];
|
||||
|
||||
constructor() {}
|
||||
|
||||
ngOnInit(): void {
|
||||
@@ -62,9 +64,9 @@ export class BoardComponent implements OnInit {
|
||||
});
|
||||
});
|
||||
// const ai = new AiService();
|
||||
const games = [];
|
||||
games.push(this.ai.getMoves(AllMoves));
|
||||
this.ai.trainOnGames(games, (data)=>{ console.log(data); });
|
||||
|
||||
this.games.push(this.ai.getMoves(AllMoves));
|
||||
this.ai.trainOnGames(this.games, (data)=>{ console.log(data); });
|
||||
}
|
||||
|
||||
resetGame() {
|
||||
|
||||
Reference in New Issue
Block a user