Skip to content

TimeStep classes not exported? #199

@torreyleonard

Description

@torreyleonard

"If you don't mind add a fun gif or meme, but no pressure"

A GIF or MEME to give some spice of the internet

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.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions