MatchZoo icon indicating copy to clipboard operation
MatchZoo copied to clipboard

DSSM model.predict() scores rank does not match with the rank by dot layer cosine similarity

Open jchen0529 opened this issue 3 years ago • 0 comments

Describe the Question

I have a trained DSSM model and wanted to compare the ranked items based on dssm model.predict() scores against the cosine similarity scores after the model's dot layer, I would expect the two ranks to be the same since model.predict() is just the final score after a linear activation but the results are completely the opposite and I'm trying to understand how that might be given the linear coefficient from the final dense layer is positive.

Describe your attempts

  • [x] I walked through the tutorials
  • [x] I checked the documentation
  • [x] I checked to make sure that this is not a duplicate question

1. DSSM model summary 2. Predicted scores comparison 3. Predicted dataframe with two sets of scores, sorted by pred_score here which gives completely opposite rank compared to if sorted by dot score

jchen0529 avatar Jan 11 '22 21:01 jchen0529