Socket
Socket
Sign inDemoInstall

ml-fnn

Package Overview
Dependencies
1
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ml-fnn

feedforward neural networks library


Version published
Maintainers
1
Install size
107 kB
Created

Readme

Source

Feedforward Neural Network

A implementation of feedforward neural networks in javascript based on the mrbo answer found here:

[Implementation] (http://stackoverflow.com/questions/9951487/implementing-a-neural-network-in-java-training-and-backpropagation-issues)

Methods

new FeedforwardNeuralNetwork([LayersSize])

Arguments

  • layersSize - Array of numbers with sizes of each layer.

Example

var FNN = new FeedforwardNeuralNetwork([2, 4, 1]);

train(trainingSet, predictions, learningRate, momentum)

Train the Neural Network with a given training set, predictions, learning rate and a momentum (Regularization term).

Arguments

  • trainingSet - A matrix of the training set.
  • predictions - A matrix of predictions with the same size of rows of the trainingSet.
  • learningRate - The learning rate (number).
  • momentum - The regularization term (number).

Example

var trainingSet = [[0, 0], [0, 1], [1, 0], [1, 1]];
var predictions = [[0], [0], [0], [1]];

FNN.train(trainingSet, predictions, 0.3, 0.3);

predict(dataset)

Predict the values of the dataset.

Arguments

  • dataset - A matrix that contains the dataset.

Example

var dataset = [[0, 0], [0, 1], [1, 0], [1, 1]];

var ans = FNN.predict(dataset);

export()

Exports the actual Neural Network to an Javascript Object.

load(model)

Returns a new Neural Network with the given model.

Arguments

  • model - Javascript Object generated from export() function.

Authors

License

MIT

Keywords

FAQs

Last updated on 07 Jul 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