en ru

Docs

NAME

createAbstractNeuron - create object that represents an abstract neuron

SYNOPSIS

function createAbstractNeuron(inputsCount, inputConnectors, connectors, connectorsBaseIndex, weights, weightsBaseIndex, procUnit, actFunction);

DESCRIPTION

The function is used to create an abstract neuron from the components defined by the following ids: connectors, weights, procUnit, actFunction. Newly created neuron will have inputsCount inputs and a single output. Array inputConnectors determines which connectors will become inputs. Argument connectorsBaseIndex determines which connector will become an output.

In case of zero weights id, the neuron will be created with built-in weights. Otherwise, the neuron inputs will become linked one by one with external weights, starting from weightsBaseIndex weight.

RETURN VALUES

Upon successful completion, createAbstractNeuron returns a unique id of newly created object. Otherwise, 0 is returned.

NOTES

Don't forget to call closeId function to release the object when it is no longer needed.

EXAMPLES

To create a neuron with built-in weights:

connectors = createAbstractConnectors(3);
procUnit = createProcUnit(PROC_UNIT.WEIGHTED_SUM);
actFunc = createActFunc(ACT_FUNC.SIGMOID, 1.0);
neuron = createAbstractNeuron(2, {0, 1}, connectors, 2, 0, 0, procUnit, actFunc);

To create a pair of neurons with external weights:

connectors = createAbstractConnectors(6);
weights = createAbstractWeights(5);
procUnit = createProcUnit(PROC_UNIT.WEIGHTED_SUM);
actFunc = createActFunc(ACT_FUNC.SIGMOID, 1.0);
neuron1 = createAbstractNeuron(3, {0, 2, 1}, connectors, 3, weights, 0, procUnit, actFunc);
neuron2 = createAbstractNeuron(2, {0, 4}, connectors, 5, weights, 3, procUnit, actFunc);
setSignals(connectors, 0, {1.0}); -- Connector 0 represents a bias input;

SEE ALSO

createAbstractConnectors, createAbstractWeights, createProcUnit, createActFunc, closeId

Verbatim copying and distribution of this entire article are permitted in any medium, provided this notice is preserved.
Send suggestions, questions and bug reports to neurowombatmail@gmail.com
Copyright © 2009, 2010, 2011, 2012 Andrew Timashov