Skip to content

Commit ba1a30d

Browse files
authored
Fix DeiT-Tiny regression test for release/1.4.0 (#2595)
* Fix DeiT regression test * update changelog * temp
1 parent 8598b05 commit ba1a30d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
88

99
- Update ModelAPI configuration(<https://github.com/openvinotoolkit/training_extensions/pull/2564>)
1010
- Add Anomaly modelAPI changes (<https://github.com/openvinotoolkit/training_extensions/pull/2563>)
11+
- Fix IBLoss enablement with DeiT-Tiny when class incremental training (<https://github.com/openvinotoolkit/training_extensions/pull/2595>)
1112

1213
## \[v1.4.3\]
1314

src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ def loss(self, cls_score, gt_label, feature=None):
3131
losses["accuracy"] = {f"top-{k}": a for k, a in zip(self.topk, acc)}
3232
losses["loss"] = loss
3333
return losses
34+
35+
def forward_train(self, x, gt_label, **kwargs):
36+
"""Forward_train fuction of CustomVisionTransformerClsHead class."""
37+
x = self.pre_logits(x)
38+
cls_score = self.layers.head(x)
39+
losses = self.loss(cls_score, gt_label, feature=x)
40+
return losses

0 commit comments

Comments
 (0)