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

Module to iterate over a numerically function to Gradient Descent direction

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23
increased by15%
Maintainers
1
Weekly downloads
 
Created
Source

Gradient Descent

Module to iterate over a numerically function to Gradient Descent direction

API

The module expose a function with next params

GD(initialPoint,asyncNumericalFunc,stepSize,deltaSize,numSteps,presicion)->Promise(bestParams)

Iterate NUM_STEPS and stop when the norm of gradient is less that PRESICION, every step is of size STEP_SIZE and the numerical derivate is aproximated by:

derivate = [f(x + DELTA_SIZE) - f(x)]/DELTA_SIZE

Usage

const optimze = require('gradient-descent')
const func = async (x, y, z) => x * x + y * y + z * z;
const init = [3, 4, 5]; // dimension is obtained from initial point
const res = await optimize(init, func);
assert(await func(...res) < await func(...init));

Keywords

FAQs

Package last updated on 30 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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