public void CreateSynapsisNetwork(HiddenLayer hl) { int k = 0; for (int i = 0; i < Neurons.Length; i++) { for (int j = 0; j < hl.Neurons.Length; j++) { Synapse temp = new Synapse(WeightRecords[k], hl.Neurons[j], Neurons[i]); hl.Neurons[j].AddSynapsis(temp, true); Neurons[i].AddSynapsis(temp); k++; } } }
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); }