Skip to content

Commit

Permalink
Update models_milan.py
Browse files Browse the repository at this point in the history
  • Loading branch information
zejiangh authored Aug 16, 2022
1 parent 677c981 commit 7dcfe0f
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions models_milan.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ def __init__(self, dim, num_heads, mlp_ratio=4., qkv_bias=False, qk_scale=None,
mlp_hidden_dim = int(dim * mlp_ratio)
self.mlp = Mlp(in_features=dim, hidden_features=mlp_hidden_dim, act_layer=act_layer, drop=drop)

# # NOTE not sure norm3 is necessary !!!
# # NOTE not sure apply self.norm3(fix_encoding_tokens) !!!
# self.norm3 = norm_layer(dim)

def forward(self, x, fix_encoding_tokens, ids_restore, ids_shuffle, ids_keep, ids_dump):
x = x + self.drop_path(self.attn(self.norm1(x), fix_encoding_tokens, ids_restore, ids_shuffle, ids_keep, ids_dump))
x = x + self.drop_path(self.mlp(self.norm2(x)))
Expand Down Expand Up @@ -342,8 +338,6 @@ def forward_loss(self, imgs, pred, mask, clip_teacher=None, cidx=None, cluster_r
def forward(self, imgs, mask_ratio=0.75, clip_teacher=None, cidx=None, cluster_result=None):
if self.use_clip:
clip_teacher, importance = clip_teacher[0], clip_teacher[1]
# print(clip_teacher.shape, importance.shape)
# sys.exit()
importance = importance[:, 0, 1:]
else:
clip_teacher, importance = None, None
Expand Down

0 comments on commit 7dcfe0f

Please sign in to comment.