Exemple #1
0
        static RnnTrainResult Train(DataSet data, int layer1NodeCount, int layer2NodeCount, int epochMax)
        {
            var numInputs = data.Input.RowCount;
            var layers    = new List <LayerSpec> {
                new LayerSpec(layer1NodeCount, true, ActivationType.LogisticSigmoid),
                new LayerSpec(layer2NodeCount, true, ActivationType.LogisticSigmoid),
                new LayerSpec(1, false, ActivationType.Linear)
            };

            var weightCount    = RNN.GetWeightCount(layers, numInputs);
            var initialWeights = QuqeUtil.MakeRandomVector(weightCount, -1, 1);

            return(RNN.TrainSCG(layers, initialWeights, epochMax, data.Input, data.Output));
        }