Is it possible to implement.sum and.array in numpy? Is that possible
Hello, after reading the operation manual and experiment, I want to implement the. Sum and. Array functions in numpy in ciphertext, is it feasible.
Hello, np.sum will be available in the next release of concrete-numpy (v0.6.0, which will be released in a month). As for np.array(), we cannot support it directly because of technical limitations, but we might be able to provide hnp.array(...) to create encrypted arrays. Though, I cannot think of a situation in which you would want to do that.
With the release of v0.6.0, np.sum is now supported.
import concrete.numpy as cnp
import numpy as np
@cnp.compiler({"x": "encrypted"})
def function(x):
return np.sum(x)
inputset = [np.random.randint(0, 10, size=(2, 2)) for _ in range(10)]
circuit = function.compile(inputset)
sample = np.array([[1, 2], [3, 4]])
assert circuit.encrypt_run_decrypt(sample) == np.sum(sample)
The creation of encrypted arrays will come in v0.8.0 in a few months.
Closing due to inactivity. Please create another issue if your problem is not resolved.
Thank you for your help. I will give you feedback after the experiment.
------------------ 原始邮件 ------------------ 发件人: "zama-ai/concrete-numpy" @.>; 发送时间: 2022年8月31日(星期三) 晚上10:06 @.>; @.@.>; 主题: Re: [zama-ai/concrete-numpy] Is it possible to implement.sum and.array in numpy? Is that possible (Issue #26)
With the release of v0.6.0, np.sum is now supported. import concrete.numpy as cnp import numpy as np @cnp.compiler({"x": "encrypted"}) def function(x): return np.sum(x) inputset = [np.random.randint(0, 10, size=(2, 2)) for _ in range(10)] circuit = function.compile(inputset) sample = np.array([[1, 2], [3, 4]]) assert circuit.encrypt_run_decrypt(sample) == np.sum(sample)
The creation of encrypted arrays will come in v0.7.0 in a few months.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>