Socket
Socket
Sign inDemoInstall

n42

Package Overview
Dependencies
6
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    n42

Deep learning module for nodejs


Version published
Weekly downloads
15
increased by7.14%
Maintainers
1
Install size
42.1 MB
Created
Weekly downloads
 

Readme

Source

n42 Build Status

n42 is the deep learning module for nodejs.

How to install

$ npm install n42

Getting started

var n42 = require('n42');
    
// input data
// This is made of sylvester matrix
var input = $M([
    [1.0, 1.0, 0.0, 0.0],
    [1.0, 1.0, 0.2, 0.0],
    [1.0, 0.9, 0.1, 0.0],
    [0.0, 0.0, 0.0, 1.0],
    [0.0, 0.0, 0.8, 1.0],
    [0.0, 0.0, 1.0, 1.0]
]);

// label data
// This is made of sylvester matrix
var label = $M([
    [1.0, 0.0],
    [1.0, 0.0],
    [1.0, 0.0],
    [0.0, 1.0],
    [0.0, 1.0],
    [0.0, 1.0]
]);

var sda = new n42.SdA(input, label, 4, [3, 3], 2);

// Training all hidden layers
sda.pretrain(0.3, 0.01, 1000);

// Tuning output layer which is composed of logistics regression
sda.finetune(0.3, 50);

// Test data
var data = $M([
    [1.0, 1.0, 0.0, 0.0],
    [0.0, 0.0, 1.0, 1.0]
]);

console.log(sda.predict(data));

/**
 *   Predict answers
 *   [0.9999998973561728, 1.0264382721184357e-7] ~ [1.0, 0.0]
 *   [4.672230837774381e-28, 1]                  ~ [0.0, 1.0]  
 */
 

Algorithms

ClassImplemented algorithm
NNNeural Network
LogisticsRegressionLogistics Regression
SdAStacked denoised Autoencoder
DBNDeep Belief Nets

API Docs

n42 API Doc

LICENSE

MIT License. Please see the LICENSE file for details.

FAQs

Last updated on 04 Sep 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc