Skip to content

Instantly share code, notes, and snippets.

View marcounderscore's full-sized avatar

Marco Vázquez marcounderscore

  • México
View GitHub Profile
const R = require('ramda')
//Returns escalar product
let escalarProduct = (x1, x2) => R.zipWith( (x1 , x2) => x1 * x2, x1, x2).reduce((x1,x2) => x1 + x2 , 0 )
//Simple step function
let step = ( f , thresold) => ( f < thresold) ? 0 : 1
//Delta value calculation
let delta = (e, x, learningRate) => e * x * learningRate