Patent ID: 11935271
Assignee: TENCENT AMERICA LLC
Field: Audio-visual technology (Electrical engineering)
Classification: CPC G  H | IPC G

Claim 14:
15. A non-transitory computer readable medium having stored thereon a computer program for compressing a neural network model, the computer program configured to cause one or more computer processors to:
identify one or more blocks from among a superblock corresponding to a multi-dimensional tensor associated with a neural network and based on losses of the one or more blocks;
unify a set of weight coefficients associated with the superblock; and
compress a model of the neural network based on the unified set of weight coefficients and on and on a gradient of the losses and a unifying mask associated with the set of weight coefficients,
wherein the set weight coefficients is Θ={W} of a network layer and where W is 5-dimensional (5D) tensor of size (ci, k1, k2, k3, co),
wherein an input of the network layer is a 4D tensor A of size (hi,wi,di,ci),
wherein an output of the network layer is a 4D tensor B of size (ho,wo,do,co),
wherein ci, k1, k2, k3, co, hi, wi, di, ho, wo, do are integer numbers greater or equal to 1,
wherein each item of each of the 4D tensor A and the 4D tensor B is a floating number,
wherein M denotes a 5D binary mask of a same size as W and each item in M is a binary number indicating whether a corresponding weight coefficient is pruned, and
wherein unifying the set of weight coefficients comprises obtaining an output of the 4D tensor B by a convolution of 4D tensor A, M, and W as W:, B
       
        
         l
         ′
        
        ,
        
         m
         ′
        
        ,
        
         n
         ′
        
        ,
        v
       
      
      =
      
       
        
         ∑
          
        
        
         r
         =
         1
        
        
         k
         1
        
       
       ⁢
       
        
         ∑
          
        
        
         s
         =
         1
        
        
         k
         2
        
       
       ⁢
       
        
         ∑
          
        
        t
        
         k
         3
        
       
       ⁢
       
        
         ∑
          
        
        
         u
         =
         1
        
        
         c
         1
        
       
       ⁢
       
        M
        
         u
         ,
         r
         ,
         s
         ,
         t
         ,
         v
        
       
       ⁢
       
        W
        
         u
         ,
         r
         ,
         s
         ,
         t
         ,
         v
        
       
       ⁢
       
        A
        
         u
         ,
         
          l
          -
          
           
            
             k
             1
            
            -
            1
           
           2
          
          +
          r
         
         ,
         
          m
          -
          
           
            
             k
             2
            
            -
            1
           
           2
          
          +
          s
         
         ,
         
          n
          -
          
           
            
             k
             3
            
            -
            1
           
           2
          
          +
          t
         
        
       
      
     
     ,
    
   
  
  
   
    
     
      l
      =
      1
     
     ,
     
      …
      ⁢
         
      
       h
       i
      
     
     ,
     
      m
      =
      1
     
     ,
     …
        
     ,
     
      w
      i
     
     ,
      
     
      n
      =
      1
     
     ,
     …
        
     ,
     
      d
      i
     
      
     ,
     
      
       l
       ′
      
      =
      1
     
     ,
     …
        
     ,
     
      h
      o
     
     ,
    
   
  
  
   
    
     
      
       m
       ′
      
      =
      1
     
     ,
     …
        
     ,
     
      w
      o
     
     ,
     
      
       n
       ′
      
      =
      1
     
     ,
     …
        
     ,
     
      d
      o
     
     ,
     
      v
      =
      1
     
     ,
     …
        
     ,
     
      c
      o
     
    
   
  
 

where parameters hi, wi, di, h0, wo, and do represent a height, weight and depth of the 4D tensor A and the 4D tensor B respectively, the parameters ci and co is a number of input and output channels respectively, and the parameters k1, k2, and k3 are sizes of a convolution kernel corresponding to height, weight, and depth axes respectively.