private Thread[] threads;    //обучающие потоки

        public MultithreadedLearning(uint networksCount, LearningData[] datas, NeuronNetwork proto, uint genCount, double learningRate)
        {
            networks = new LearningMachine[networksCount];
            threads  = new Thread[networksCount];
            for (int i = 0; i < networksCount; i++)
            {
                //создание машин обучения для каждой нс
                int index = i;
                networks[i] = new LearningMachine((NeuronNetwork)proto.Clone());
                networks[i].Edit(datas, genCount, learningRate);
                threads[i] = new Thread(new ThreadStart(networks[index].StartLearning)); //создание потока обучение
            }
        }
示例#2
0
 public LearningMachine(NeuronNetwork network)
 {
     this.network = (NeuronNetwork)network.Clone();
     this.network.Create();
     this.network.GenerateRandomWeights(-1, 1);
 }