Skip to content

Commit

Permalink
Fix DeiT for multi-label classification (#3881)
Browse files Browse the repository at this point in the history
Remove init_args
harimkang authored Aug 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 2835aba commit ccf2d50
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/otx/algo/classification/vit.py
Original file line number Diff line number Diff line change
@@ -373,10 +373,6 @@ def _create_model(self) -> nn.Module:
return model

def _build_model(self, num_classes: int) -> nn.Module:
init_cfg = [
{"std": 0.2, "layer": "Linear", "type": "TruncNormal"},
{"bias": 0.0, "val": 1.0, "layer": "LayerNorm", "type": "Constant"},
]
vit_backbone = VisionTransformer(arch=self.arch, img_size=self.input_size, lora=self.lora)
return ImageClassifier(
backbone=vit_backbone,
@@ -386,7 +382,6 @@ def _build_model(self, num_classes: int) -> nn.Module:
in_channels=vit_backbone.embed_dim,
),
loss=AsymmetricAngularLossWithIgnore(gamma_pos=0.0, gamma_neg=1.0, reduction="sum"),
init_cfg=init_cfg,
)


0 comments on commit ccf2d50

Please sign in to comment.