parameters: (self, input)
return_statement: return result
docstring: Perform the forward processing of the given input and return the prediction
docstring_summary: Perform the forward processing of the given input and return the prediction
docstring_tokens: Perform the forward processing of the given input and return the prediction
function: def forward(self, input):
          """ Perform the forward processing of the given input and return the prediction """
          # input is shape: [seq,batch,feature]
          if self.tracking:
              if self.mean is not None:
                  input = (input - self.mean) / self.std
          gru_out, self.hidden1 = self.gru1(input, self.hidden1)
          # we have to detach the hidden states because we may keep them longer than 1 iteration.
          self.hidden1 = self.hidden1.detach()
          if self.gru2 is not None:
              gru_out, self.hidden2 = self.gru2(gru_out, self.hidden2)
              self.hidden2 = self.hidden2.detach()
          if self.gru3 is not None:
              gru_out, self.hidden3 = self.gru3(gru_out, self.hidden3)
              self.hidden3 = self.hidden3.detach()
  
          # If we train taking the mean of all the prediction then it has higher chance to get triggered when a
          # similar word is spoken.  So by taking only the prediction at the end of the word is better way to
          # perform keyword spotting. So that rnn will get chance to run on complete keyword and make prediction.
          keyword_space = self.hidden2keyword(gru_out[-1, :, :])
          result = F.log_softmax(keyword_space, dim=1)
          return result
function_tokens: def forward ( self , input ) : # input is shape: [seq,batch,feature] if self . tracking : if self . mean is not None : input = ( input - self . mean ) / self . std gru_out , self . hidden1 = self . gru1 ( input , self . hidden1 ) # we have to detach the hidden states because we may keep them longer than 1 iteration. self . hidden1 = self . hidden1 . detach ( ) if self . gru2 is not None : gru_out , self . hidden2 = self . gru2 ( gru_out , self . hidden2 ) self . hidden2 = self . hidden2 . detach ( ) if self . gru3 is not None : gru_out , self . hidden3 = self . gru3 ( gru_out , self . hidden3 ) self . hidden3 = self . hidden3 . detach ( ) # If we train taking the mean of all the prediction then it has higher chance to get triggered when a # similar word is spoken.  So by taking only the prediction at the end of the word is better way to # perform keyword spotting. So that rnn will get chance to run on complete keyword and make prediction. keyword_space = self . hidden2keyword ( gru_out [ - 1 , : , : ] ) result = F . log_softmax ( keyword_space , dim = 1 ) return result