BrainJS / BrainJS/brain.js

trainAsync is not a function

Open
#895 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14.9k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I get this error when trying to use 'net.trainAsync'

```js
TypeError: net.trainAsync is not a function
at train (/home/container/index.js:21:13)
```

Code:
```js
const pool = workerpool.pool();

await net.trainAsync(data, {
iterations: 2000,
errorThresh: 0.01,
log: true,
logPeriod: 100,
useWorkers: true,
learningRate: 0.01,
callbackPeriod: 10,
callback: function(stats) {

if (stats.accuracy > 0.9) {
pool.terminate();
console.log('Training finished');
client.user.setPresence({
status: 'online',
activities: [{ name: 'Estou pronta para uso!', type: 'WATCHING' }]
});
}
}
});

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.