Changeset 16141 for branches/2817-BinPackingSpeedup/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
- Timestamp:
- 09/14/18 11:47:37 (6 years ago)
- Location:
- branches/2817-BinPackingSpeedup
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2817-BinPackingSpeedup
- Property svn:mergeinfo changed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:mergeinfo changed
-
branches/2817-BinPackingSpeedup/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
r16140 r16141 106 106 x[column] = inputData[row, column]; 107 107 } 108 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 108 // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save! 109 lock (multiLayerPerceptron) { 110 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 111 } 109 112 yield return y[0]; 110 113 } … … 112 115 113 116 public override IEnumerable<double> GetEstimatedClassValues(IDataset dataset, IEnumerable<int> rows) { 114 double[,] inputData = dataset.ToArray( 117 double[,] inputData = dataset.ToArray(allowedInputVariables, rows); 115 118 116 119 int n = inputData.GetLength(0); … … 123 126 x[column] = inputData[row, column]; 124 127 } 125 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 128 // NOTE: mlpprocess changes data in multiLayerPerceptron and is therefore not thread-save! 129 lock (multiLayerPerceptron) { 130 alglib.mlpprocess(multiLayerPerceptron, x, ref y); 131 } 126 132 // find class for with the largest probability value 127 133 int maxProbClassIndex = 0;
Note: See TracChangeset
for help on using the changeset viewer.