Quick Start Guide 

neurons.me

Introduction:

Neurons.me

neurons.me is an npm package that provides a lightweight and flexible library for building and working with neural networks in JavaScript. The package offers a set of classes and methods that allow developers to create, train, and utilize neural networks for various machine learning tasks.

Key Features:

With neurons.me, developers can swiftly build neural networks and leverage their power for various machine learning applications. The package is designed to be user-friendly and offers extensive documentation and examples for smooth integration into your projects.


Neurons.me is a JavaScript module for creating and managing artificial neurons, neural networks, and layers. It allows you to create neurons with custom weights, biases, and activation functions, add them to layers, and organize those layers into neural networks.

Installing

To install neurons.me, use the following command:

npm install neurons.me


Using Neurons.me

To use neurons.me in your project, you first need to require the module:

const neurons = require('neurons.me');


Creating Neurons

You can create a neuron using the createNeuron method. This method allows you to specify custom weights, a bias, and an activation function for the neuron. For example:

const neuron1 = neurons.createNeuron({ weights: [0.1, 0.2, 0.3], bias: 0.4, activationFunction: x => 1 / (1 + Math.exp(-x)) });


In this example, the weights array represents the weights of the neuron's inputs, the bias is a constant that allows you to adjust the output along with the weighted sum of the inputs, and the activationFunction defines how the neuron processes its inputs to produce an output. The provided activation function in this case is the sigmoid function.

Creating Layers

A layer is a collection of neurons. You can create a layer using the Layer class, and add neurons to the layer using the addNeuron method:

const layer1 = new neurons.Layer();

layer1.addNeuron(neuron1);


Creating Neural Networks

A neural network is a collection of layers. You can create a neural network using the NeuralNetwork class, and add layers to the network using the addLayer method:

const neuralNetwork = new neurons.NeuralNetwork();

neuralNetwork.addLayer(layer1);


The order in which layers are added to the neural network determines their function: the first layer added is the input layer, the last layer added is the output layer, and any layers added in between are hidden layers.

Creating Neurons with Options

In addition to specifying the weights, bias, and activation function, you can also provide additional options when creating a neuron. These options can include any custom properties you want the neuron to have. For example:

const neuron2 = neurons.createNeuron({

 weights: [0.5, 0.6, 0.7],

 bias: 0.8,

 activationFunction: x => 1 / (1 + Math.exp(-x)),

 options: { name: 'neuron2', description: 'This is an example neuron' }

});


In this example, the options object includes a name and description property, which are added to the neuron upon creation.

Loading Modules (Experimental)

Read Modules.

Neurons.me also allows you to load additional modules into your neurons, providing them with extra functionality. This is done using the load parameter in the createNeuron method:

Const neurons = require('neurons.me');

const defacto = neurons.defacto;

const neuron3 = neurons.createNeuron({ load: defacto });


In this example, the defacto module is loaded into neuron3. The defacto module is included with neurons.me and provides a set of default behaviors for a neuron, but you can also create your own modules and load them into neurons in the same way.

Once a module is loaded into a neuron, all of the module's properties and methods are available to that neuron, and can be accessed using the getModule method:

const defactoModule = neuron3.getModule('defacto');

In this example, the getModule method is used to access the defacto module that was loaded into neuron3.

Modules provide a powerful way to extend the functionality of your neurons and tailor them to the specific needs of your project. You can create modules to handle specific tasks, encapsulate complex behaviors, or provide additional data and capabilities to your neurons.

Happy Coding!

Neurons.me offers a flexible and intuitive way to create and manage artificial neurons, layers, and neural networks. We hope you find it useful in your machine learning and artificial intelligence projects. Happy coding!