gradient-descent
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -32,3 +32,4 @@ /* eslint-disable no-await-in-loop */ | ||
for (let index = 0; index < space_dim; index++) { | ||
x_n[index] += DELTA_SIZE; | ||
step = (Math.random() || 1) * DELTA_SIZE | ||
x_n[index] += step; | ||
const Error_n = await get_error(...x_n); | ||
@@ -42,3 +43,3 @@ const numerical_derivate = get_numerical_derivate( | ||
derivate.push(numerical_derivate); | ||
x_n[index] -= DELTA_SIZE; | ||
x_n[index] -= step; | ||
} | ||
@@ -45,0 +46,0 @@ |
{ | ||
"name": "gradient-descent", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -9,6 +9,4 @@ const assert = require('assert'); | ||
const res = await optimize(init, func); | ||
console.log('res ', res); | ||
assert(await func(...res) < await func(...init)); | ||
}); | ||
}); |
14864