TenSEAL
TenSEAL copied to clipboard
conv2D on images with more than 1 channel
Question
I want to know how I can do convolution on an image with 3 channels?
Further Information
So I am trying to use the ts.im2col_encoding
function on each channel separately and then stack them with ts.CKKSVector.pack_vectors
but I am getting an error like this:
ValueError: output size is bigger than slot count
So how can I do that with more than 1 channels? also the forward method should be changed from the tutorial's version, right?
System Information
- OS Version: Ubuntu 20.04
- Language Version: Python 3.10
Did you solve it?
You probably get ValueError: output size is bigger than slot count
because the polynomial modulus size is too small to fit all your channels in a single ciphertext.
I am working on CIFAR10 dataset recently, which contains 3 channels images, and I wonder how to use ts.im2col_encoding
function and ts.Conv2d_im2col
function on this kind of inputs?