2.4.1 • Published 3 years ago

layerganza v2.4.1

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

This is a feed forward neural network with injectable layers, activation functions, and optimizers.

Installation:

npm install layerganza

Example usage:

import {
    Network,
    InputLayer,
    HiddenLayer,
    OutputLayer,
    Linear,
    LeakyRelu,
    AdamOptimizer,
    shuffleTrain
} from 'layerganza'

//Create the model
let network = new Network(
    [
        new InputLayer(2),
        new HiddenLayer(100, new LeakyRelu(), new AdamOptimizer()),
        new OutputLayer(6, new Linear(), new AdamOptimizer())
    ],
);

//Train the model
let trainingSets = [//Outputs: [XOR, OR, AND, GreaterThan, LessThan, NotBoth]
    [[0, 0], [0, 0, 0, 0, 0, 1]],
    [[0, 1], [1, 1, 0, 0, 1, 0]],
    [[1, 0], [1, 1, 0, 1, 0, 0]],
    [[1, 1], [0, 1, 1, 0, 0, 0]],
];
shuffleTrain(network, trainingSets, 200);

//Get some output from the model
console.log('Output for input [1,1]:', network.invoke([1, 1]));
2.4.1

3 years ago

2.4.0

7 years ago

2.3.4

7 years ago

2.3.3

7 years ago

2.3.2

7 years ago

2.3.1

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago