Beispiel #1
0
        public void NodgeWB(float Eta)
        {
            WeightRecords.Clear();
            BiasRecords.Clear();
            for (int i = 0; i < NeuronNumber; i++)
            {
                Neurons[i].NodgeWB(Eta);
                for (int j = 0; j < Neurons[i].LeftS.Count; j++)
                {
                    WeightRecords.Add(Neurons[i].LeftS[j].Weight);
                }

                BiasRecords.Add(Neurons[i].Bias);
            }
            DataStream.Instance.WriteWBOnFile(WeightRecords, "Weights/s_outputL.json");
            DataStream.Instance.WriteWBOnFile(BiasRecords, "Biases/b_outputL.json");
        }
        public void Init_CreateSynapsisNetwork(HiddenLayer hl)
        {
            Random rn = new Random();

            for (int i = 0; i < Neurons.Length; i++)
            {
                for (int j = 0; j < hl.Neurons.Length; j++)
                {
                    float   weightTemp = ((float)rn.Next(-10, 10)) / 10.0f;
                    Synapse temp       = new Synapse(weightTemp, hl.Neurons[j], Neurons[i]);
                    hl.Neurons[j].AddSynapsis(temp, true);
                    Neurons[i].AddSynapsis(temp, false);
                    WeightRecords.Add(weightTemp);
                }
            }
            DataStream.Instance.WriteWBOnFile(WeightRecords, SynapsesFile);
        }