In vit, can I capture the multi-scale information of vit through the following code…
- User
In vit, can I capture the multi-scale information of vit through the following code after each block?
self.reduction_1 = nn.Conv2d(1024, 1024, (2, 2), stride=2, groups=1024 // 4, bias=False) self.reduction_2 = nn.Conv2d(1024, 1024, (4, 4), stride=2, groups=1024 // 4, bias=False) self.reduction_3 = nn.Conv2d(1024, 1024, (6, 6), stride=2, groups=1024 // 4, bias=False) self.reduction_4 = nn.Conv2d(1024, 1024, (8, 8), stride=2, groups=1024 // 4, bias=False) stage = 1 m_list = [] for blk in self.blocks: if self.use_checkpoint: x = checkpoint.checkpoint(blk, x, rel_pos_bias) if cnt in [1, 4, 20]: if stage == 1: m_list.append(self.reduction_1(x)) elif stage == 2: m_list.append(self.reduction_2(x)) elif stage == 3: m_list.append(self.reduction_3(x)) else: m_list.append(self.reduction_4(x)) stage += 1 - Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.