Model Compressor

class condensa.Compressor(opt, scheme, model, trainloader, testloader, valloader, criterion)

Condensa model compressor class.

__init__(opt, scheme, model, trainloader, testloader, valloader, criterion)

Creates a Compressor instance.

Parameters
  • opt (condensa.Optimizer) – Optimizer.

  • scheme – Compression scheme (class).

  • model (torch.nn.Module) – PyTorch model.

  • trainloader – Training dataloader.

  • testloader – Test dataloader.

  • valloader – Validation dataloader.

  • criterion – Loss criterion.

run()

Executes model compressor.

Returns

Compressed model.

Return type

torch.nn.Module

property statistics

Retrieves compressed model statistics.

Returns

Model statistics.

Return type

dict