New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gradient-descent

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gradient-descent - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

9

index.js

@@ -19,5 +19,5 @@ /* eslint-disable no-await-in-loop */

get_error,
STEP_SIZE = 1,
STEP_SIZE = 0.3,
DELTA_SIZE = STEP_SIZE.DELTA_SIZE || 1,
NUM_STEPS = STEP_SIZE.NUM_STEPS || 10,
NUM_STEPS = STEP_SIZE.NUM_STEPS || 15,
PRESICION = STEP_SIZE.NUM_STEPS || STEP_SIZE || 1,

@@ -44,2 +44,3 @@ ) => {

}
const normOfDerivate = norm_of_vector(derivate);

@@ -49,4 +50,4 @@

const stepNormalized = -1 * STEP_SIZE / normOfDerivate;
const stepInDerivateDirection = scalar_product(derivate, stepNormalized);
const stepInDerivateDirection = scalar_product(derivate, -1 * STEP_SIZE);
x_n_minus_1 = add_lists(x_n, stepInDerivateDirection);

@@ -53,0 +54,0 @@ Error_n_minus_1 = await get_error(...x_n_minus_1);

{
"name": "gradient-descent",
"version": "1.0.2",
"version": "1.0.3",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -7,6 +7,8 @@ const assert = require('assert');

const func = async (x, y, z) => x * x + y * y + z * z;
const init = [3, 4, 5];
const init = [3, 4, 7];
const res = await optimize(init, func);
console.log('res ', res);
assert(await func(...res) < await func(...init));
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc