Brain.js在训练中返回null和NaN值

时间:2020-10-13 21:10:31

标签: javascript node.js machine-learning neural-network brain.js

我正在使用Brain.js制作Gomoku AI,即使Input的大小固定为225,也没有经过训练。 (所有值都为空,训练错误仅为NaN。)

Picture of trained model .json

在填充数据的过程中将“ 00”放平以将Input的大小减小到225是否正确?
培训数据的编写方式如下:

[
  {
    input: [
      '00', '00', '00', '00', ... fill '00' in to empty space to fit 225 size
    ],
    output: { '88': 1 } //The winning player's move have 1 value
  },
  {
    input: [
      '88', '00', '00', '00', ... fill '00' in to empty space to fit 225 size
    ],
    output: { '89': 0 } //The losing player's move have 0 value
  },
  {
    input: [
      '88', '89', '00', '00', ... fill '00' in to empty space to fit 225 size
    ],
    output: { '68': 1 }
  }
] 

我应该如何解决才能使火车成功?
and Here's my code.

对不起,我的英语不好。

0 个答案:

没有答案