public void CanBack1() { wc_1b.Run(vector_1); NetworkVector inputGradientCheck = vector_1.Copy(); NetworkVector biasesGradientCheck = vector_1.Copy(); WeightsMatrix weightsGradientCheck = matrix_1.Copy(); Assert.AreEqual(inputGradientCheck, wc_1b.InputGradient(vector_1)); Assert.AreEqual(biasesGradientCheck, wc_1b.BiasesGradient(vector_1)); Assert.AreEqual(weightsGradientCheck, wc_1b.WeightsGradient(vector_1, vector_1)); }
public void CanCopy() { NetworkVector vector1 = new NetworkVector(new double[] { 1, 0 }); NetworkVector vector2 = vector1.Copy(); double[] vector1Values = vector1.ToArray(); double[] vector2Values = vector2.ToArray(); Assert.AreEqual(vector1Values[0], vector2Values[0]); Assert.AreEqual(vector1Values[1], vector2Values[1]); }