Comments (5)
it seems that you are not passing any argument to .activate(input)
that's why you get Cannot read property '0' of undefined
on the line that reads F[1] = input[0];
.
Can you provide the code you are using? How do you call the activate
method?
from synaptic.
i check every input parameter on debugger and all of them was right.
RandomInputSet: (c,max) ->
for i in [0..c] by 1
q = Math.random() * max
@InputSet.push Converter.ToBinary q
Train: ->
while @CurrentIteration < @MaxIteration
q = Math.round Math.random() * @InputSet.length
@Network.activate @InputSet[q]
@Network.propagate @learningrate,@DesiredSet[q]
@CurrentIteration++
console.log @CurrentIteration
Example usage :
@net= new Network "net",8,8,8,8
@net.RandomInputSet 50,100
@net.Train();
from synaptic.
Okay, coffeescript is not my strong suit, but I ll do my best. First of all, this line:
@net= new Network "net",8,8,8,8`.
If that's synaptic.Network()
then I believe you are providing wrong parameters to the constructor. The Network
class expects to receive a layers
object, containing an input and output layer, and an array of hidden layers. If what you are trying to do is a perceptron (one input layer with 8 neurons, one output layer with 8 neurons, and 2 hidden layers of 8 neurons each) then you should use the Architect.Perceptron
class (see more)
Second thing, and what I believe is causing the undefined
input, you are picking inputs from your input set using the following:
q = Math.round Math.random() * @InputSet.length
@Network.activate @InputSet[q]
That will eventually return a q
that's out of the bounds of the inputSet array, since you are using Math.round
, instead of Math.floor
. Lets say your input set has 50 inputs, then eventually Math.round(Math.random() * 50)
will return a value of 50
, that will make q
be equal to 50
and that will make inputSet[q]
be equal to undefined
, and that's what causes the activate
method to fail with that error.
Simple test:
a = 0;
while(Math.round(Math.random() * 50) != 50) a++;
console.log(a);
from synaptic.
Wow i have been fighting with this error for 2 days. I wont use replace all again :D
It wasn't synaptics network parameters seems right now thanks :) If this works it could be huge project and your project is core of it :D
from synaptic.
I'm glad i could help and that you find the library useful ^^ and I'm looking forward to see what you come up with!
from synaptic.
Related Issues (20)
- Neuron is not defined HOT 2
- Can I manually set the connection weights? HOT 1
- Poor scalability HOT 1
- capture iteration and error
- use seeded randomness HOT 6
- TypeError: this.set is not a function HOT 1
- Save and Load Training Progress HOT 1
- saving training progress in a file HOT 1
- Can't save to JSON? HOT 4
- possible error in layer connection and ALL_TO_ELSE
- Interoperability HOT 1
- clicking on example http://caza.la/synaptic/#/wikipedia plays sounds HOT 1
- Image as an input HOT 3
- Feature Request: Add Mish activation HOT 2
- Running synaptic on a website (browser) that restricts 'unsafe-eval' with CSP
- 优化器赋值失败 HOT 3
- Can I get the H and C states of the LSTM?
- Link Leads to Porn Site HOT 4
- Multi Hidden-Layer Network not learning appropriately.
- how to reward the choice of the ai?
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 synaptic.