MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / getBMU

Method getBMU

JSAT/src/jsat/classifiers/neuralnetwork/SOM.java:320–340  ·  view source on GitHub ↗

Finds the Best Matching Unit @param numericalValues the vector to find hte BMU of @return the BMU of the given vector

(Vec numericalValues)

Source from the content-addressed store, hash-verified

318 * @return the BMU of the given vector
319 */
320 private PairedReturn<Integer, Integer> getBMU(Vec numericalValues)
321 {
322 double bestDist = Double.MAX_VALUE;
323 int x = -1, y = -1;
324 for(int i = 0; i < weights.length; i++)
325 {
326 Vec[] weights_i = weights[i];
327 for(int j = 0; j < weights[i].length; j++)
328 {
329 double dist = dm.dist(weights_i[j], numericalValues);
330 if(dist < bestDist)
331 {
332 bestDist =dist;
333 x = i;
334 y = j;
335 }
336 }
337 }
338
339 return new PairedReturn<Integer, Integer>(x, y);
340 }
341
342 @Override
343 public List<Parameter> getParameters()

Callers 1

iterationStepMethod · 0.95

Calls 1

distMethod · 0.65

Tested by

no test coverage detected