1.4.7 • Published 3 years ago

neural-network-node v1.4.7

Weekly downloads
776
License
ISC
Repository
github
Last release
3 years ago

Neural-Network-Module

A simple easy to use Node JS, HTML JS, and Java module which lets you create your own neural network and train it. This was coded from scratch and uses my numpy-matrix-js module for the Matrix math.

About

Types of Neural Networks supported

  • Standard (Feed Forward)
  • DFF (Deep Feed Forward) aka multiple hidden layers module

Set up

Quick Start Standard

Creating a neural network

The function to create a new neural network is just:

const nn = new NeuralNetwork.Standard(input_nodes, hidden_nodes, output_nodes);

In this case, you will have to change some of these.

  1. replace the input_nodes with however many inputs you give the network
  2. replace the hidden_nodes with however many hidden nodes you want. this number is arbitrary. You can choose whatever you want but might have to tweak it for optimal results.
  3. replace the output_nodes with however many outputs you want.

Once you're done with this, you have finished creating the neural network. The next step is to train it with data.

Training the model

To train the model, use the following function:

nn.train(input, output)

where input is the value that you input and output is the value the computer should output.

Testing the model

To test the model, use this function:

nn.predict(input)

This will make the computer use it's previous tested data to make a guess for what the output should be.

You're done creating a basic neural network. For more functionality, take a look at the documentation.

Quick Start DFF

Creating a neural network

The function to create a new neural network is just:

const nn = new NeuralNetwork.DFF(input_nodes, hidden_nodes, output_nodes);

In this case, you will have to change some of these.

  1. replace the input_nodes with however many inputs you give the network
  2. replace the hidden_nodes with an array. The first element in the array is the number of hidden nodes for the first hidden layer, the second element is for the second layer, and so on.
  3. replace the output_nodes with however many outputs you want.

Once you're done with this, you have finished creating the neural network. The next step is to train it with data.

Training the model

To train the model, use the following function:

nn.train(input, output)

where input is the value that you input and output is the value the computer should output.

Testing the model

To test the model, use this function:

nn.predict(input)

Finished.

Examples

Documentation

nn.getWeights()

Returns all of the current weights of the neural network

nn.getBias()

Returns all of the current biases of the neural network

nn.getLearningRate()

Returns the current learning rate of the neural network

nn.setWeights()

ParametersWhat it isRequired
weights_arrayArray of weightsYes

nn.setBias()

ParametersWhat it isRequired
bias_arrayArray of biasesYes

nn.setLearningRate()

ParametersWhat it isRequired
learning_rateNew learning rateYes

nn.predict()

ParametersWhat it isRequired
input_arrayArray of input data that matches the number of input_nodesYes

nn.train()

ParametersWhat it isRequired
input_arraythe input dataYes
output_arraywhat the computer should outputYes

Versions

Current Version: 1.3.9

Stable Versions:

1.3.9 - Changed Matrix library to my numpy-matrix-js module for NPM versions only.

1.3.1 - Added DFF for browser support

1.2.9 - Added browser support

1.2.1 - Succesfully added Deep Feed Forward Network. Removed error message for mismatched input data client-side.

1.1.7 - Failed to add Perceptron support. Forced to remove it temporarily

1.1.0 - First stable version

1.4.6

3 years ago

1.4.7

3 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.9

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.8

3 years ago

1.3.1

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.2.1

3 years ago

1.1.8

3 years ago

1.1.1

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago