Skip to content

Instantly share code, notes, and snippets.

View web-revolution's full-sized avatar

Web Revolution web-revolution

View GitHub Profile
@primaryobjects
primaryobjects / perceptron.js
Last active October 5, 2022 00:37
Perceptron in JavaScript, a simple example. Neural network. See https://jsfiddle.net/qu960cc2/1/
function Perceptron(opts) {
if (!opts) opts = {}
var debug = 'debug' in opts ? opts.debug : false;
var weights = 'weights' in opts
? opts.weights.slice()
: []
var threshold = 'threshold' in opts