Closed pengzhendong closed 5 years ago
Imbalance doesn't apply in this cause b/c we are working w/ permutations of pairs not pointwise labels. The loss is: L(X;theta)=log(siqmoid(f(A)-f(B)) so as you can see there really are no labels (there is no y in that loss equation). I only add fake 1 labels and binary x-entropy for it to work in Keras, b/c all Keras requires all model losses to be a function of x and y!
Thanks. So during predicting, do I just use create_base_network
to get the score of any example and sort them by scores?
Yes, but use an instance (trained) of the base_network instead of creating a new one, like in cell 7
of the notebook. The base network is the "Scoring Function" and then it's called a score-and-sort approach.
OK, thank you very much. 👍
I wonder whether it would cause the unbalanced dataset and predict all pairs to 1.