* * @param data * Verifies network sizes are initilaized * If they are not it will initialize them based off the data set.
(data)
| 319 | * If they are not it will initialize them based off the data set. |
| 320 | */ |
| 321 | _verifyIsInitialized(data) { |
| 322 | if (this.sizes) return; |
| 323 | |
| 324 | this.sizes = []; |
| 325 | if (!data[0].size) { |
| 326 | data[0].size = { input: data[0].input.length, output: data[0].output.length }; |
| 327 | } |
| 328 | |
| 329 | this.sizes.push(data[0].size.input); |
| 330 | if (!this.hiddenLayers) { |
| 331 | this.sizes.push(Math.max(3, Math.floor(data[0].size.input / 2))); |
| 332 | } else { |
| 333 | this.hiddenLayers.forEach(size => { |
| 334 | this.sizes.push(size); |
| 335 | }); |
| 336 | } |
| 337 | this.sizes.push(data[0].size.output); |
| 338 | |
| 339 | this._initialize(); |
| 340 | } |
| 341 | |
| 342 | /** |
| 343 | * |
no test coverage detected