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

matrix-calculus

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

matrix-calculus

TypeScript library to operate with matrix.

  • 2.0.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
2
Weekly downloads
 
Created
Source

About

matrix-calculus is a TypeScript library created to perform common matrix calculations. At first realizations it was created for neural network engine called "Nika" (for game AI aims). The library is successfully working as part of the highloaded game AI service based on Node JS.

All operations are immutable. So methods you are using to change matrix will return changed version of the matrix; base version will stay untouchable.

Installation

npm i --save matrix-calculus

Usage

import {Matrix, Data} from 'matrix-calculus';
import {SingleColMatrixFactory} from 'matrix-calculus/factories';

const valuesRaw:number[] = [2, 5, 3, 6, 2];
const weightsRaw:number[] = [1.7364, .8255, .01672, 1.8354, .5948];

const values:Matrix = SingleColMatrixFactory.create(valuesRaw);
const weights:Matrix = SingleColMatrixFactory.create(weightsRaw);

const weightedValues:Matrix = values.multiplyTermByTerm(weights);
const weightedValuesTransposed:Matrix = weightedValues.transpose();

const serialized:Data = weightedValuesTransposed.getData();

console.log('Transposed weighted values:', serialized);

GitHub repository

https://github.com/balovbohdan/matrix-calculus

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Keywords

FAQs

Package last updated on 23 Oct 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