Package | Description |
---|---|
com.kylecorry.lann | |
com.kylecorry.matrix |
Modifier and Type | Method and Description |
---|---|
Matrix |
NeuralNetwork.getWeights(int layer)
Get the weight matrix of a layer of the neural network.
|
Matrix |
NeuralNetwork.predict(Matrix input)
Give a prediction based on some input.
|
Modifier and Type | Method and Description |
---|---|
static int |
NeuralNetwork.argMax(Matrix output)
Get the position of the most probable in an output array.
|
double |
NeuralNetwork.crossEntropyError(Matrix x,
Matrix y)
Calculate the cross entropy error of the neural network.
|
Matrix |
NeuralNetwork.predict(Matrix input)
Give a prediction based on some input.
|
void |
NeuralNetwork.setWeights(int layer,
Matrix weights)
Set the weight matrix of a layer of the neural network.
|
double |
NeuralNetwork.squaredError(Matrix x,
Matrix y)
Calculate the squared error of the neural network.
|
double |
NeuralNetwork.train(Matrix input,
Matrix output,
double learningRate)
Train the neural network to predict an output given some input.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
Matrix.add(double value)
Add a value to every item in the matrix.
|
Matrix |
Matrix.add(Matrix mat)
Add two matrices together.
|
Matrix |
Matrix.convertToOneColumn()
Convert the entire matrix to one column.
|
Matrix |
Matrix.convertToOneRow()
Convert the entire matrix to one row.
|
Matrix |
Matrix.dot(Matrix mat)
Apply the dot product to two matrices.
|
Matrix |
Matrix.map(Matrix.Function fn)
Map each item in the matrix to a different value using a transformation
function.
|
Matrix |
Matrix.multiply(double value)
Multiply each item in the matrix by a value.
|
Matrix |
Matrix.multiply(Matrix mat)
Multiply two matrices together using element wise multiplication.
|
Matrix |
Matrix.normalize()
Normalize a matrix (All values will be scaled from 0..1 in proportion to
the max value)
|
Matrix |
Matrix.oneHot()
Make the max value in the matrix 1 and all others 0.
|
Matrix |
Matrix.power(double power)
Raise every item in the matrix to a power.
|
Matrix |
Matrix.subtract(double value)
Subtract a value from every item in the matrix.
|
Matrix |
Matrix.subtract(Matrix mat)
Subtract two matrices.
|
Matrix |
Matrix.transpose()
Transpose a matrix.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
Matrix.add(Matrix mat)
Add two matrices together.
|
Matrix |
Matrix.dot(Matrix mat)
Apply the dot product to two matrices.
|
Matrix |
Matrix.multiply(Matrix mat)
Multiply two matrices together using element wise multiplication.
|
Matrix |
Matrix.subtract(Matrix mat)
Subtract two matrices.
|