tf-encrypted / moose

Secure distributed dataflow framework for encrypted machine learning and data processing
Apache License 2.0
58 stars 16 forks source link

Add Replicated Sqrt operation #1051

Closed yanndupis closed 2 years ago

yanndupis commented 2 years ago

One more for the road. When working on a PyMoose example, I realized that sqrt was missing to compute pearson correlation. So here it is.

kkloberdanz commented 2 years ago

Looks good! Perhaps a small proof in the comments would help a future reader?

2^(0.5 * log_2 x) = (2^log_2 x)^0.5 = x^0.5 = sqrt(x)
rdragos commented 2 years ago

We should add a followup issue to implement the square root as we've described in our whitepaper.

yanndupis commented 2 years ago

Thank you both for the review.

@rdragos good question. I checked the bounds. With 10 fractional precision, we get accurate result for [0.001, 1000] with error threshold set to 0.1 and for 20 fractional precision we get accurate result [0.01, 500000] for error threshold set to 0.001.

Sounds good, I will open a follow up issue to implement sqrt as described in the whitepaper.

Thanks

yanndupis commented 2 years ago

https://github.com/tf-encrypted/moose/issues/1058