Skip to content

Commit

Permalink
chore: clean a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft committed Apr 29, 2024
1 parent 6da7866 commit a5666f1
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 75 deletions.
158 changes: 87 additions & 71 deletions docs/advanced_examples/LogisticRegressionTraining.ipynb

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/concrete/ml/sklearn/linear_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ..onnx.ops_impl import numpy_sigmoid
from ..quantization import QuantizedModule
from ..torch.compile import compile_torch_model
from ._fhe_training_utils import LogisticRegressionTraining, binary_cross_entropy
from ._fhe_training_utils import LogisticRegressionTraining
from .base import (
Data,
SklearnLinearClassifierMixin,
Expand Down Expand Up @@ -180,7 +180,7 @@ def __init__(
# Concrete ML attributes for FHE training
# These values are hardcoded for now
# We don't expose them in the __init__ arguments but they are taken
# into account when training, so we can just modify them manually.
# into account when training, so wecan just modify them manually.
# The number of bits used for training should be adjusted according to n-bits
# but for now we use this hardcoded values.
# FIXME: https://github.com/zama-ai/concrete-ml-internal/issues/4205
Expand Down Expand Up @@ -591,11 +591,11 @@ def _fit_encrypted(
# Iterate on the training quantized module in the clear
for iteration_step in range(max_iter):
X_batch_enc_i, y_batch_enc_i = X_batches_enc[iteration_step], y_batches_enc[iteration_step]

# Train the model over one iteration
inference_start = time.time()

# If the training is done in FHE, execute the underlying FHE circuit dfzirectly on the
# If the training is done in FHE, execute the underlying FHE circuit directly on the
# encrypted values
if fhe == "execute":
weights_enc, bias_enc = self.training_quantized_module.fhe_circuit.run(
Expand Down

0 comments on commit a5666f1

Please sign in to comment.