public void BinaryLoad(string FileName) { using (BinaryReader reader = new BinaryReader(File.Open(FileName, FileMode.Open))) { // пока не достигнут конец файла // считываем каждое значение из файла int InpW = reader.ReadInt32(); InputWeight = InpW; int Length = reader.ReadInt32(); Sheet = new List <Neiron> [Length]; for (int z = 0; z < Length; z++) { Sheet[z] = new List <Neiron>(); int Length1 = reader.ReadInt32(); for (int i = 0; i < Length1; i++) { Neiron n = new Neiron(z); Sheet[z].Add(n); int Length2 = reader.ReadInt32(); n.Weights = new List <Double>(); for (int j = 0; j < Length2; j++) { Double w = reader.ReadDouble(); n.Weights.Add(w); } } } } }
public Double[] LearnOutNeironInputAmbi(Double[] Sigma)//Out Sigmas { Double[] RealInput = new Double[Input.Length]; for (int index = 0; index < Sigma.Length; index++) { Sheet[Sheet.Length - 1][index].LearnNeironInput(Sigma[index], Alfa, ref Sheet); } for (int j = Sheet.Length - 2; j > -1; j--) { for (int LearningIndexInLayear = 0; LearningIndexInLayear < Sheet[j].Count; LearningIndexInLayear++) { Double LearningSigma = 0; for (int i = 0; i < Sheet[j + 1].Count; i++) { LearningSigma += Sheet[j + 1][i].DeltaMiss * Sheet[j + 1][i].Weights[LearningIndexInLayear]; } Sheet[j][LearningIndexInLayear].LearnNeiron(LearningSigma, Alfa, ref Sheet, ref Input); } } for (int LearningIndexInLayear = 0; LearningIndexInLayear < Input.Length; LearningIndexInLayear++) { Double LearningSigma = 0; for (int i = 0; i < Sheet[0].Count; i++) { LearningSigma += Sheet[0][i].DeltaMiss * Sheet[0][i].Weights[LearningIndexInLayear]; } { Double DeltaMiss = LearningSigma * Neiron.DActivationFunction(Input[LearningIndexInLayear]); RealInput[LearningIndexInLayear] = Alfa * DeltaMiss * Input[LearningIndexInLayear]; } } return(RealInput); }