Open shangh1 opened 7 months ago
Hello!
Yes, this is totally possible. If you provide your loss function this way, then it'll be called right here: https://github.com/UKPLab/sentence-transformers/blob/737353354fbdf1a419eee864f998ffe9fdf3b682/sentence_transformers/cross_encoder/CrossEncoder.py#L240 i.e. with logits & labels.
Thanks for your quick reply! Got it! So the default arguments are logits and labels.
Hi, I'm using this git to run a cross encoder model, hope to use a customized function. The code is like below. The thing is that using model.fit, it does not specify which is the output. In future, I'll also add another argument in this customized loss to compute lambdarank loss. Thanks!