Hi, I'm trying to fine-tune cross-encoder for textual similarity, following the example provided in "cross-encoder/training_stsbenchmark.py", and setting num_label =1.
However, I get confused about the loss function when reading the source code (sentence_transformers/cross_encoder/CrossEncoder.py). In line 176, It seems that if setting num_label = 1, the loss function would be nn.BCEWithLogitsLoss().
Could you please explain why the loss function is not MSE, which seems to be more suitable for this regression task? Or maybe I misunderstood the code or the approach? Thanks a lot!
Hi, I'm trying to fine-tune cross-encoder for textual similarity, following the example provided in "cross-encoder/training_stsbenchmark.py", and setting num_label =1.
However, I get confused about the loss function when reading the source code (sentence_transformers/cross_encoder/CrossEncoder.py). In line 176, It seems that if setting num_label = 1, the loss function would be nn.BCEWithLogitsLoss().
Could you please explain why the loss function is not MSE, which seems to be more suitable for this regression task? Or maybe I misunderstood the code or the approach? Thanks a lot!