You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am researching convolutional neural networks on various homomorphic encryption schemes. I noticed that you have support for the BFV scheme. However, I cannot build a convolutional layer and I can find a similar command "im2col_encoding" for BFV too.
Is it possible in principle to build CNN-BFV using your library and how to do it?
Further Information
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Cell In [36], [line 2](vscode-notebook-cell:?execution_count=36&line=2)
[1](vscode-notebook-cell:?execution_count=36&line=1) enc_model = EncConvNet(model)
----> [2](vscode-notebook-cell:?execution_count=36&line=2) enc_test(context, enc_model, test_loader, criterion, kernel_shape, stride)
Cell In [32], [line 49](vscode-notebook-cell:?execution_count=32&line=49)
[45](vscode-notebook-cell:?execution_count=32&line=45) class_total = list(0. for i in range(10))
[47](vscode-notebook-cell:?execution_count=32&line=47) for data, target in test_loader:
[48](vscode-notebook-cell:?execution_count=32&line=48) # Encoding and encryption
---> [49](vscode-notebook-cell:?execution_count=32&line=49) x_enc, windows_nb = ts.im2col_encoding(
[50](vscode-notebook-cell:?execution_count=32&line=50) context, data.view(28, 28).tolist(), kernel_shape[0],
[51](vscode-notebook-cell:?execution_count=32&line=51) kernel_shape[1], stride
[52](vscode-notebook-cell:?execution_count=32&line=52) )
[53](vscode-notebook-cell:?execution_count=32&line=53) # Encrypted evaluation
[54](vscode-notebook-cell:?execution_count=32&line=54) enc_output = enc_model(x_enc, windows_nb)
File ~/src/tenseal/tenseal/__init__.py:37, in im2col_encoding(context, tensor, kernel_n_rows, kernel_n_cols, stride)
[34](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:34) raise ValueError("tensor must be a matrix")
[35](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:35) matrix = tensor.tolist()
---> [37](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:37) ckks_vec, windows_nb = _ts_cpp.im2col_encoding(
[38](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:38) context.data, matrix, kernel_n_cols, kernel_n_rows, stride
[39](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:39) )
[40](https://file+.vscode-resource.vscode-cdn.net/Users/reaneling/BFV/~/src/tenseal/tenseal/__init__.py:40) return CKKSVector._wrap(ckks_vec), windows_nb
ValueError: no global scale
System Information
OS: MacOS
OS Version: 15.0
Language Version: Python 3.9.13
Package Manager Version: pip 24.2
The text was updated successfully, but these errors were encountered:
Question
Hello!
I am researching convolutional neural networks on various homomorphic encryption schemes. I noticed that you have support for the BFV scheme. However, I cannot build a convolutional layer and I can find a similar command "im2col_encoding" for BFV too.
Is it possible in principle to build CNN-BFV using your library and how to do it?
Further Information
System Information
The text was updated successfully, but these errors were encountered: