(self,
                 w,
                 pi,
                 delta,
                 trainloader,
                 testloader,
                 valloader,
                 criterion)
return compressed, statistics
Performs model compression using direct optimization.

        :param w: PyTorch model.
        :type w: `torch.nn.Module`
        :param pi: Compression function.
        :param delta: Decompression function.
        :param trainloader: Training dataloader.
        :param testloader: Test dataloader.
        :param valloader: Validation dataloader.
        :param criterion: Loss criterion.
Performs model compression using direct optimization.
Performs model compression using direct optimization .
def compress(self,
                 w,
                 pi,
                 delta,
                 trainloader,
                 testloader,
                 valloader,
                 criterion):
        """
        Performs model compression using direct optimization.

        :param w: PyTorch model.
        :type w: `torch.nn.Module`
        :param pi: Compression function.
        :param delta: Decompression function.
        :param trainloader: Training dataloader.
        :param testloader: Test dataloader.
        :param valloader: Validation dataloader.
        :param criterion: Loss criterion.
        """
        statistics = dict()
        timer_dc = EventTimer()
        with torch.no_grad():
            compressed = deepcopy(w)
        pi(compressed)
        statistics['total_elapsed'] = timer_dc.elapsed_seconds

        return compressed, statistics
def compress ( self , w , pi , delta , trainloader , testloader , valloader , criterion ) : statistics = dict ( ) timer_dc = EventTimer ( ) with torch . no_grad ( ) : compressed = deepcopy ( w ) pi ( compressed ) statistics [ 'total_elapsed' ] = timer_dc . elapsed_seconds return compressed , statistics