Giter Site home page Giter Site logo

Comments (9)

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

Would you be in a position to share your code? Likely there is a memory leak that needs addressed.

from brain.js.

Macil avatar Macil commented on April 28, 2024

Isn't that code going to make a new input neuron and output neuron for every single distinct word used? That might make a ton more neurons than expected if given a lot of words.

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

Just curious: Does your error rate drop fairly quick?

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

Also: How many words are we talking about training with?

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

To answer @agentme, I believe you are totally correct. I honestly don't know if a feed forward neural net (currently the main thrust of brain.js, but with others potentially on the way, like recurrent neural nets: https://github.com/harthur-org/brain.js/tree/recurrent/lib/recurrent) is the best means of classification like you are currently doing. It probably needs backpropagation, so convolutional networks (https://en.wikipedia.org/wiki/Convolutional_neural_network) come to mind as a proposed solution: http://cs.stanford.edu/people/karpathy/convnetjs/ for the time being.

I wish brain.js had said type of network, and eventually I plan on it having it, if the community agrees it'd be ideal.

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

The other option would be to try out the recurrent neural network, but it isn't even alpha yet.

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

After thinking about this more, you may be able to do something like this (note: pseudo code):

var alphabet = {};
' abcdefghijklmnopqrstuvwxyz'
  .split()
  .forEach(function(letter, index) {
    alphabet[letter] = index;
  });

function wordToIndexes(word) {
  word = word.toLowerCase();
  var result = [];
  for (var i = 0; i < word.length; i++) {
    result.push(alphabet[word[i]]);
  }
  return result;
}

{
  input: wordToIndexes(inputWord),
  output: wordToIndexes(outputWord)
}

I don't think it'd be ideal, but the lightweightness of the feedforward neural net may give you something you desire.

from brain.js.

jackbackes avatar jackbackes commented on April 28, 2024

@robertleeplummerjr: I ended up doing something similar to what you did above. Splitting it into letters kept me from having to have thousands of inputs, which is where the memory leak was.

Closing as solved.

from brain.js.

robertleeplummerjr avatar robertleeplummerjr commented on April 28, 2024

from brain.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.