Patent ID: 11874640
Assignee: WUHAN UNIVERSITY
Field: Electrical machinery, apparatus, energy (Electrical engineering)
Classification: CPC G  H | IPC G  H

Claim 0:
1. A wind power prediction method for optimizing a deep Transformer network, comprising:
taking a collected sequence data of wind power and related influencing factors as a sample data;
performing maximum and minimum normalization processing on all of the sample data, and dividing the normalized sample data into a training set and a test set;
initializing Transformer network parameters, setting a value range and a search range of hyper-parameters in the Transformer network to be optimized, and determining a maximum number of iteration and a population size of a whale group;
establishing a Transformer network model according to the values of the hyper-parameters in the initialized Transformer network, respectively training and predicting the data in the training set and the test set, and taking an average absolute error of wind power prediction as a fitness value of each of the whale groups;
determining a local optimal position according to the initial fitness value of the individual whale group, updating a current optimal position by utilising whale group optimization, and obtaining an optimal prediction effect by comparing a local optimal solution with a global optimal solution;
obtaining an optimal hyper-parameter combination in the Transformer network after a plurality of iterations of the whale optimization algorithm WOA, and predicting wind power by using the optimal parameters to construct a WOA-Transformer wind power prediction model,
wherein the step of obtaining the optimal hyper-parameter combination in the Transformer network after the plurality of iterations of the whale optimization algorithm WOA comprises:
taking the hyper-parameters in the Transformer network as individuals in the whale group, initializing the whale group, and using a random number generator to automatically generate an initial solution of the hyper-parameters in the Transformer network;
in response to a value of a random parameter p being less than a first preset value, then it is determined whether a coefficient vector |A| is less than a second preset value, and in response to the coefficient vector |A| being less than the second preset value, then a shrink-envelopment predation mechanism is selected, a position of the individual is updated according to A=2a·r−a,C=2r and, a
   =
   
    2
    -
    
     
      2
      ⁢
      j
     
     M
    
   
  
  ,, in response to the coefficient vector |A| being not less than the second preset value, then a search and predation mechanism is selected, and the position of the individual is updated according to, {
  
   
    
     
      
       X
       =
       
        
         X
         
          r
          ⁢
          a
          ⁢
          n
          ⁢
          d
         
        
        -
        
         A
         ·
         D
        
       
      
     
    
    
     
      
       D
       =
       
        
         ❘
         "\[LeftBracketingBar]"
        
        
         
          C
          ·
          
           X
           
            
             r
             ⁢
             and
            
            ,
            j
           
          
         
         -
         X
        
        
         ❘
         "\[RightBracketingBar]"
        
       
      
     
    
   
   ,, in the expression, a is a constant corresponding to a current number of iterations j, and a is a matrix that is formed by the constant a during the iterations, M is the maximum number of iterations, r is a random vector and r∈[0,1], Xrand represents a current random position vector of a humpback whale population, Xrand,i represents the j-th data in Xrand;
in response to the value of the random parameter p being not less than the first preset value, then a spiral predation mechanism is selected, and the position of the individual is updated according to, {
  
   
    
     
      
       
        X
        
         j
         +
         1
        
       
       =
       
        
         
          D
          ′
         
         ⁢
         
          e
          
           b
           ⁢
           l
          
         
         ⁢
         
          cos
          ⁡
          (
          
           2
           ⁢
           π
           ⁢
           l
          
          )
         
        
        +
        
         X
         j
         *
        
       
      
     
    
    
     
      
       
        D
        ′
       
       =
       
        
         ❘
         "\[LeftBracketingBar]"
        
        
         
          X
          j
          *
         
         -
         
          X
          j
         
        
        
         ❘
         "\[RightBracketingBar]"
        
       
        
      
     
    
   
   ,, in the expression, Xj, Xj+1 and X*j respectively represent a current position, a position at the next moment, and an optimal position of the whale group, D represents a spatial distance between the current optimal position of the i-th whale and the optimal value, b is a logarithmic spiral constant, l is a random number and l∈[−1,1];
calculating fitness values of all individuals in the whale group and updating the global optimal value, and obtaining the optimal hyper-parameter combination in the Transformer network after the plurality of iterations of the whale optimization algorithm WOA.