MLToolbox#
MLToolbox provides tools for converting CNN models into polynomial representations while minimizing performance degradation. The MLToolbox tutorial explores the process of making models FHE-friendly and demonstrates how MLToolbox simplifies this task. The resulting models can then be used for secure inference over HE.
Check out the following notebook for a usage example: MLToolbox Notebook.
The polynomial adaptation process is based on the method presented in this paper. In general, it consists of three steps:
Loading a pretrained non-polynomial model.
Range minimization: fine-tuning the model while adding a range-loss term to minimize the input to the non-polynomial layers.
Polynomial approximation: Replacing non-polynomial activation layers with polynomial approximations and fine-tuning until convergence.
Resources#
Classes#
|
This class defines the user arguments object, and sets the default values for some parameters |
This class helps in the FHE conversion of the model; namely the activation replacement. |
|
|
This class represents a training object, that has all the needed components for a training, like dataLoaders, optimizer, model etc. |