Hello everyone,
I’m going through this notebook (https://github.com/zama-ai/concrete-ml/blob/release/1.1.x/docs/advanced_examples/ConvolutionalNeuralNetwork.ipynb )line by line. The only thing I’m not understanding is the specific line of code where we encrypt the data. Which line of the code is to encrypt the input data? Could someone please clarify this for me?
Thank you!
Hello @aidenparker,
The line that are somewhat looking for lies within the test_with_concrete
function (cell 6) :
# Quantize the inputs and cast to appropriate data type
y_pred = quantized_module.forward(data, fhe=fhe_mode)
Here, foward
is a method that groups several major steps all together. Basically, it :
- quantizes the inputs (in the clear)
- encrypts the quantized inputs
- runs the inference in FHE using the encrypted inputs
- decrypts the (quantized) outputs
- de-quantizes the ouputs (in the clear)
We have a documentation page that gives an example on how to do these steps separately with built-in models. While the example is about a LogisticRegression
model and its predict
method, the ideas and APIs behind remain the same for a QuantizedModule
and its forward
method.
Besides, if you are more interested in having these steps separated for model deployment in a Client-Server setting, we also provide a specific API for that. You will find more information in the cloud inference section, as well as the deployment documentation along its notebook example.
Hope this helps !
1 Like