示例#1
0
def _get_loss_fn(metric):
    if metric in ("accuracy", "multiclass_f1"):
        return CrossEntropyLoss()
    elif metric == "multilabel_f1":
        return BCEWithLogitsLoss()
    else:
        raise NotImplementedError
示例#2
0
 def get_loss_fn(self):
     return CrossEntropyLoss()