quantum_neuron2

1.0.1 • Public • Published

quantum_neuron

A differential neuron that is specifically designed to simply recognize differences.

Install using NPM

npm install quantum_neuron2

Use as standalone

<script type="text/javascript" src="neuron_standalone.js" async></script>

Please note that the QuantumNeuralNetwork is still in development and may have some limitations that we are working on that will soon be resolved in this repo.

How to use the QuantumNeuron?

Basically you can create your own networks with this neuron, the one we've supplied here is just a basic example of how to combine neurons. It's functionality is pretty sufficient so you don't need lots of neurons to achieve your goals.

Important notice: This is not a conventional neuron (perceptron).

What's the difference? (How it works and how it's not working like the normal neuron)

QuantumNeuron is just taking an array of numbers and measures the differences between numbers in respect of the positions in the array.

Example: [1, 2] is equal to [100, 200], or [315, 630] but is not equal to [2, 1] even if the difference is the same, because positions are important!

How does the conventional neuron work? Well long story short: A conventional perceptron is taking an input, activates it by multiplying the value by a weight (that's just a number) and gives the multiplied value to the output. This method did not work for us because we are not searching for recognitions of same inputs, we want to recognize differences!

The comparison between a conventional neuron and the Quantum Neuron is like comparing a raster pixel matrix image to a vector shape.

You can combine a conventional neuron with QuantumNeuron.

Code Example:

import Quantum from 'quantum_neuron';

const n = new Quantum.Neuron();

n.train([0, 1], "lesser than");
n.train([1, 1], "alike");
n.train([1, 0], "greater than");

n.predict([100, 500]); // Returns "lesser than"
n.predict([1100, 500]); // Returns "greater than"
n.predict([1100, 1000]); // Returns "alike"

Usage in graphic design AI:

//A vertical rectangle 2 pixels height and 1 pixel width, providing the sizes of each wall clockwise

n.train([2, 1, 2, 1], "A vertical rectangle!");

//A horizontal rectangle 1 pixels height and 2 pixel width, providing the sizes of each wall clockwise

n.train([1, 2, 1, 2], "A horizontal rectangle!");

//A square rectangle 1 pixels height and 1 pixel width, providing the sizes of each wall clockwise

n.train([1, 1, 1, 1], "A square rectangle!");

n.predict([314, 120, 314, 120]); // Returns "A vertical rectangle!"
n.predict([314, 1120, 314, 1120]); // Returns "A horizontal rectangle!"
n.predict([1120, 1120, 1121, 1120]); // Returns "A square rectangle!"

More readme soon! Promise! Currently we don't know the limits of QuantumNeuron.

Package Sidebar

Install

npm i quantum_neuron2

Weekly Downloads

0

Version

1.0.1

License

Apache-2.0

Unpacked Size

64.9 kB

Total Files

6

Last publish

Collaborators

  • wallflips