+ " neurons, cannot learn a pattern of size "
+ pattern.size());
}
// Create a row matrix from the input, convert boolean to bipolar
final Matrix m2 = Matrix.createRowMatrix(pattern.getData());
// Transpose the matrix and multiply by the original input matrix
final Matrix m1 = MatrixMath.transpose(m2);
final Matrix m3 = MatrixMath.multiply(m1, m2);
// matrix 3 should be square by now, so create an identity
// matrix of the same size.
final Matrix identity = MatrixMath.identity(m3.getRows());
// subtract the identity matrix
final Matrix m4 = MatrixMath.subtract(m3, identity);
// now add the calculated matrix, for this pattern, to the
// existing weight matrix.
convertHopfieldMatrix(m4);
}