(self, lr, mu, theta, lm, closure=None)
return loss
Takes one optimizer step.

        :param lr: Current learning rate.
        :type lr: float
        :param mu: L-C mu hyper-parameter value.
        :type mu: float
        :param theta: Compressed model.
        :type theta: torch.nn.Module
        :param lm: Lagrange multiplier.
        :type lm: torch.nn.Module
        :param closure: Loss closure.
Takes one optimizer step.
Takes one optimizer step .
def step(self, lr, mu, theta, lm, closure=None):
        """
        Takes one optimizer step.

        :param lr: Current learning rate.
        :type lr: float
        :param mu: L-C mu hyper-parameter value.
        :type mu: float
        :param theta: Compressed model.
        :type theta: torch.nn.Module
        :param lm: Lagrange multiplier.
        :type lm: torch.nn.Module
        :param closure: Loss closure.
        """
        loss = None
        if closure is not None:
            loss = closure()

        self.learning_rate = lr
        for w_m, theta_m, lm_m in zip(self.w.modules(), theta.modules(),
                                      lm.modules()):
            if hasattr(theta_m, 'condense'):
                for pname in theta_m.condense:
                    self._step(getattr(w_m, pname), True, mu,
                               getattr(theta_m, pname), getattr(lm_m, pname))
                params = set([name for name, _ in theta_m.named_parameters()])
                rparams = params - theta_m.condense
                for pname in rparams:
                    self._step(getattr(w_m, pname))
            else:
                for w_p in w_m.parameters(recurse=False):
                    self._step(w_p)
        return loss
def step ( self , lr , mu , theta , lm , closure = None ) : loss = None if closure is not None : loss = closure ( ) self . learning_rate = lr for w_m , theta_m , lm_m in zip ( self . w . modules ( ) , theta . modules ( ) , lm . modules ( ) ) : if hasattr ( theta_m , 'condense' ) : for pname in theta_m . condense : self . _step ( getattr ( w_m , pname ) , True , mu , getattr ( theta_m , pname ) , getattr ( lm_m , pname ) ) params = set ( [ name for name , _ in theta_m . named_parameters ( ) ] ) rparams = params - theta_m . condense for pname in rparams : self . _step ( getattr ( w_m , pname ) ) else : for w_p in w_m . parameters ( recurse = False ) : self . _step ( w_p ) return loss