mirror of
https://github.com/luxfi/torus-ml.git
synced 2026-10-30 15:15:23 +00:00
The distribution called itself torus-ml while shipping a package directory named concrete, so the name a user installs and the name they import disagreed — and most of the tree already said torus.ml, which could not resolve against src/concrete. Moved src/concrete to src/torus and pointed the include at it. The dependency was Zama's concrete-python from their index. It is torus-fhe from ours, which is what luxfhe/torus already ships: that frontend declares torus-fhe and ships a torus/fhe module, so every 'from torus.fhe' in this tree was already naming our compiler and only the dependency lagged. Two distributions share one namespace, which is the shape the upstream this forked from used and the reason the split works: torus-fhe gives torus.fhe, torus-ml gives torus.ml. Swept every other spelling — identifiers, enum members, workflow variables, filenames, notebooks. LICENSE and NOTICE keep the upstream attribution a fork owes; the figures carry the old name in JPEG metadata a text sweep cannot reach.
2.7 MiB
2.7 MiB
In [1]:
from functools import partial
# 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.
def make_classifier_comparison_from_sklearn(*args, **kwargs):
return args, kwargs
%run utils/classifier_comparison_utils.pyIn [2]:
from torus.ml.sklearn import (
DecisionTreeClassifier,
LinearSVC,
LogisticRegression,
RandomForestClassifier,
XGBClassifier,
)In [3]:
%%time
linear_classifiers = [
(partial(LinearSVC, C=0.025), "Linear SVC"),
(LogisticRegression, "Logistic Regression"),
]
# pylint: disable-next=undefined-variable
make_classifier_comparison_from_sklearn(
"Linear Classifiers", linear_classifiers, 0, simulate=True, h=1
) # noqaCPU times: user 27 s, sys: 5.96 s, total: 32.9 s Wall time: 6.2 s
In [4]:
%%time
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_from_sklearn( # noqa
"Tree-Based Classifiers", tree_classifiers, 0.5, simulate=True, h=0.1
)CPU times: user 1d 3h 26min 25s, sys: 51min 48s, total: 1d 4h 18min 14s Wall time: 14min 6s