en ru

Docs

NAME

getAbstractWeights - return the values of the abstract weights

SYNOPSIS

function getAbstractWeights(neuronId);
function getAbstractWeights(weightsId, baseIndex, count);

DESCRIPTION

The first implementation is used to get all the weights from the abstract neuron with id neuronId.

The second implementation is used to get the values of the abstract weights with id weightsId. Argument count determines how many weights will be returned, starting from baseIndex.

RETURN VALUES

getAbstractWeights returns an array of numeric values.

EXAMPLES

To get all the weights from the abstract neuron:

connectors = createAbstractConnectors(3);
weights = createAbstractWeights(2);
procUnit = createProcUnit(PROC_UNIT.WEIGHTED_SUM);
actFunc = createActFunc(ACT_FUNC.LINEAR, 1.0, 0.0);

-- Create neuron with external weights;
neuron1 = createAbstractNeuron(2, {0, 1}, connectors, 2, weights, 0, procUnit, actFunc);
setAbstractWeights(weights, 0, {2.5, 7.0});
values = getAbstractWeights(neuron1); -- {2.5, 7.0}

-- Create neuron with built-in weights;
neuron2 = createAbstractNeuron(2, {0, 1}, connectors, 2, 0, 0, procUnit, actFunc);
setAbstractWeights(neuron2, {3.5, 8.0});
values = getAbstractWeights(neuron2); -- {3.5, 8.0}

To get the values of the abstract weights:

weights = createAbstractWeights(5);
setAbstractWeights(weights, 0, {0.0, 2.0, 5.5, 1.0, 7.0});
values = getAbstractWeights(weights, 3, 0); -- {}
values = getAbstractWeights(weights, 0, 2); -- {0.0, 2.0}
values = getAbstractWeights(weights, 2, 1); -- {5.5}
values = getAbstractWeights(weights, 3, 2); -- {1.0, 7.0}
values = getAbstractWeights(weights, 0, 5); -- {0.0, 2.0, 5.5, 1.0, 7.0}

SEE ALSO

createAbstractWeights, setAbstractWeights

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