clika_compress
clika_compress(
- output_path:
Union[str, Path]
- settings:
Settings
- model:
object
- init_training_dataset_fn:
Callable[[], Any]
- init_evaluation_dataset_fn:
Optional[Callable[[], Any]]
- optimizer:
object
- training_losses:
dict
- training_metrics:
Optional[dict]
= None- evaluation_losses:
Optional[dict]
= None- evaluation_metrics:
Optional[dict]
= None- callbacks:
Optional[List[BaseCallback]]
= None- **kwargs:
dict
) ‑>
str
Entry point for running Compression.
Parameters:
- output_path (
str/Path
) - Path to save the files being generated by the library - settings (
Settings
) - Settings that contains all the necessary information to run the model - model (
torch.nn.Module
) - torch nn Module - init_training_dataset_fn (
Callable[[], Any]
) - Pointer to a function that initializes the Dataloaders - init_evaluation_dataset_fn (
Optional[Callable[[], Any]]
) - Pointer to a function that initializes the Dataloaders - optimizer (
torch.optim.Optimizer
) - Optimizer object. In PyTorch it's an object from: torch.optim... When Resuming, 'optimizer' can be set to None unless it is a custom Optimizer. - training_losses (
Dict[str, Callable]
) - Dictionary mapping between a Name to a Loss Object used for Training. Can be a function that accepts (preds, target) or a Metric that implements an interface like torchmetrics. - training_metrics (
Dict[str, Callable]
) - Dictionary mapping between a Name to a Metric Object used for Training. Can be a function that accepts (preds, target) or a Metric that implements an interface like torchmetrics. - evaluation_losses (
Dict[str, Callable]
) - Dictionary mapping between a Name to a Loss Object used for Evaluation. Can be a function that accepts (preds, target) or a Metric that implements an interface like torchmetrics. - evaluation_metrics (
Dict[str, Callable]
) - Dictionary mapping between a Name to a Metric Object used for Evaluation. Can be a function that accepts (preds, target) or a Metric that implements an interface like torchmetrics. - callbacks (
List[BaseCallback]
) - Callbacks that will be called during compression to update the status of it. - kwargs (
Optional[dict]
) - Not used at the moment
Returns:
str
: Path to the latest CLIKA state