public void SetUp() { layer2 = new NeuronLayer(); layer1 = new NeuronLayer(layer2); double[,] weights1 = new double[, ] { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 } }; double[,] weights2 = new double[, ] { { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 }, { 1, 1, 1, 1 } }; for (int i = 0; i < NEURON_SIZE; i++) { Neuron neuron1 = new Neuron(LinearFunction.Instance); for (int j = 0; j <= weights1.GetUpperBound(0); j++) { neuron1.Weights.Add(weights1[i, j]); } layer1.AddNeuron(neuron1); Neuron neuron2 = new Neuron(LinearFunction.Instance); for (int j = 0; j <= weights2.GetUpperBound(0); j++) { neuron2.Weights.Add(weights2[i, j]); } layer2.AddNeuron(neuron2); } }
public void SetUp() { layer2 = new NeuronLayer(); layer1 = new NeuronLayer(layer2); double[,] weights1 = new double[,] { { 1, 1,1 ,1 }, { 1, 1, 1, 1 }, {1, 1, 1, 1}, { 1, 1, 1, 1}}; double[,] weights2 = new double[,]{ { 1, 1, 1,1 }, { 1, 1, 1, 1 }, {1, 1, 1, 1}, { 1, 1, 1, 1}}; for (int i = 0; i < NEURON_SIZE; i++) { Neuron neuron1 = new Neuron(LinearFunction.Instance); for(int j = 0; j <= weights1.GetUpperBound(0); j++) neuron1.Weights.Add(weights1[i,j]); layer1.AddNeuron(neuron1); Neuron neuron2 = new Neuron(LinearFunction.Instance); for (int j = 0; j <= weights2.GetUpperBound(0); j++) neuron2.Weights.Add(weights2[i,j]); layer2.AddNeuron(neuron2); } }