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

Method run

JSAT/src/jsat/clustering/FLAME.java:330–363  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

328 {
329
330 @Override
331 public void run()
332 {
333 double localScore = 0;
334 for (int i = ID; i < FROM.length; i+=SystemInfo.LogicalCores)
335 {
336 if (outliers.contains(i) || CSOs.containsKey(i))
337 continue;
338 final double[] fuzzy2_i = TO[i];
339 Arrays.fill(fuzzy2_i, 0);
340 List<? extends VecPaired<VecPaired<Vec, Integer>, Double>> knns = allNNs.get(i);
341
342 double sum = 0;
343 for (int j = 1; j < weights[i].length; j++)
344 {
345 int jNN = knns.get(j).getVector().getPair();
346 final double[] fuzzy_jNN = FROM[jNN];
347 double weight = weights[i][j - 1];
348 for (int z = 0; z < FROM[jNN].length; z++)
349 fuzzy2_i[z] += weight * fuzzy_jNN[z];
350 }
351
352 for (int z = 0; z < fuzzy2_i.length; z++)
353 sum += fuzzy2_i[z];
354
355 for (int z = 0; z < fuzzy2_i.length; z++)
356 {
357 fuzzy2_i[z] /= sum+1e-6;
358 localScore += Math.abs(FROM[i][z] - fuzzy2_i[z]);
359 }
360 }
361 score.addAndGet(0, localScore);
362 cdl.countDown();
363 }
364 });
365 }
366

Callers

nothing calls this directly

Calls 7

countDownMethod · 0.80
containsMethod · 0.45
containsKeyMethod · 0.45
getMethod · 0.45
getPairMethod · 0.45
getVectorMethod · 0.45
addAndGetMethod · 0.45

Tested by

no test coverage detected