js/tsne_vis.js
// perform single t-SNE iteration
perform single t-SNE iteration
perform single t - SNE iteration
function step() {
      step_counter++;
      if(step_counter <= max_counter) {
          if (sliderTrigger) {
            if (sliderInsideTrigger) {
              if (cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3) < 0) {
                $("#cost").html("(Ov. Cost: 0.000)");
                ArrayWithCosts.push(0);
                Iterations.push(step_counter);
              } else {
                $("#cost").html("(Ov. Cost: " + cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3) + ")");
                ArrayWithCosts.push(cost_overall[activeProjectionNumberProv][step_counter-1].toFixed(3));
                Iterations.push(step_counter);
              }
            } else {
              if (cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) < 0) {
                $("#cost").html("(Ov. Cost: 0.000)");
                ArrayWithCosts.push(0);
                Iterations.push(step_counter);
              } else {
                $("#cost").html("(Ov. Cost: " + cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) + ")");
                ArrayWithCosts.push(cost_overall[activeProjectionNumber][step_counter-1].toFixed(3));
                Iterations.push(step_counter);
              }
            }
          } else {
            if (cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) < 0) {
              $("#cost").html("(Ov. Cost: 0.000)");
              ArrayWithCosts.push(0);
              Iterations.push(step_counter);
            } else {
              $("#cost").html("(Ov. Cost: " + cost_overall[activeProjectionNumber][step_counter-1].toFixed(3) + ")");
              ArrayWithCosts.push(cost_overall[activeProjectionNumber][step_counter-1].toFixed(3));
              Iterations.push(step_counter);
            }
        }
        }
        else {
            clearInterval(runner);
        }
        if (step_counter == max_counter){
          ArrayWithCostsList.push(ArrayWithCosts);
          IterationsList.push(Iterations);
          updateEmbedding(AnalysisResults);
        }
}
function step ( ) { step_counter ++ ; if ( step_counter <= max_counter ) { if ( sliderTrigger ) { if ( sliderInsideTrigger ) { if ( cost_overall [ activeProjectionNumberProv ] [ step_counter - 1 ] . toFixed ( 3 ) < 0 ) { $ ( "#cost" ) . html ( "(Ov. Cost: 0.000)" ) ; ArrayWithCosts . push ( 0 ) ; Iterations . push ( step_counter ) ; } else { $ ( "#cost" ) . html ( "(Ov. Cost: " + cost_overall [ activeProjectionNumberProv ] [ step_counter - 1 ] . toFixed ( 3 ) + ")" ) ; ArrayWithCosts . push ( cost_overall [ activeProjectionNumberProv ] [ step_counter - 1 ] . toFixed ( 3 ) ) ; Iterations . push ( step_counter ) ; } } else { if ( cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) < 0 ) { $ ( "#cost" ) . html ( "(Ov. Cost: 0.000)" ) ; ArrayWithCosts . push ( 0 ) ; Iterations . push ( step_counter ) ; } else { $ ( "#cost" ) . html ( "(Ov. Cost: " + cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) + ")" ) ; ArrayWithCosts . push ( cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) ) ; Iterations . push ( step_counter ) ; } } } else { if ( cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) < 0 ) { $ ( "#cost" ) . html ( "(Ov. Cost: 0.000)" ) ; ArrayWithCosts . push ( 0 ) ; Iterations . push ( step_counter ) ; } else { $ ( "#cost" ) . html ( "(Ov. Cost: " + cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) + ")" ) ; ArrayWithCosts . push ( cost_overall [ activeProjectionNumber ] [ step_counter - 1 ] . toFixed ( 3 ) ) ; Iterations . push ( step_counter ) ; } } } else { clearInterval ( runner ) ; } if ( step_counter == max_counter ) { ArrayWithCostsList . push ( ArrayWithCosts ) ; IterationsList . push ( Iterations ) ; updateEmbedding ( AnalysisResults ) ; } }
perform single t-SNE iteration
perform single t - SNE iteration
//cost = tsne.step(); //cost_each = cost[1]; //for(var i = 0; i < final_dataset.length; i++) final_dataset[i].cost = cost_each[i];