Comments (9)
Would you be in a position to share your code? Likely there is a memory leak that needs addressed.
from brain.js.
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.
Just curious: Does your error rate drop fairly quick?
from brain.js.
Also: How many words are we talking about training with?
from brain.js.
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.
The other option would be to try out the recurrent neural network, but it isn't even alpha yet.
from brain.js.
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.
@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.
from brain.js.
Related Issues (20)
- Does not install or run on redhat linux HOT 1
- cant install brainjs on mac m1 HOT 4
- .run() not working HOT 5
- returns NaN everytime !! HOT 2
- Slack social icon broken
- Transformers enabling more efficiency
- You need update GPU usage, please HOT 2
- Recurrent neural networks and string arrays HOT 1
- Why is unsupported Python 2 required for installation HOT 4
- Small problem when outputting data HOT 1
- Reinforcement Learning Feature Request HOT 2
- Error starting neural network training HOT 2
- Cannot find module '../node_modules/gpu.js/src/index.js' HOT 7
- Cannot read properties of undefined (reading 'rows') HOT 1
- brain.js not installing by npm HOT 1
- network.run() returns an empty string HOT 6
- trainAsync is not a function HOT 1
- error build brain.js HOT 3
- Create HOT 1
- Cannot read properties of undefined LSTM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brain.js.