Skip to content

Commit

Permalink
Fix DeiT-Tiny regression test for release/1.4.0 (#2595)
Browse files Browse the repository at this point in the history
* Fix DeiT regression test

* update changelog

* temp
  • Loading branch information
wonjuleee authored Nov 1, 2023
1 parent 8598b05 commit ba1a30d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.

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

## \[v1.4.3\]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,10 @@ def loss(self, cls_score, gt_label, feature=None):
losses["accuracy"] = {f"top-{k}": a for k, a in zip(self.topk, acc)}
losses["loss"] = loss
return losses

def forward_train(self, x, gt_label, **kwargs):
"""Forward_train fuction of CustomVisionTransformerClsHead class."""
x = self.pre_logits(x)
cls_score = self.layers.head(x)
losses = self.loss(cls_score, gt_label, feature=x)
return losses

0 comments on commit ba1a30d

Please sign in to comment.