Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create LSTM network in brain.js #23

Open
GA-VI opened this issue Dec 6, 2023 · 2 comments
Open

Cannot create LSTM network in brain.js #23

GA-VI opened this issue Dec 6, 2023 · 2 comments

Comments

@GA-VI
Copy link

GA-VI commented Dec 6, 2023

After installing brainjs on an Apple Mac using the Terminal command:

npm install brainjs

I find the following attempt in node.js to create an LSTM network results in an error:

const brain = require('brainjs');

const net = new brain.recurrent.LSTM();

The error message shown in Terminal is:

const net = new brain.recurrent.LSTM();
                                ^
TypeError: Cannot read properties of undefined (reading 'LSTM')

What am I doing wrong here?

I am following code example articles here and here.

@perkyguy
Copy link

perkyguy commented Dec 6, 2023

@GA-VI , you have a little typo. brain.js not brainjs, that should resolve this for you.

@GA-VI
Copy link
Author

GA-VI commented Dec 6, 2023

@GA-VI , you have a little typo. brain.js not brainjs, that should resolve this for you.

Thanks very much for your post. I am actually using brainjs which is a fork of brain.js.

This is because when I try to install brain.js using the command npm install brain.js I get the following error:

npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
(##################) ⠦ reify:gl: timing reifyNode:node_modules/webgpu Completed in 3069ms
npm ERR! code 1
npm ERR! path /Users/Joe/Research/node_modules/gl
npm ERR! command failed
npm ERR! command sh -c prebuild-install || node-gyp rebuild

I can't figure out how to successfully install brain.js using the npm command.

Whereas I can successfully install the brainjs fork using npm. It's possible I guess that the brainjs fork does not offer LSTM networks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants