Comments (6)
I think you did too many multiplications. You set {60, 40, 40, 60} for the primes used in the moduli, therefore you can do only 2 multiplications while you asked to do 5.
from tenseal.
okay thank you @youben11
I am going to look further on this choice of parameters
from tenseal.
Hi.
This issue is closed, but I have the same problem. How did you solved it ?
I am trying to evaluate a polynomial expression of a dot product.
The SEAL documentation explains that I missed a relinearization or a rescale step, but I thought both operations are done automatically using tenseal ?
context = ts.context(ts.SCHEME_TYPE.CKKS, 8192, coeff_mod_bit_sizes=[60, 40, 40, 60])
context.global_scale = pow(2,40)
context.generate_galois_keys()
plain_vector = [-1, 0,9, 6, 90 ]
vec = np.array(plain_vector)
plain_vector2 = [-1 ,3 , 2,3,0 ]
vec2= np.array(plain_vector2)
encrypted_vector = ts.ckks_vector(context, plain_vector)
encrypted_vector2 = ts.ckks_vector(context, plain_vector2)
Edot = encrypted_vector.dot(encrypted_vector)
Udot= vec.dot(vec2)
(EdotEdot) * (Edot[0.5])
ValueError: scale out of bounds
from tenseal.
Hi @apignet, you are trying to perform 3 multiplications in a chain when your parameters are set to support two multiplications only. You will need to increase the parameters while creating the context in context = ts.context(ts.SCHEME_TYPE.CKKS, 8192, coeff_mod_bit_sizes=[60, 40, 40, 60])
in order to support 3 multiplications.
from tenseal.
Reading SEAL example and this issue [64](ehttps://github.com/microsoft/SEAL/issues/64 )
, I understood that the relinearization/rescaling operations transform a cipertext of level l in a ciphertext of level l-1. Therefore, with auto-relin and auto-rescale, I did not understand why I am not able to support more than 2 multiplications.
from tenseal.
The auto_|relin|rescale] features of TenSEAL allow users to focus on the computation without the need to do the relinearization/rescaling, but those operations are still done by TenSEAL. A new ciphertext has some coefficient modulus q and every time a multiplication is done and we perform a rescaling, the modulus goes down, until it reaches some value that can no longer holds the coefficient with a certain scale, so for being able to perform many multiplication for a certain scale, you will need to choose your parameters accordingly.
from tenseal.
Related Issues (20)
- Matmul between a matrix and a vector using CKKSVector
- Can't install tenseal using pip HOT 1
- Is gpu acceleration considered in future plans?
- Installation fails on macOS due to CMake error HOT 1
- (enc_vector1 + plain_vector1) not equal to enc(vector1 + vector1)
- Not getting installed using pip install tenseal
- Information conflict with SEAL regarding size of ciphertext under different key mode
- Failed to install TenSEAL on Macbook Air M2 HOT 1
- Multiparty extensions
- Tutorial 4 as a client/server scenario
- Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: tenseal in ./.local/lib/python3.10/site-packages (0.3.14)
- Failed to install tenseal, windows HOT 1
- Failed to install tenseal, windows HOT 2
- Rationale behind the parameter values in TenSEAL HOT 2
- How to rescale mannually?
- Windows 10 + python 3.8 ----- AttributeError: module 'tenseal' has no attribute 'Context' HOT 1
- Can't install TenSEAL on Windows
- Tenseal based federated learning: deep loop stuck and no longer executed in the case of loop encryption training parameters
- Why is my encrypted Linear Classifier slower than encrypted ConvNet classifier ?
- Is TenSEAL maintained?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tenseal.