enter image description here 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; } } 

}

  • 2
    Do you найди ошибку quiz for us to make a найди ошибку ? - tym32167
  • @ tym32167 I'm just learning, so I can't find the error myself and ask for help from others. I provided the code in the hope that someone will try to compile it, and understand what the error is - Nuti.Naguti
  • No one will guess what's wrong with your code. Spend information about what your code does, what it does not work as you expect, how it should work, how you yourself tried to solve your problem and what did not work out. Without this, no one will even read your question. - tym32167
  • @ tym32167 thanks for the advice, edited the question - Nuti.Naguti
  • 1) specify what you enter from the console when you start the program 2) On which line is the exception specifically? - tym32167

0