mirror of
https://github.com/luxfhe/ml-sdk.git
synced 2026-10-30 18:13:04 +00:00
After merging chore/purge-zama-brand and chore/purge-zama-brand-v2,
applied the v2 commit's substitution map to the ~18 files those
branches missed:
notebooks (docs/advanced_examples/*.ipynb, cifar_brevitas_finetuning/*.ipynb)
pyproject.toml, poetry.lock
.gitleaksignore, .github/workflows/publish_aws_ami.yaml
.github/ISSUE_TEMPLATE/release.md, private_dictionary.txt
Substitutions (consistent with v2 commit's mapping):
zama-ai/concrete-ml → luxfhe/ml-sdk
zama-ai/concrete → luxfhe/torus
zama-ai/tfhe-rs → luxfhe/tfhe
zama-ai → luxfhe
github.com/zama-ai → github.com/luxfhe
docs.zama.ai → docs.luxfhe.com
zama-pypi-cpu → luxfhe-pypi-cpu
Concrete ML → TorusML
concrete-ml → torus-ml
concrete_ml → torus_ml
Concrete framework → Torus framework
Concrete compiler → Torus compiler
Concrete by Zama → Torus by Lux Industries
tfhe-rs / TFHE-rs → Lux-FHE
fhEVM → TorusEVM
Zama → Lux Industries
Fhenix → (removed)
After this commit, the only "zama" string matches remaining in the
working tree (per grep -ril) are inside base64-encoded PNG image
data in notebooks — coincidental substring matches, NOT real
references. Verified 10 files × 1-2 matches each, all 0 outside b64.
Residual real work for phase 2 (NOT in this commit):
- 89 Python files contain `from concrete.fhe import …` etc.
These require luxfhe/torus to be a publishable Python module
before the import statements can be safely renamed. Tracked
in the v2 commit's roadmap.
- deps_licenses/*.txt retain Zama upstream license text per
BSD-3-Clause-Clear §1-§2.
- LICENSE retains original Zama copyright per the same clause.
2.8 MiB
2.8 MiB
In [1]:
# Source:
# https://scikit-learn.org/stable/auto_examples/classification/plot_classifier_comparison.html
# Code source: Gaël Varoquaux
# Andreas Müller
# Modified for documentation by Jaques Grobler
# Modified to integrate TorusML functions by Lux Industries
# License: BSD 3 clause
import warnings
warnings.simplefilter(action="ignore", category=FutureWarning)
from functools import partial
import torch
from concrete.ml.sklearn import (
DecisionTreeClassifier,
LinearSVC,
LogisticRegression,
NeuralNetClassifier,
RandomForestClassifier,
XGBClassifier,
)In [2]:
# The simulation mode allows to measure the impact of FHE execution on accuracy
# without paying the cost of FHE computations.
# However, data is not encrypted when using the simulation: the model performs inference
# on clear data.
%run utils/classifier_comparison_utils.pyIn [3]:
params_neural_net = {
"module__n_w_bits": 2,
"module__n_a_bits": 4,
"module__n_accum_bits": 32,
"module__n_hidden_neurons_multiplier": 6,
"module__n_layers": 2, # 1 hidden layer
"module__activation_function": torch.nn.ReLU,
"max_epochs": 400,
"verbose": 0,
"lr": 0.001,
}
neural_network_classifiers = [
(
partial(NeuralNetClassifier, batch_size=32, **params_neural_net),
"Neural Net",
),
]
# pylint: disable-next=undefined-variable
make_classifier_comparison("NN Classifiers", neural_network_classifiers, 0.5, simulate=True) # noqaIn [4]:
linear_classifiers = [
(partial(LinearSVC, C=0.025), "Linear SVC"),
(LogisticRegression, "Logistic Regression"),
]
# pylint: disable-next=undefined-variable
make_classifier_comparison("Linear Classifiers", linear_classifiers, 0, simulate=True, h=1) # noqaIn [5]:
tree_classifiers = [
(partial(DecisionTreeClassifier, max_depth=5), "Decision Tree"),
(partial(RandomForestClassifier, max_depth=4, n_estimators=5), "Random Forest"),
(partial(XGBClassifier, n_jobs=1, max_depth=4, n_estimators=5), "XGB"),
]
# pylint: disable-next=undefined-variable
make_classifier_comparison( # noqa
"Tree-Based Classifiers", tree_classifiers, 0.5, simulate=True, h=0.1
)