Changeset 16158 for branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork
- Timestamp:
- 09/20/18 13:12:17 (6 years ago)
- Location:
- branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis
- Property svn:mergeinfo changed
-
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4
- Property svn:ignore
-
old new 1 *.user 2 *.vs10x 3 HeuristicLab.Algorithms.DataAnalysis-3.4.csproj.user 4 HeuristicLabAlgorithmsDataAnalysisPlugin.cs 5 Plugin.cs 1 6 bin 2 7 obj 3 HeuristicLabAlgorithmsDataAnalysisPlugin.cs4 HeuristicLab.Algorithms.DataAnalysis-3.4.csproj.user5 *.vs10x6 Plugin.cs7 *.user
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkClassification.cs
r15583 r16158 115 115 public NeuralNetworkClassification() 116 116 : base() { 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 120 120 (IntValue)new IntValue(2).AsReadOnly() }); 121 121 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 185 185 IEnumerable<int> rows = problemData.TrainingIndices; 186 186 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 187 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))187 if (inputMatrix.ContainsNanOrInfinity()) 188 188 throw new NotSupportedException("Neural network classification does not support NaN or infinity values in the input dataset."); 189 189 -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleClassification.cs
r15583 r16158 171 171 IEnumerable<int> rows = problemData.TrainingIndices; 172 172 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 173 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))173 if (inputMatrix.ContainsNanOrInfinity()) 174 174 throw new NotSupportedException("Neural network ensemble classification does not support NaN or infinity values in the input dataset."); 175 175 -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleModel.cs
r15583 r16158 102 102 x[column] = inputData[row, column]; 103 103 } 104 alglib.mlpeprocess(mlpEnsemble, x, ref y); 104 // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe 105 lock (mlpEnsemble) { 106 alglib.mlpeprocess(mlpEnsemble, x, ref y); 107 } 105 108 yield return y[0]; 106 109 } … … 119 122 x[column] = inputData[row, column]; 120 123 } 121 alglib.mlpeprocess(mlpEnsemble, x, ref y); 124 // mlpeprocess writes data in mlpEnsemble and is therefore not thread-safe 125 lock (mlpEnsemble) { 126 alglib.mlpeprocess(mlpEnsemble, x, ref y); 127 } 122 128 // find class for with the largest probability value 123 129 int maxProbClassIndex = 0; -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkEnsembleRegression.cs
r15583 r16158 125 125 public NeuralNetworkEnsembleRegression() 126 126 : base() { 127 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 128 (IntValue)new IntValue(0).AsReadOnly(), 129 (IntValue)new IntValue(1).AsReadOnly(), 127 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 128 (IntValue)new IntValue(0).AsReadOnly(), 129 (IntValue)new IntValue(1).AsReadOnly(), 130 130 (IntValue)new IntValue(2).AsReadOnly() }); 131 131 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 170 170 IEnumerable<int> rows = problemData.TrainingIndices; 171 171 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 172 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))172 if (inputMatrix.ContainsNanOrInfinity()) 173 173 throw new NotSupportedException("Neural network ensemble regression does not support NaN or infinity values in the input dataset."); 174 174 -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkModel.cs
r15583 r16158 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; -
branches/2883_GBTModelStorage/HeuristicLab.Algorithms.DataAnalysis/3.4/NeuralNetwork/NeuralNetworkRegression.cs
r15583 r16158 115 115 public NeuralNetworkRegression() 116 116 : base() { 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 117 var validHiddenLayerValues = new ItemSet<IntValue>(new IntValue[] { 118 (IntValue)new IntValue(0).AsReadOnly(), 119 (IntValue)new IntValue(1).AsReadOnly(), 120 120 (IntValue)new IntValue(2).AsReadOnly() }); 121 121 var selectedHiddenLayerValue = (from v in validHiddenLayerValues … … 186 186 IEnumerable<int> rows = problemData.TrainingIndices; 187 187 double[,] inputMatrix = dataset.ToArray(allowedInputVariables.Concat(new string[] { targetVariable }), rows); 188 if (inputMatrix.C ast<double>().Any(x => double.IsNaN(x) || double.IsInfinity(x)))188 if (inputMatrix.ContainsNanOrInfinity()) 189 189 throw new NotSupportedException("Neural network regression does not support NaN or infinity values in the input dataset."); 190 190
Note: See TracChangeset
for help on using the changeset viewer.