update combined loss for accelerate  classification training speed
@@ -44,6 +44,12 @@ class CombinedLoss(nn.Layer):
def __call__(self, input, batch):
loss_dict = {}
+ # just for accelerate classification traing speed
+ if len(self.loss_func) == 1:
+ loss = self.loss_func[0](input, batch)
+ loss_dict.update(loss)
+ loss_dict["loss"] = list(loss.values())[0]
+ else:
for idx, loss_func in enumerate(self.loss_func):
loss = loss_func(input, batch)
weight = self.loss_weight[idx]
