Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rmardonesa/perceptron
Elemental javascript perceptron
https://github.com/rmardonesa/perceptron
Last synced: 12 days ago
JSON representation
Elemental javascript perceptron
- Host: GitHub
- URL: https://github.com/rmardonesa/perceptron
- Owner: rmardonesa
- License: gpl-3.0
- Created: 2023-02-02T11:24:18.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-02T11:35:54.000Z (almost 2 years ago)
- Last Synced: 2024-01-26T23:31:30.044Z (12 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Learning about The Sigmoid Function
## Elemental javascript perceptron
![Gjl-t(x)](https://user-images.githubusercontent.com/89952475/216314168-1946b718-ebda-40f7-b1fe-ff4f1095f81f.svg)
```
var neuro = function() {
this._seed = 1;
this._threshold = 1;
this._bias = 1;
this._learnRate = 0.1;
this._weights = [];
this._neuralData = [];
};
neuro.prototype._random = function() {
var x = Math.sin(this._seed++) * 10000;
return x - Math.floor(x);
};
neuro.prototype._multiply = function (inputs) {
var result = 0;
for (var i = 0; i < inputs.length; i++) {
result += inputs[i] * this._weights[i];
}
result += this._threshold * this._weights[this._weights.length - 1];
return result;
},
neuro.prototype._sigmoid = function(x) {
return 1 / (1 + Math.pow(Math.E, -x));
};
```