- Timestamp:
- 03/22/17 16:52:36 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r14667 r14776 202 202 key2Idx.Add(kvp.Key, kvp.Index); 203 203 204 Func<double[], double[], double> euclid = (a, b) => Math.Sqrt(a.Zip(b, (x, y) => (x - y)).Sum(x => x * x)); 205 Func<DoubleArray, DoubleArray, double> euclidDArray = (a, b) => Math.Sqrt(a.Zip(b, (x, y) => (x - y)).Sum(x => x * x)); 204 206 #region MDS 205 Func<double[], double[], double> euclid = (a, b) => Math.Sqrt(a.Zip(b, (x, y) => (x - y)).Sum(x => x * x));206 207 var num = instances.Count; 207 208 var matrix = new DoubleMatrix(num, num); … … 243 244 tsneFeatures[key2Idx.GetByFirst(instance.Key)] = new DoubleArray(instance.Value); 244 245 } 245 var tsneCoords = TSNE<DoubleArray>.Run(tsneFeatures, 2, Math.Min((instances.Count - 1) / 3, 50), 0.1, (a, b) => Math.Sqrt(a.Zip(b, (c, d) => (c - d) * (c - d)).Sum()), new FastRandom(42)); 246 var tsne = new TSNE<DoubleArray>(new EuclidianDistance(), new FastRandom(42), stopLyingIter: 0, momSwitchIter: 0, momentum: 0, finalMomentum: 0, eta: 10); 247 var tsneCoords = tsne.Run(tsneFeatures, 2, Math.Min((instances.Count - 1) / 4, 50), 0); 248 //var tsneCoords = TSNE<DoubleArray>.Run(tsneFeatures, 2, Math.Min((instances.Count - 1) / 4, 50), 0, euclidDArray, new FastRandom(42)); 246 249 #endregion 247 250
Note: See TracChangeset
for help on using the changeset viewer.