NSS-01 / FSS-DT

FSS-DT: Secure MPC-Friendly Decision Tree via Optimized Function Secret Sharing
MIT License
1 stars 0 forks source link

Could you pls provide a tutorial on exp() #1

Open maminiris opened 3 months ago

maminiris commented 3 months ago

I failed to call the exp function. Could you provide a tutorial?

设置计算参数

num_of_keys = 1 scale_bit = 16

生成密钥

Key0, Key1 = ExpKey.gen(num_of_keys, scale_bit)

定义输入值

y = RingTensor.convert_to_ring(torch.tensor(1)) x = ArithmeticSharedRingTensor.share(y, 2)

调用指数函数计算

result_0 = Exp.eval(x, Key0, scale_bit) result_1 = Exp.eval(x, Key0, scale_bit)

打印结果

print(result_0+result_1)

NSS-01 commented 3 months ago

Exponential operations are fitted by polynomials