public static void Connect(Layer main, Layer other, Synapse[,] synapses) { if (!main.IsBiasNull()) { Perceptron.Connect(main.bias, other.perceptrons.ToArray()); } Perceptron.Connect(main.perceptrons.ToArray(), other.perceptrons.ToArray()); }
public Layer(int len, bool bias_enable, ActivationType.Type activation_type, PerceptronType.Type perceptron_type) { type = perceptron_type; for (int i = 0; i < len; i++) { perceptrons.Add(new Perceptron() { activation_type = activation_type, type = type, tag = "untitled", current_layer = this }); } if (bias_enable) { bias = new Perceptron() { type = PerceptronType.Type.bias, tag = "bias", state = 1f, current_layer = this }; } }