From 5f84ca7523353249538a76ad428a40b8168d7502 Mon Sep 17 00:00:00 2001 From: wonjulee Date: Wed, 1 Nov 2023 08:39:53 +0900 Subject: [PATCH 1/3] Fix DeiT regression test --- .../mmcls/models/heads/custom_vision_transformer_head.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py index b9ce9ef6c8f..c6a475e6089 100644 --- a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py +++ b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py @@ -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 From f350ed25c925368790c34da6d299042c671c77bb Mon Sep 17 00:00:00 2001 From: wonjulee Date: Wed, 1 Nov 2023 08:42:12 +0900 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88e1beda101..6356b4b8d3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ All notable changes to this project will be documented in this file. - Update ModelAPI configuration() - Add Anomaly modelAPI changes () +- Fix IBLoss enablement with DeiT-Tiny when class incremental training () + ## \[v1.4.3\] From 2ac7f25553bf5221c351a666650d94867e32895b Mon Sep 17 00:00:00 2001 From: wonjulee Date: Wed, 1 Nov 2023 09:00:53 +0900 Subject: [PATCH 3/3] temp --- CHANGELOG.md | 1 - .../mmcls/models/heads/custom_vision_transformer_head.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6356b4b8d3c..25921b9d4c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ All notable changes to this project will be documented in this file. - Add Anomaly modelAPI changes () - Fix IBLoss enablement with DeiT-Tiny when class incremental training () - ## \[v1.4.3\] ### Enhancements diff --git a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py index c6a475e6089..38a2d704c2c 100644 --- a/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py +++ b/src/otx/algorithms/classification/adapters/mmcls/models/heads/custom_vision_transformer_head.py @@ -31,7 +31,7 @@ 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)