Changeset 14667
- Timestamp:
- 02/11/17 01:07:19 (8 years ago)
- Location:
- branches/PerformanceComparison
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PerformanceComparison/HeuristicLab.Algorithms.MemPR/3.3
- Property svn:ignore
-
old new 9 9 GeneratedArtifacts 10 10 _Pvt_Extensions 11 *.DotSettings
-
- Property svn:ignore
-
branches/PerformanceComparison/HeuristicLab.OptimizationExpertSystem.Common/3.3/KnowledgeCenter.cs
r13878 r14667 39 39 using System.Threading; 40 40 using System.Threading.Tasks; 41 using HeuristicLab.Algorithms.DataAnalysis; 41 42 using Algorithm = HeuristicLab.Clients.OKB.Administration.Algorithm; 42 43 using Problem = HeuristicLab.Clients.OKB.Administration.Problem; … … 237 238 var somCoords = SOM.Map(features, new MersenneTwister(42), somSize: 10, learningRadius: 20, iterations: 200, jittering: true); 238 239 #endregion 240 #region TSNE 241 var tsneFeatures = new DoubleArray[instances.Count]; 242 foreach (var instance in instances) { 243 tsneFeatures[key2Idx.GetByFirst(instance.Key)] = new DoubleArray(instance.Value); 244 } 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 #endregion 239 247 240 248 ProblemInstances.UpdateOfRunsInProgress = true; … … 273 281 ((DoubleValue)item).Value = somCoords[key2Idx.GetByFirst(instance), 1]; 274 282 } else instance.Results.Add("Projection.SOM.Y", new DoubleValue(somCoords[key2Idx.GetByFirst(instance), 1])); 283 284 if (instance.Results.TryGetValue("Projection.TSNE.X", out item)) { 285 ((DoubleValue)item).Value = tsneCoords[key2Idx.GetByFirst(instance), 0]; 286 } else instance.Results.Add("Projection.TSNE.X", new DoubleValue(tsneCoords[key2Idx.GetByFirst(instance), 0])); 287 if (instance.Results.TryGetValue("Projection.TSNE.Y", out item)) { 288 ((DoubleValue)item).Value = tsneCoords[key2Idx.GetByFirst(instance), 1]; 289 } else instance.Results.Add("Projection.TSNE.Y", new DoubleValue(tsneCoords[key2Idx.GetByFirst(instance), 1])); 275 290 } 276 291 } finally { ProblemInstances.UpdateOfRunsInProgress = false; }
Note: See TracChangeset
for help on using the changeset viewer.