
org.numenta.nupic.util.NearestNeighbor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of htm.java Show documentation
Show all versions of htm.java Show documentation
The Java version of Numenta's HTM technology
package org.numenta.nupic.util;
public class NearestNeighbor {
//private LinkedList
/**
* Creates a new {@code NearestNeighbor} with the specified
* rows. Rows must be 0 or greater, and cols must be greater
* than zero (i.e. NearestNeighbor(0, 40) is ok).
*
* @param rows (optional) number of rows
* @param cols number of columns
*/
public NearestNeighbor(int rows, int cols) {
}
public double[] vecLpDist(double distanceNorm, int[] inputPattern, boolean takeRoot) {
return null;
}
public int[] rightVecSumAtNZ(int[] inputVector, int[][] base) {
int[] results = new int[base.length];
for (int i = 0; i < base.length; i++) {
for (int j = 0;j < base[i].length;j++) {
if (inputVector[j] != 0)
results[i] += (inputVector[j] * base[i][j]);
}
}
return results;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy