# Changeset 15455

Ignore:
Timestamp:
11/07/17 13:15:55 (3 years ago)
Message:

#2847 added WeightedEuclideanDistance && fixed minor bug in scatterPlot colloring

Location:
branches/Weighted TSNE/3.4/TSNE
Files:
3 edited

Unmodified
Removed

• ## branches/Weighted TSNE/3.4/TSNE/TSNEStatic.cs

 r15451 newData[i, j] = rand.NextDouble() * .0001; if (data[0] is IReadOnlyList && !randomInit) { for (var i = 0; i < noDatapoints; i++) for (var j = 0; j < newDimensions; j++) { var row = (IReadOnlyList) data[i]; newData[i, j] = row[j % row.Count]; } if (!(data[0] is IReadOnlyList) || randomInit) return; for (var i = 0; i < noDatapoints; i++) for (var j = 0; j < newDimensions; j++) { var row = (IReadOnlyList) data[i]; newData[i, j] = row[j % row.Count]; } } } } private static double[][] ComputeDistances(T[] x, IDistance distance) { var res = new double[x.Length][]; // return x.Select(m => x.Select(n => distance.Get(m, n)).ToArray()).ToArray(); } private static double EvaluateErrorExact(double[,] p, double[,] y, int n, int d) { // Compute the squared Euclidean distance matrix return c; } private static double EvaluateErrorApproximate(IReadOnlyList rowP, IReadOnlyList colP, IReadOnlyList valP, double[,] y, double theta) { // Get estimate of normalization term ? state.gains[i, j] + .2 // +0.2 nd *0.8 are used in two separate implementations of tSNE -> seems to be correct : state.gains[i, j] * .8; if (state.gains[i, j] < .01) state.gains[i, j] = .01; }
• ## branches/Weighted TSNE/3.4/TSNE/TSNEUtils.cs

 r14414 } internal static IList Swap(this IList list, int indexA, int indexB) { internal static void Swap(this IList list, int indexA, int indexB) { var tmp = list[indexA]; list[indexA] = list[indexB]; list[indexB] = tmp; return list; } internal static int Partition(this IList list, int left, int right, int pivotindex, IComparer comparer) { private static int Partition(this IList list, int left, int right, int pivotindex, IComparer comparer) { var pivotValue = list[pivotindex]; list.Swap(pivotindex, right); /// comparer for list elemnts /// internal static T NthElement(this IList list, int left, int right, int n, IComparer comparer) { internal static void NthElement(this IList list, int left, int right, int n, IComparer comparer) { while (true) { if (left == right) return list[left]; var pivotindex = left + (int)Math.Floor(new System.Random().Next() % (right - (double)left + 1)); if (left == right) return; var pivotindex = left + (int) Math.Floor(new System.Random().Next() % (right - (double) left + 1)); pivotindex = list.Partition(left, right, pivotindex, comparer); if (n == pivotindex) return list[n]; if (n == pivotindex) return; if (n < pivotindex) right = pivotindex - 1; else left = pivotindex + 1;
Note: See TracChangeset for help on using the changeset viewer.