Hi, I wrote a code that benchmarks the inference speed of a (trained) logistic regression model with help of many people on FHE.org discord, and I found that this does not work anymore for v0.6.1 (I used v0.5.1 previously). Could someone help me to fix this? So the goal is to measure the time for quantization, encryption, inference, decryption, and de-quantization separately, not all at once.
model = ConcreteLR(n_bits=n_bits)
model.fit(X_train, y_train)
model_circuit = model.compile(X_train)
model_circuit.keygen(force=True)
# Encrypted inference, one-by-one
y_pred_enc = []
for i in range(len(X_test)):
clear_input = X_test[[i], :]
quantized_input = model.quantize_input(clear_input)
encrypted_input = model_circuit.encrypt(quantized_input)
encrypted_output = model_circuit.run(encrypted_input)
decrypted_output = model_circuit.decrypt(encrypted_output)
dequantized_output = model.quantized_module_.dequantize_output(decrypted_output)
y_pred_enc.append(dequantized_output)
The error message said that AttributeError: 'LogisticRegression' object has no attribute 'quantized_module_'
, when de-quantize. So it seems that the rest of the part still works well.
Also, let me know if there’s anything that I need to change for the better performance (especially for the very fast linear models). Thanks in advance.