-
-
Save LeonFedotov/e9d49fcbb3a61657a709e577111d0ff0 to your computer and use it in GitHub Desktop.
map translation, sigmoid conversion, basic nuron implemntation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const map = (a, b, c, d) => (x) => (x-a)/(b-a) * (d-c) + c | |
const sigmoid = (x) => 1 / (1 + Math.exp(-x)) | |
const nuron = (weights = [], bias = 0, ...inputs) => sigmoid( | |
inputs | |
.map((input, index) => input*weights[index]) | |
.reduce(((sum, current) => sum+current), bias) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment