Methods
createANN(topology, numVertices, numEdges, edgeProbability, averageDegree, ni, no, nl, nhu) → {object}
Creates an untrained artificial neural network.
Parameters:
Name | Type | Description |
---|---|---|
topology |
string | Graph topology. It can be: complete, random, small world, scale-free, hybrid or mlp. |
numVertices |
number | Number of vertices. |
numEdges |
number | Number of edges. |
edgeProbability |
number | Edge probability. |
averageDegree |
number | Average degree. |
ni |
number | Number of input neurons. |
no |
number | Number of output neurons. |
nl |
number | Number of layers. |
nhu |
number | Number of hidden units. |
Returns:
A neural network.
- Type
- object
getLabels(NN) → {object}
Returns the labels of an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
NN |
object | Adjacency matrix. |
Returns:
The labels of an adjacency matrix.
- Type
- object
learn(NN, inMatrix, outMatrix, ni, no, lRate, AF, OAF) → {object}
Trains an artificial neural network, represented as an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
NN |
object | Adjacency matrix. |
inMatrix |
object | Input data for training. |
outMatrix |
object | Output data for training. |
ni |
number | Number of input neurons. |
no |
number | Number of output neurons. |
lRate |
number | Learning rate. |
AF |
string | Activation function. It can be: linear, logistic or tanh. |
OAF |
string | Activation function of the last layer. It can be: linear, logistic or tanh. |
Returns:
Trained neural network.
- Type
- object
prepare(ANNMatrix, randomize, allowLoops, negativeWeights) → {object}
It prepares a neural network, represented as an adjacency matrix,
replacing cells with value one (1), with random real numbers.
Parameters:
Name | Type | Description |
---|---|---|
ANNMatrix |
object | Adjacency matrix. |
randomize |
boolean | Fill cells with random real numbers. |
allowLoops |
boolean | Allow loops. |
negativeWeights |
boolean | Allow negative weights. |
Returns:
Matrix filled with random numbers.
- Type
- object
reduce(ANNMatrix) → {object}
Remove the last row and last column from the matrix.
Parameters:
Name | Type | Description |
---|---|---|
ANNMatrix |
object | Adjacency matrix. |
Returns:
The matrix without the last row and last column.
- Type
- object
setLabels(NN, labels) → {object}
Sets the labels of an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
NN |
object | Adjacency matrix. |
labels |
object | Matrix labels. |
Returns:
The adjacency matrix.
- Type
- object
think(NN, inMatrix, ni, no, AF, OAF, OF, OFC) → {object}
It processes incoming data using a trained neural network.
Parameters:
Name | Type | Description |
---|---|---|
NN |
object | adjacency matrix. |
inMatrix |
object | Input data for training. |
ni |
number | Number of input neurons. |
no |
number | Number of output neurons. |
AF |
string | Activation function. It can be: linear, logistic or tanh. |
OAF |
string | Activation function of the last layer. It can be: linear, logistic or tanh. |
OF |
string | Output function. It can be: linear, step, or none. |
OFC |
object | Output function coefficients. |
Returns:
Trained neural network.
- Type
- object
training(NN, inMatrix, outMatrix, lRate, AF, OAF, OF, OFC, maxEpochs, minimumCorrectness, callback, interval) → {object}
Train an artificial neural network, represented as an adjacency matrix.
Parameters:
Name | Type | Description |
---|---|---|
NN |
object | Adjacency matrix. |
inMatrix |
object | Input data for training. |
outMatrix |
object | Output data for training. |
lRate |
number | Learning rate. |
AF |
string | Activation function. It can be: linear, logistic or tanh. |
OAF |
string | Activation function of the last layer. It can be: linear, logistic or tanh. |
OF |
string | Output function. It can be: linear, step or none. |
OFC |
string | Output function coefficients. |
maxEpochs |
number | Maximum number of epochs. |
minimumCorrectness |
number | Minimum correctness. |
callback |
function | Callback function. |
interval |
number | Interval between calls from the callback function. |
Returns:
Trained neural network.
- Type
- object
(inner) init()
Creates the attributes of the class.