Enable Remigijus's Barnes-Hut
This commit is contained in:
@@ -15,7 +15,7 @@ function starttSNE() {
|
||||
// The distance function that will be used to calculate distances
|
||||
// between nodes.
|
||||
.distance(function (s, t) {
|
||||
return distanceFunction(s, t, props, norm) * MULTIPLIER;
|
||||
return distanceFunction(s, t, props, norm);
|
||||
}));
|
||||
// Restart the simulation.
|
||||
console.log(simulation.force(forceName).perplexity(), simulation.force(forceName).learningRate());
|
||||
@@ -26,18 +26,19 @@ function starttSNE() {
|
||||
* Initialize the Barnes-Hut algorithm and start simulation.
|
||||
*/
|
||||
function startBarnesHutSimulation() {
|
||||
console.log("startBarnesHutSimulation")
|
||||
alreadyRanIterations = 0;
|
||||
manualStop = false;
|
||||
springForce = false;
|
||||
simulation.stop();
|
||||
p1 = performance.now();
|
||||
|
||||
simulation
|
||||
.alphaDecay(1 - Math.pow(0.001, 1 / ITERATIONS))
|
||||
simulation.alphaDecay(1 - Math.pow(0.001, 1 / ITERATIONS))
|
||||
.on("tick", ticked)
|
||||
.on("end", ended)
|
||||
.force(forceName, d3.forceBarnesHut()
|
||||
// The distance function that will be used to calculate distances
|
||||
// between nodes.
|
||||
.distance(function (s, t) {
|
||||
return distanceFunction(s, t, props, norm) * MULTIPLIER;
|
||||
}));
|
||||
.distance(function(s, t) { return distanceFunction(s, t, props, norm); }));
|
||||
// Restart the simulation.
|
||||
simulation.alpha(1).restart();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user