Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matmul between a matrix and a vector using CKKSVector #457

Open
mokachocolat opened this issue Sep 11, 2023 · 0 comments
Open

Matmul between a matrix and a vector using CKKSVector #457

mokachocolat opened this issue Sep 11, 2023 · 0 comments
Labels
Type: Question ❔ Question about implementation or some technical aspect

Comments

@mokachocolat
Copy link

Question

Hello, what is the equivalent of

A = np.zeros((256,1))
B = np.zeros((2,1))
A @ B.T

when A is a CKKSVector and B also ?

Further Information

I'm trying to code a backward function in which I need to compute the derivative of a weight matrix of size (256,2) by multiplying my encrypted input x (vector with shape (256,)) and a variable delta (vector with shape (2,)).

I tried to use .transpose(), .matmul() and reshape delta after a call of .decrypt() but it does not work for me.

It seems like, .matmul() works only when the first shape of both matrix are the same but it seems like we do not have all tools to do so with CKKSVectors.

System Information

  • OS: Ubuntu
  • OS Version: 22.04
  • Language Version: Python 3.10.12
@mokachocolat mokachocolat added the Type: Question ❔ Question about implementation or some technical aspect label Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Question ❔ Question about implementation or some technical aspect
Projects
None yet
Development

No branches or pull requests

1 participant