// method to export true vs estimated (NN) output for a particular output index public void TestNetworkOutputValidationTimeDomain(int outputIndex) { double[,] trueOutput = new double[Inputs.Count() - 1, 2]; double[,] nnOutput = new double[Inputs.Count() - 1, 2]; double[,] bestNNOutput = new double[Inputs.Count() - 1, 2]; double[] tempInput1 = new double[NumInputs]; double[] tempInput2 = new double[NumInputs]; double[] tempOutput1; double[] tempOutput2; for (int i = 0; i < Inputs.Count() - 1; i++) { if (i == 0) { for (int j = 0; j < NumInputs; j++) { tempInput1[j] = Inputs[0][j]; tempInput2[j] = Inputs[0][j]; } } trueOutput[i, 0] = Convert.ToDouble(i); trueOutput[i, 1] = Outputs[i][outputIndex]; nnOutput[i, 0] = Convert.ToDouble(i); tempOutput1 = NeuralNet.ForwardPass(tempInput1); nnOutput[i, 1] = tempOutput1[outputIndex]; for (int j = 0; j < NumOutputs; j++) { tempInput1[j] = tempOutput1[j]; } for (int j = NumOutputs; j < NumInputs; j++) { tempInput1[j] = Inputs[i][j]; } bestNNOutput[i, 0] = Convert.ToDouble(i); tempOutput2 = BestNetwork.ForwardPass(tempInput2); bestNNOutput[i, 1] = tempOutput2[outputIndex]; for (int j = 0; j < NumOutputs; j++) { tempInput2[j] = tempOutput2[j]; } for (int j = NumOutputs; j < NumInputs; j++) { tempInput2[j] = Inputs[i][j]; } } DE.Export2DArray(trueOutput, "true_data_validation"); DE.Export2DArray(nnOutput, "nn_output_validation"); DE.Export2DArray(bestNNOutput, "best_nn_output_validation"); }
// method to export true vs estimated (NN) output for a particular output index public void TestNetworkOutputTraining(int inputIndex, int outputIndex) { double[,] trueOutput = new double[Inputs.Count(), 2]; double[,] nnOutput = new double[Inputs.Count(), 2]; double[,] bestNNOutput = new double[Inputs.Count(), 2]; for (int i = 0; i < Inputs.Count(); i++) { trueOutput[i, 0] = Inputs[i][inputIndex]; trueOutput[i, 1] = Outputs[i][outputIndex]; nnOutput[i, 0] = Inputs[i][inputIndex]; nnOutput[i, 1] = NeuralNet.ForwardPass(Inputs[i])[outputIndex]; bestNNOutput[i, 0] = Inputs[i][inputIndex]; bestNNOutput[i, 1] = BestNetwork.ForwardPass(Inputs[i])[outputIndex]; } DE.Export2DArray(trueOutput, "true_data_training"); DE.Export2DArray(nnOutput, "nn_output_training"); DE.Export2DArray(bestNNOutput, "best_nn_output_training"); }
// method to export true vs estimated (NN) output for a particular output index public void TestNetworkOutputValidation(int inputIndex, int outputIndex) { double[,] trueOutput = new double[ValidationInputs.Count(), 2]; double[,] nnOutput = new double[ValidationInputs.Count(), 2]; double[,] bestNNOutput = new double[ValidationInputs.Count(), 2]; for (int i = 0; i < ValidationInputs.Count(); i++) { trueOutput[i, 0] = ValidationInputs[i][inputIndex]; trueOutput[i, 1] = ValidationOutputs[i][outputIndex]; nnOutput[i, 0] = ValidationInputs[i][inputIndex]; nnOutput[i, 1] = NeuralNet.ForwardPass(ValidationInputs[i])[outputIndex]; bestNNOutput[i, 0] = ValidationInputs[i][inputIndex]; bestNNOutput[i, 1] = BestNetwork.ForwardPass(ValidationInputs[i])[outputIndex]; } DE.Export2DArray(trueOutput, "true_data_validation"); DE.Export2DArray(nnOutput, "nn_output_validation"); DE.Export2DArray(bestNNOutput, "best_nn_output_validation"); }