//save weights public void SaveChild() { //get weights of current child and add them to a list List <double[][]> weights = backProp.GetWeights(); string path = Application.dataPath + "/backPropWeights.text"; //write the list to a text file SaveWeights.WriteToFile(path, weights); }
public void Init1() { // ARRANGE BackPropNetwork backprop = new BackPropNetwork(); int expectedlength = 3; // ACT // ASSERT Assert.That(backprop.GetWeights().Count, Is.EqualTo(expectedlength)); Assert.That(backprop.weightsDer.Count, Is.EqualTo(expectedlength)); Assert.That(backprop.layerInputs.Count, Is.EqualTo(expectedlength)); Assert.That(backprop.layerOutputs.Count, Is.EqualTo(expectedlength)); Assert.That(backprop.layerLoss.Count, Is.EqualTo(expectedlength)); Assert.That(backprop.GetWeights().GetType() == typeof(List <double[][]>)); Assert.That(backprop.weightsDer.GetType() == typeof(List <double[][]>)); Assert.That(backprop.layerInputs.GetType() == typeof(List <double[]>)); Assert.That(backprop.layerOutputs.GetType() == typeof(List <double[]>)); Assert.That(backprop.layerLoss.GetType() == typeof(List <double[]>)); }