dfo.py
def save_checkpoint(self, iteration):
        """
        Saves a DFO checkpoint. This includes the weights, sigma, and the optimizer.
        """

        # update the model to match theta
        torch.nn.utils.vector_to_parameters(self.theta, self.model.parameters())

        state = {
            "model_state": self.model.state_dict(),
            "sigma": self.sigma,
            "step_opt_type": self.step_opt_type,
            "step_opt_params": self.step_opt.get_state()
        }

        torch.save(state, str(self.checkpoint_dir) + '/{}.pt'.format(iteration))
        self.logger.info('Saved checkpoint for iteration {}.'.format(iteration))

        Saves a DFO checkpoint. This includes the weights, sigma, and the optimizer.
        
Saves a DFO checkpoint. This includes the weights, sigma, and the optimizer.
Saves a DFO checkpoint . This includes the weights sigma and the optimizer .
def save_checkpoint(self, iteration):
        torch.nn.utils.vector_to_parameters(self.theta, self.model.parameters())
        state = {
            "model_state": self.model.state_dict(),
            "sigma": self.sigma,
            "step_opt_type": self.step_opt_type,
            "step_opt_params": self.step_opt.get_state()
        }
        torch.save(state, str(self.checkpoint_dir) + '/{}.pt'.format(iteration))
        self.logger.info('Saved checkpoint for iteration {}.'.format(iteration))
def save_checkpoint ( self , iteration ) : torch . nn . utils . vector_to_parameters ( self . theta , self . model . parameters ( ) ) state = { "model_state" : self . model . state_dict ( ) , "sigma" : self . sigma , "step_opt_type" : self . step_opt_type , "step_opt_params" : self . step_opt . get_state ( ) } torch . save ( state , str ( self . checkpoint_dir ) + '/{}.pt' . format ( iteration ) ) self . logger . info ( 'Saved checkpoint for iteration {}.' . format ( iteration ) )
Saves a DFO checkpoint.
Saves a DFO checkpoint .
"""
        Saves a DFO checkpoint. This includes the weights, sigma, and the optimizer.
        """ # update the model to match theta
self
iteration