"scripts/git@developer.sourcefind.cn:change/sglang.git" did not exist on "d22d0447345422f85d4bb53b175a8eb77a019709"
Commit d38e8da1 authored by Yeqing Li's avatar Yeqing Li Committed by A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 476488291
parent 73e05832
...@@ -338,6 +338,9 @@ class ImageClassificationTask(base_task.Task): ...@@ -338,6 +338,9 @@ class ImageClassificationTask(base_task.Task):
one_hot = self.task_config.losses.one_hot one_hot = self.task_config.losses.one_hot
soft_labels = self.task_config.losses.soft_labels soft_labels = self.task_config.losses.soft_labels
is_multilabel = self.task_config.train_data.is_multilabel is_multilabel = self.task_config.train_data.is_multilabel
# Note: `soft_labels`` only apply to the training phrase. In the validation
# phrase, labels should still be integer ids and need to be converted to
# one hot format.
if (one_hot or soft_labels) and not is_multilabel: if (one_hot or soft_labels) and not is_multilabel:
labels = tf.one_hot(labels, self.task_config.model.num_classes) labels = tf.one_hot(labels, self.task_config.model.num_classes)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment