Skip to content

Commit f7ed22e

Browse files
committed
Fixed compilation errors
1 parent 8835e9f commit f7ed22e

2 files changed

Lines changed: 31 additions & 10 deletions

File tree

Compiler/decision_tree_new.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,21 @@ def _():
357357

358358
def __init__(self, x, y, h, binary=False, attr_lengths=None,
359359
n_threads=None):
360-
""" Securely Training Decision Trees Efficiently by `Bhardwaj et al.`_ : https://eprint.iacr.org/2024/1077.pdf
360+
""" Securely Training Decision Trees Efficiently by `Bhardwaj et al.`_ : https://eprint.iacr.org/2024/1077.pdf
361361
362-
This protocol has communication complexity O( mN logN + hmN + hN log N) which is an improvement of ~min(h, m, log N) over `Hamada et al.`_ : https://petsymposium.org/popets/2023/popets-2023-0021.pdf
362+
This protocol has communication complexity O( mN logN + hmN + hN log N) which is an improvement of ~min(h, m, log N) over `Hamada et al.`_ : https://petsymposium.org/popets/2023/popets-2023-0021.pdf
363363
364-
To run this protocol, at the root of the MP-SPDZ repo, run Scripts/compile-run.py -H HOSTS -E ring custom_data_dt $((2**13)) 11 4 -Z 3 -R 128
364+
To run this protocol, at the root of the MP-SPDZ repo, run Scripts/compile-run.py -H HOSTS -E ring custom_data_dt $((2**13)) 11 4 -Z 3 -R 128
365365
366-
:param x: Attribute values
367-
:param y: Binary labels
368-
:param h: Height of the decision tree
369-
:param binary: Binary attributes instead of continuous
370-
:param attr_lengths: Attribute description for mixed data
366+
:param x: Attribute values
367+
:param y: Binary labels
368+
:param h: Height of the decision tree
369+
:param binary: Binary attributes instead of continuous
370+
:param attr_lengths: Attribute description for mixed data
371371
(list of 0/1 for continuous/binary)
372-
:param n_threads: Number of threads
372+
:param n_threads: Number of threads
373373
374-
"""
374+
"""
375375
assert not (binary and attr_lengths)
376376
if binary:
377377
attr_lengths = [1] * len(x)

Compiler/sorting.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,24 @@ def _():
7373
@library.else_
7474
def _():
7575
reveal_sort(h, D, reverse=True)
76+
77+
def radix_sort_permutation_from_matrix(bs, D):
78+
n = len(D)
79+
for b in bs:
80+
assert(len(b) == n)
81+
B = types.sint.Matrix(n, 2)
82+
h = types.Array.create_from(types.sint(types.regint.inc(n)))
83+
@library.for_range(len(bs))
84+
def _(i):
85+
b = bs[i]
86+
B.set_column(0, 1 - b.get_vector())
87+
B.set_column(1, b.get_vector())
88+
c = types.Array.create_from(dest_comp(B))
89+
reveal_sort(c, h, reverse=False)
90+
@library.if_e(i < len(bs) - 1)
91+
def _():
92+
reveal_sort(h, bs[i + 1], reverse=True)
93+
@library.else_
94+
def _():
95+
reveal_sort(h, D, reverse=True)
96+
return h

0 commit comments

Comments
 (0)