Am trying to do quanvolution with Cifar dataset how am geeting error,my models are below,any assistance am grateful
class HybridModel(nn.Module):
def init(self):
super().init()
self.conv0 = nn.Sequential(
QuanvolutionFilter(),
nn.Conv2d(3, 64, kernel_size=3, padding=1),
nn.BatchNorm2d(64),
nn.ReLU(inplace=False),
nn.MaxPool2d(2),
)
self.fc1 = nn.Linear(161664,10)
#forward propagation function
def forward(self,x,use_cirq=False):
x = self.conv0(x)
x = self.QuanvolutionFilter(x,use_cirq)
x = x.view(x.size(0),-1)
x = self.fc1(x)
return x
class HybridModel_without_qf(nn.Module):
def init(self):
super().init()
self.conv1 = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=3, padding=1),
nn.BatchNorm2d(64),
nn.ReLU(inplace=False),
nn.MaxPool2d(2),
)
self.conv2 = nn.Sequential(
nn.Conv2d(64, 128, kernel_size=3, padding=1),
nn.BatchNorm2d(128),
nn.ReLU(inplace=False),
nn.MaxPool2d(2),
)
self.conv3 = nn.Sequential(
nn.Conv2d(128, 256, kernel_size=3, padding=1),
nn.BatchNorm2d(256),
nn.ReLU(inplace=False),
nn.MaxPool2d(2),
)
self.fc = nn.Linear(4*4*256,10)
#forward propagation function
def forward1(self,x):
x = self.conv1(x)
x = self.conv2(x)
x = self.conv3(x)
x = x.view(x.size(0),-1)
x = self.fc(x)
return x