Reputation: 1
import resnet
class ViT(nn.Module):
def __init__(self, ...):
self.backbone = resnet()
...
def forward(self, x):
x = self.backbone(x)
x = ...
return x
...
clas Multi_model(nn.Module):
def __init__(self, ...):
self.ViT = ViT()
self.backbone = resnet()
def forward(self, x):
x = self.resnet(x)
x = self.ViT(x)
return x
Why do these two performance differences occur? In Case 1, we declare a CNN model inside the ViT class and add it to the Forward function. In Case 2, we declare ViT and CNN models separately inside a class called Multi_model and add them to Forward individually. My experimental results show that Case 1 has a 1-MAE performance of 0.91, while Case 2 has a 1-MAE performance of over 0.95. What's the difference, and is Case 2 incorrect?
Why do these two performance differences occur? In Case 1, we declare a CNN model inside the ViT class and add it to the Forward function. In Case 2, we declare ViT and CNN models separately inside a class called Multi_model and add them to Forward individually. My experimental results show that Case 1 has a 1-MAE performance of 0.91, while Case 2 has a 1-MAE performance of over 0.95. What's the difference, and is Case 2 incorrect?
Upvotes: 0
Views: 10