コード例 #1
0
    public void BackPropSaveLoad1()
    {
        // ARRANGE
        string            path    = Application.dataPath + "/Test/testWeights1.text";
        List <double[][]> weights = new List <double[][]>();

        double[][] w1 = new double[][] {
            new double[] { 1.0, 3.450, 5.34, 7.0, 9.4 },
            new double[] { 0.2, 2.0, 4.0, 6.0, 11.12 }
        };

        weights.Add(w1);

        // ACT
        SaveWeights.WriteToFile(path, weights);

        BackPropWeights prop = new BackPropWeights();

        prop.layers       = new int[] { 5, 2 };
        prop.lengthLayers = 2;

        List <double[][]> weightsSaved = prop.LoadWeights(path);

        // ASSERT
        Assert.That(weightsSaved, Is.EqualTo(weights));
    }
コード例 #2
0
    //load weights from text file
    public void LoadChild()
    {
        string path = Application.dataPath + "/backPropWeights.text";

        backProp.SetWeights(saveLoad.LoadWeights(path));
    }