Skip to content

Commit

Permalink
[bugfix] fix not support metric error not raised bug (#452)
Browse files Browse the repository at this point in the history
* fix not support metric error not raised bug
* update eval metric for dssm test cases
  • Loading branch information
chengmengli06 authored Feb 2, 2024
1 parent a08bf22 commit 85192ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions easy_rec/python/model/match_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def _build_list_wise_metric_graph(self, eval_config):
label, logits[:, :batch_size],
metric.recall_at_topk.topk)
else:
ValueError('invalid metric type: %s' % str(metric))
raise ValueError('invalid metric type: %s' % str(metric))
return metric_dict

def _build_point_wise_metric_graph(self, eval_config):
Expand All @@ -248,7 +248,7 @@ def _build_point_wise_metric_graph(self, eval_config):
metric_dict['mean_absolute_error'] = metrics_tf.mean_absolute_error(
tf.to_float(label), self._prediction_dict['y'])
else:
ValueError('invalid metric type: %s' % str(metric))
raise ValueError('invalid metric type: %s' % str(metric))
return metric_dict

def get_outputs(self):
Expand Down
14 changes: 7 additions & 7 deletions samples/model_config/dssm_neg_sampler_need_key_feature.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ train_config {

eval_config {
metrics_set: {
auc {
}
}
metrics_set: {
gauc {
uid_field: "user_id"
}
recall_at_topk { topk: 3 }
}
# currently not supported
# metrics_set: {
# gauc {
# uid_field: "user_id"
# }
# }
}

data_config {
Expand Down
14 changes: 7 additions & 7 deletions samples/model_config/dssm_neg_sampler_sequence_feature.config
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ train_config {

eval_config {
metrics_set: {
auc {
}
}
metrics_set: {
gauc {
uid_field: "user_id"
}
recall_at_topk { topk: 3 }
}
# currently not supported
# metrics_set: {
# gauc {
# uid_field: "user_id"
# }
# }
}

data_config {
Expand Down

0 comments on commit 85192ac

Please sign in to comment.