Changeset 14856


Ignore:
Timestamp:
04/13/17 11:15:47 (6 weeks ago)
Author:
gkronber
Message:

#2700: fixed bug in approximate gradient calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/TSNE/HeuristicLab.Algorithms.DataAnalysis/3.4/TSNE/TSNEStatic.cs

    r14855 r14856  
    437437      }
    438438
    439       // TODO: there seems to be a bug in the error approximation.
    440439      // The mapping of the approximate tSNE looks good but the error curve never changes.
    441440      private static double EvaluateErrorApproximate(IReadOnlyList<int> rowP, IReadOnlyList<int> colP, IReadOnlyList<double> valP, double[,] y, double theta) {
     
    627626      var row = new double[d];
    628627      for(var n1 = 0; n1 < n; n1++) {
    629         Buffer.BlockCopy(negF, (sizeof(double) * n1 * d), row, 0, d);
    630628        tree.ComputeNonEdgeForces(n1, theta, row, ref sumQ);
     629        Buffer.BlockCopy(row, 0, negF, (sizeof(double) * n1 * d), d*sizeof(double));
    631630      }
    632631
    633632      // Compute final t-SNE gradient
    634       for(var i = 0; i < n; i++)
     633      for (var i = 0; i < n; i++)
    635634        for(var j = 0; j < d; j++) {
    636635          dC[i, j] = posF[i, j] - negF[i, j] / sumQ;
Note: See TracChangeset for help on using the changeset viewer.