(self, loss)
return grad_norm
Standard backward step with self.timer and debugger
        Arguments
            loss - the loss to perform loss.backward()
Standard backward step with self.timer and debugger
        Arguments
            loss - the loss to perform loss.backward()
Standard backward step with self . timer and debugger Arguments loss - the loss to perform loss . backward ()
def backward(self, loss):
        '''
        Standard backward step with self.timer and debugger
        Arguments
            loss - the loss to perform loss.backward()
        '''
        self.timer.set()
        loss.backward()
        grad_norm = torch.nn.utils.clip_grad_norm_(
            self.model.parameters(), self.GRAD_CLIP)
        if math.isnan(grad_norm):
            self.verbose('Error : grad norm is NaN @ step '+str(self.step))
        else:
            self.optimizer.step()
        self.timer.cnt('bw')
        return grad_norm
def backward ( self , loss ) : self . timer . set ( ) loss . backward ( ) grad_norm = torch . nn . utils . clip_grad_norm_ ( self . model . parameters ( ) , self . GRAD_CLIP ) if math . isnan ( grad_norm ) : self . verbose ( 'Error : grad norm is NaN @ step ' + str ( self . step ) ) else : self . optimizer . step ( ) self . timer . cnt ( 'bw' ) return grad_norm