Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: this.set is not a function #336

Open
AnonNewGuy opened this issue Sep 30, 2018 · 1 comment
Open

TypeError: this.set is not a function #336

AnonNewGuy opened this issue Sep 30, 2018 · 1 comment

Comments

@AnonNewGuy
Copy link

AnonNewGuy commented Sep 30, 2018

I was just about to test synaptic in a node.js app for the first time so I copied down some of the basic code from the intro guide.
Stock code:
function Perceptron(input, hidden, output)
{
// create the layers
var inputLayer = new Layer(input);
var hiddenLayer = new Layer(hidden);
var outputLayer = new Layer(output);

// connect the layers
inputLayer.project(hiddenLayer);
hiddenLayer.project(outputLayer);

// set the layers
this.set({
	input: inputLayer,
	hidden: [hiddenLayer],
	output: outputLayer
});

}
The app runs successfully, but when the app attempts to make a new perceptron it returns "this.set is not a function"

@grigandal625
Copy link

@AnonNewGuy
The perceptron architecture is already realized in synaptic.Architect
So you can make a perceptron this way:
var p = new synaptic.Architect.Perceptron(2,3,1) // 2 - inputs, 3 - hidden, 1 - output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants