예제 #1
0
    void trainLinearMulticlass()
    {
        print("Starting trainning");
        _outputTrainningMulticlass.Clear();

        _outputTrainningMulticlass = new List <double[]>();

        int outputLength = trainningOuput.Length / _outputSize;

        for (int i = 0; i < _outputSize; i++)
        {
            List <double> tmp = new List <double>();
            for (int j = 0; j < outputLength; j++)
            {
                tmp.Add(trainningOuput[j * _outputSize + i]);
            }

            _outputTrainningMulticlass.Add(tmp.ToArray());
        }


        for (int i = 0; i < _outputTrainningMulticlass.Count; i++)
        {
            MlDllWrapper.trainLinearClass(_myMulticlassModel[i], trainningInput, trainningInput.Length, _inputSize,
                                          _outputTrainningMulticlass[i],
                                          _outputTrainningMulticlass[i].Length, 1, learningRate, isClassification, epochs);
        }

        print("Trainning Finished");
    }
예제 #2
0
    void trainModel()
    {
        print("Model start trainning");

        MlDllWrapper.trainLinearClass(MyModel, trainningInput, trainningInput.Length, 2,
                                      trainningOuput, trainningOuput.Length, 1, learningRate, true, epochs);
        print("Model finished train");
    }