BrainJS / brain.js

🤖 GPU accelerated Neural networks in JavaScript for Browsers and Node.js
https://brain.js.org
MIT License
14.25k stars 1.06k forks source link

Cannot read properties of undefined LSTM #899

Open Whesu opened 1 year ago

Whesu commented 1 year ago

It works well in my browser (outside node environment) only with numerical data(arrays) but the string method does not work which returns Cannot read properties of undefined LSTM.

Any reason why this fails? Thanks.

Vectorrent commented 1 year ago

It sounds like you forgot to import the LSTM class:

import { recurrent } from 'brain.js'
const net = new recurrent.LSTM()
skulldoggery commented 11 months ago

It sounds like you forgot to import the LSTM class:

import { recurrent } from 'brain.js'
const net = new recurrent.LSTM()

Expanding on @LuciferianInk (🤘)'s comment, if you can provide an abbreviated snippet of your code -- at least your imports -- we can get you squared.

But all of the recurrent implementations can be accessed with the above import statement.