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 read property 'train' of undefined #287

Closed
rob-gordon opened this issue Dec 21, 2017 · 3 comments
Closed

Cannot read property 'train' of undefined #287

rob-gordon opened this issue Dec 21, 2017 · 3 comments

Comments

@rob-gordon
Copy link

rob-gordon commented Dec 21, 2017

If I try to run exactly the dead simple LSTM example posted here: #217

I still get the error

const trainResults = lstm.trainer.train(trainSet, trainOptions);
                                ^

TypeError: Cannot read property 'train' of undefined
    at Object.<anonymous> (/Users/robgordon/dev/data/test.com/easyTest.js:29:35)
    at Module._compile (module.js:641:30)
    at Object.Module._extensions..js (module.js:652:10)
    at Module.load (module.js:560:32)
    at tryModuleLoad (module.js:503:12)
    at Function.Module._load (module.js:495:3)
    at Function.Module.runMain (module.js:682:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:613:3

Do I have the wrong version of Node running maybe?

@rob-gordon
Copy link
Author

As a test I jumped back to synaptic version 1.0.0 and then the example from #217 worked. Still not clear exactly why?

@ghost
Copy link

ghost commented Dec 21, 2017

I got the same a while ago and used the XOR trainingset to test the basics, than rewrote my trainingset code from scratch. I must have had a bug in the creation of my trainingset and the recent Synaptic code is more bitchy to detect broken training data.

@counterbeing
Copy link

I just tried the exact same thing. It appears that the trainer property on the LSTM has been removed. Seems like you now much instantiate your own trainer, maybe something like this?

const network = new Architect.LSTM(2, 10, 2)
const trainer = new Trainer(network)
trainer.train(trainingData, options)

I can see that the v1.0.0 LSTM architect adds a trainer to the instance, and it no longer appears to.

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