FANNCSharp.Float.NeuralNet.TrainEpochIrpropmParallel C# (CSharp) Method

TrainEpochIrpropmParallel() public method

public TrainEpochIrpropmParallel ( TrainingData data, uint threadNumb ) : float
data TrainingData
threadNumb uint
return float
        public float TrainEpochIrpropmParallel(TrainingData data, uint threadNumb)
        {
            return fannfloat.train_epoch_irpropm_parallel(net.to_fann(), data.ToFannTrainData(), threadNumb);
        }

Same methods

NeuralNet::TrainEpochIrpropmParallel ( TrainingData data, uint threadNumb, List predictedOutputs ) : float

Usage Example

コード例 #1
0
ファイル: ParallelTrain.cs プロジェクト: joelself/FannCSharp
        static void Main(string[] argv)
        {
            const uint max_epochs = 1000;
            uint num_threads = 1;
            TrainingData data;
            NeuralNet net;
            long before;
            float error;

            if (argv.Length == 2)
                num_threads = UInt32.Parse(argv[1]);
            using (data = new TrainingData("..\\..\\..\\datasets\\mushroom.train"))
            using (net = new NeuralNet(NetworkType.LAYER, 3, data.InputCount, 32, data.OutputCount))
            {
                net.ActivationFunctionHidden = ActivationFunction.SIGMOID_SYMMETRIC;
                net.ActivationFunctionOutput = ActivationFunction.SIGMOID;

                before = Environment.TickCount;
                for (int i = 1; i <= max_epochs; i++)
                {
                    error = num_threads > 1 ? net.TrainEpochIrpropmParallel(data, num_threads) : net.TrainEpoch(data);
                    Console.WriteLine("Epochs     {0}. Current error: {1}", i.ToString("00000000"), error.ToString("0.0000000000"));
                }

                Console.WriteLine("ticks {0}", Environment.TickCount - before);
                Console.ReadKey();
            }
        }