question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

recurrent.LSTM() can't handle "p"?

See original GitHub issue

Hi, I was experimenting with LSTM yesteraday and it seems it cannot parse the letter P This is whats it throwing

/Users/didair/ai/node_modules/brain.js/dist/utilities/data-formatter.js:85
          throw new Error('unrecognized character "' + character + '"');
          ^

Error: unrecognized character "p"
    at DataFormatter.toIndexes (/Users/didair/ai/node_modules/brain.js/dist/utilities/data-formatter.js:85:17)
    at DataFormatter.toIndexesInputOutput (/Users/didair/ai/node_modules/brain.js/dist/utilities/data-formatter.js:101:23)
    at LSTM.formatDataIn (/Users/didair/ai/node_modules/brain.js/dist/recurrent/rnn.js:751:35)
    at LSTM.run (/Users/didair/ai/node_modules/brain.js/dist/recurrent/rnn.js:374:24)
    at Object.<anonymous> (/Users/didair/ai/example.js:24:22)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
adrianoweadcommented, Nov 6, 2017

@NicolasBrondin

Thank you, but this is not correct syntax (with current version brain.js@1.0.0-rc.3).

If run as array, works:

net.run( [ 49 ] );

If run as object, does not works:

net.run( {input: 49 } );

If run as object with array, does not works:

net.run( {input: [49] } );

Same error to predict the position 51. Does not works:

net.run( {input: 51 } );

Returns this error:

C:\desenvolvimento\javascript-nn\brain.js\node_modules\brain.js\dist\utilities\data-formatter.js:103
        result = this.toIndexes(value1.concat(['stop-input', 'start-output']), maxThreshold);
                                       ^

TypeError: value1.concat is not a function
    at DataFormatter.toIndexesInputOutput (C:\desenvolvimento\javascript-nn\brain.js\node_modules\brain.js\dist\utilities\data-formatter.js:103:40)
    at LSTM.formatDataIn (C:\desenvolvimento\javascript-nn\brain.js\node_modules\brain.js\dist\recurrent\rnn.js:751:35)
    at LSTM.run (C:\desenvolvimento\javascript-nn\brain.js\node_modules\brain.js\dist\recurrent\rnn.js:374:24)
    at Object.<anonymous> (C:\desenvolvimento\javascript-nn\brain.js\index.js:28:18)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
0reactions
mubaidrcommented, Jul 24, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Understanding Stateful LSTM Recurrent Neural Networks in ...
In this post, you will discover exactly how state is maintained in LSTM networks by the Keras deep learning library. After reading this...
Read more >
Recurrent Neural Network Guide: a Deep Dive in RNN
They can deal with long sequences of data, but are limited by the fact that they can't order the sequence correctly. So, how...
Read more >
LSTM Recurrent Neural Network Keras Example
Long Short Term Memory (LSTM) · Day 1: Lift Weights · Day 2: Swimming · Day 3: At this point, our model must...
Read more >
CS 230 - Recurrent Neural Networks Cheatsheet
Architecture of a traditional RNN Recurrent neural networks, also known as RNNs, are a class of ... Cannot consider any future input for...
Read more >
Theory and Implementation of the Elman Network and LSTM
This type of network is “recurrent” in the sense that they can revisit ... As with any neural network, RNN can't take raw...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found