Learning a language, I decided to write a neural network for 3 neurons. The code is written, but somewhere an error. when compiling in the console, the exception message "System.ArgumentException" is displayed. I do not know how to edit the code so that it runs. I will be grateful for any help.
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using MathNet.Numerics.LinearAlgebra; using MathNet.Numerics.LinearAlgebra.Double; class Program { public double rain = 0.0, wish = 0.0, maths = 0.0; public static void Main() { Console.WriteLine("Hello. This is my test programm."); Console.WriteLine("Enter the nuber from 0.0 to 1.0 for rain, wish and maths."); Console.WriteLine("1.0 - Yes, 0.0 - No"); Console.ReadKey(); double rain = Convert.ToDouble(Console.ReadLine()); double wish = Convert.ToDouble(Console.ReadLine()); double maths = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("should you go: " + Predict(rain, wish, maths)); } public static double Activations_fuction(double x) { if (x >= 0.5) return 1; else return 0; } public static bool Predict (double rain, double wish, double maths) { bool res_1 = true; Matrix<double> last_ficking_matrix_in_this_code_i_hope = DenseMatrix.OfArray(new double[,] { {1} }); Matrix<double> input = DenseMatrix.OfArray(new double[,] { {rain, wish, maths}, }); Matrix<double> weight_input_to_hiden = DenseMatrix.OfArray(new double[,] { {0.25, 0.25, 0}, {0.5, -0.4, 0.9}, }); var weight_hiden_to_output = DenseMatrix.OfArray(new double[,] { {-1, 1}, }); Matrix<double> hiden_input = weight_hiden_to_output * input; Console.WriteLine("hiden_input: " + hiden_input); Matrix<double> hiden_output = hiden_input.Map(Activations_fuction, Zeros.Include); Console.WriteLine("hiden_output: " + hiden_output); var output = weight_hiden_to_output * hiden_output; Console.WriteLine("output: " + output); var output_final = output.Map(Activations_fuction, Zeros.AllowSkip); if (output_final == last_ficking_matrix_in_this_code_i_hope) { res_1 = true; return res_1; } else return res_1 = false; } } }
найди ошибкуquiz for us to make aнайди ошибку? - tym32167