-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
"If you don't mind add a fun gif or meme, but no pressure"
I know this feature was released just a few days ago so I thought I'd open this issue to help with its progress, although this could just be me overlooking something.
Instantiating a new LSTMTimeStep returns the error below, and brain.recurrent.LSTMTimeStep
is undefined.
I fixed this by exporting it in the compiled index.js, then instantiating with .default():
// Before
const net = new brain.recurrent.LSTMTimeStep.(options);
// const net = new brain.recurrent.LSTMTimeStep({
// ^
// TypeError: brain.recurrent.LSTMTimeStep is not a constructor
// After
const net = new brain.recurrent.LSTMTimeStep.default(options);
// dist/index.js
var LSTMTimeStep = require('./dist/recurrent/lstm-time-step');
var brain = {
crossValidate: crossValidate,
likely: likely,
lookup: lookup,
NeuralNetwork: NeuralNetwork,
NeuralNetworkGPU: NeuralNetworkGPU,
TrainStream: TrainStream,
recurrent: {
RNN: RNN,
LSTM: LSTM,
GRU: GRU,
LSTMTimeStep: LSTMTimeStep // <---
},
utilities: utilities
};
I'm sure that this problem would apply to the other "TimeStep" classes as well, but I've only tested it on RNNTimeStep
which does indeed produce the same error.