한규원
한규원

Reputation: 1

Why does performance differ due to differences in model architecture?

Case 1

import resnet

class ViT(nn.Module):
   def __init__(self, ...):
      self.backbone = resnet()
      ...
   def forward(self, x):
      x = self.backbone(x)
      x = ...
      return x
   ...

Case 2

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

Answers (0)

Related Questions