5

के साथ एएनएन को प्रशिक्षित करने के लिए कई प्रशिक्षण विधियों का उपयोग करें, मैं जानना चाहता हूं कि लचीला प्रचार प्रशिक्षण का उपयोग करने से पहले आनुवांशिक एल्गोरिदम, कण स्वार अनुकूलन और सिम्युलेटेड एनीलिंग के साथ एक फ़ीड आगे तंत्रिका नेटवर्क को प्रशिक्षण देना परिणामस्वरूप सुधार करता है। प्रशिक्षण एल्गोरिदम कि समग्र प्रशिक्षण में सुधार करना चाहिए का एक क्रम है के रूप में आप देख सकते हैंएन्कॉग

    CalculateScore score = new TrainingSetScore(trainingSet); 
        StopTrainingStrategy stop = new StopTrainingStrategy(); 
        StopTrainingStrategy stopGA = new StopTrainingStrategy(); 
        StopTrainingStrategy stopSIM = new StopTrainingStrategy(); 
        StopTrainingStrategy stopPSO = new StopTrainingStrategy(); 

        Randomizer randomizer = new NguyenWidrowRandomizer(); 
        //Backpropagation train = new Backpropagation((BasicNetwork) network, trainingSet, 0.2, 0.1); 
        // LevenbergMarquardtTraining train = new LevenbergMarquardtTraining((BasicNetwork) network, trainingSet); 
        int population = 500; 
        MLTrain trainGA = new MLMethodGeneticAlgorithm(new MethodFactory(){ 
         @Override 
         public MLMethod factor() { 
          final BasicNetwork result = createNetwork(); 
          ((MLResettable)result).reset(); 
          return result; 
         }}, score,population); 


        Date dStart = new Date(); 

        int epochGA = 0; 
        trainGA.addStrategy(stopGA); 
        do{ 
         trainGA.iteration(); 
         if(writeOnStdOut) 
          System.out.println("Epoch GenetiC#" + epochGA + " Error:" + trainGA.getError()); 
         epochGA++;//0000001 
         previousError = trainGA.getError(); 
         Date dtemp = new Date(); 
         totsecs = ((double)(dtemp.getTime()-dStart.getTime())/1000); 
        } while(previousError > maximumAcceptedErrorTreshold && epochGA < (maxIterations/5) && !stopGA.shouldStop() && totsecs < (secs/3)); 

        NeuralPSO trainPSO = new NeuralPSO((BasicNetwork) network, randomizer, score, 100); 

        int epochPSO = 0; 
        trainPSO.addStrategy(stopPSO); 
        dStart = new Date(); 
        do{ 
         trainPSO.iteration(); 
         if(writeOnStdOut) 
          System.out.println("Epoch Particle Swarm #" + epochPSO + " Error:" + trainPSO.getError()); 
         epochPSO++;//0000001 
         previousError = trainPSO.getError(); 
         Date dtemp = new Date(); 
         totsecs = ((double)(dtemp.getTime()-dStart.getTime())/1000); 
        } while(previousError > maximumAcceptedErrorTreshold && epochPSO < (maxIterations/5) && !stopPSO.shouldStop() && totsecs < (secs/3)); 

        MLTrain trainSIM = new NeuralSimulatedAnnealing((MLEncodable) network, score, startTemperature, stopTemperature, cycles); 

        int epochSA = 0; 
        trainSIM.addStrategy(stopSIM); 
        dStart = new Date(); 
        do{ 
         trainSIM.iteration(); 
         if(writeOnStdOut) 
          System.out.println("Epoch Simulated Annealing #" + epochSA + " Error:" + trainSIM.getError()); 
         epochSA++;//0000001 
         previousError = trainSIM.getError(); 
         Date dtemp = new Date(); 
         totsecs = ((double)(dtemp.getTime()-dStart.getTime())/1000); 
        } while(previousError > maximumAcceptedErrorTreshold && epochSA < (maxIterations/5) && !stopSIM.shouldStop() && totsecs < (secs/3)); 




        previousError = 0; 
        BasicTraining train = getTraining(method,(BasicNetwork) network, trainingSet); 


        //train.addStrategy(new Greedy()); 
        //trainAlt.addStrategy(new Greedy()); 
        HybridStrategy strAnneal = new HybridStrategy(trainSIM); 

        train.addStrategy(strAnneal); 
        //train.addStrategy(strGenetic); 
        //train.addStrategy(strPSO); 

        train.addStrategy(stop); 
        // 
        // Backpropagation train = new Backpropagation((ContainsFlat) network, trainingSet, 0.7, 0.3); 
        dStart = new Date(); 

        int epoch = 1; 

        do { 
         train.iteration(); 
         if(writeOnStdOut) 
          System.out.println("Epoch #" + epoch + " Error:" + train.getError()); 
         epoch++;//0000001 
         if(Math.abs(train.getError()-previousError)<0.0000001) iterationWithoutImprovement++; else iterationWithoutImprovement = 0; 
         previousError = train.getError(); 

         Date dtemp = new Date(); 
         totsecs = ((double)(dtemp.getTime()-dStart.getTime())/1000); 
        } while(previousError > maximumAcceptedErrorTreshold && epoch < maxIterations && !stop.shouldStop() && totsecs < secs);//&& iterationWithoutImprovement < maxiter); 

:

यहाँ कोड मैं का उपयोग कर रहा है।

अगर मुझे समझ में आता है और कोड सही है तो कृपया मुझे बताएं। ऐसा लगता है लेकिन मैं यह सुनिश्चित करना चाहता हूं क्योंकि कभी-कभी मुझे लगता है कि जीए द्वारा की गई प्रगति पीएसओ से रीसेट की जाती है।

धन्यवाद

उत्तर

1

यह तार्किक लगता है, हालांकि यह काम नहीं करेगा।

RPROP के डिफ़ॉल्ट मानकों के साथ, यह अनुक्रम संभवतः काम नहीं करेगा। इसका कारण यह है कि आपके पिछले प्रशिक्षण के बाद तंत्रिका नेटवर्क के वजन स्थानीय इष्टतम के पास होंगे। स्थानीय इष्टतम के निकटता के कारण केवल वजन में छोटे बदलाव इष्टतम (त्रुटि दर को कम) के करीब ले जाएंगे। डिफ़ॉल्ट रूप से RPROP वजन मैट्रिक्स में 0.1 के प्रारंभिक अद्यतन मूल्य का उपयोग करता है। नेटवर्क के लिए यह इष्टतम के करीब इतना बड़ा मूल्य है। आप इस बिंदु पर एक चीन की दुकान में एक बैल को उजागर कर रहे हैं "। पहला पुनरावृत्ति नेटवर्क को इष्टतम से दूर ले जाएगा और अनिवार्य रूप से एक नई वैश्विक खोज शुरू करेगा।

प्रारंभिक अद्यतन मूल्य को कम करने में सहायता चाहिए। मुझे यकीन नहीं है कि कितना। आप एक विचार प्राप्त करने के लिए अपने डेटा के साथ एक ट्रेन के लिए औसत आरपीआरपी वजन अद्यतन मूल्यों को देखना चाह सकते हैं। या इसे वास्तव में छोटा सेट करने और अपने तरीके से बैक अप करने का प्रयास करें।