在class UEPModule(nn.Module): def init(self, numpatches, embeddim, hiddendim, imgsize):…
Jump to turn (7)
- 1在class UEPModule(nn.Module): def init(self, numpatches, embeddim, hiddendim, img
- 2目前我想知道:self.patchsize = int((self.imgsize[0] self.imgsize[1]) 0.5 / numpatches 0
- 3这是原始的class PatchEmbed(nn.Module): """ 2D Image to Patch Embedding """ def init(s
- 4那么受PatchEmbed启发,我们是否需要调整UEP
- 5主要是UEP的逻辑计算正确就不需要修改了
- 6这是原始的UEP设计思路:The proposed UEP is shown in Figure 4. The input tokens Ex are ffrs
- 7那么我们的UEP缺少了一些操作:class UEPModule(nn.Module): def init(self, numpatches, embeddim,
- User
在class UEPModule(nn.Module): def init(self, num_patches, embed_dim, hidden_dim, img_size): super(UEPModule, self).init() # 需要一个reshape操作使得vit输入可以适应卷积操作 self.num_patches =num_patches self.embed_dim = embed_dim self.hidden_dim = hidden_dim self.img = to_2tuple(img_size) self.patch_size = int((self.img_size[0] * self.img_size[1]) ** 0.5 / num_patches ** 0.5) # 重新计算 H和W self.H = self.img_size[0] // self.patch_size self.W = self.img_size[1] // self.patch_size
code