A feedforward neural network that can learn some simple tasks enveloped to be easily used and facilitate the evolution of generations.
For now, I'm working on the next steps, as it currently only has sigmoid as an activation function. I will add new function templates like ReLU for example. Also other gradients besides gradient descent. More hidden layers and extend your learning using selective evolutionary optimization.
To test the neural network, go to https://hugorodriguesqw.github.io/neuron/ and open your browser console. It has already been imported into the window and can be used freely. As it is still in early stage development, its use is quite restricted and annoying to use.
To create a new neural network, instantiate it using: (input_count, hidden_count, output_count)
const neural = new NeuralNetwork(25, 10, 8, {
learning_rate: 0.01,
activation: Activation.relu,
});
// example from examples/relu.js
neural.train(input, expected)
neural.predict(input)
For now matrix input is not supported, but you can try converting it to array using Matrix.flat:
Matrix.flat([ // Digit 7
[0, 1, 1, 1, 1],
[0, 0, 0, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 1, 0, 0],
[0, 1, 0, 0, 0],
]), // output: [0, 1, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0]
Run the network setup below and start your workout: (relu or sigmoid for now)
const {
neural, // neural network
dataset, // dataset applied
stop, // stop the training
train, // start the training
} = Examples.relu.setup()
Follow through the issues