pytorch-transformers-classification icon indicating copy to clipboard operation
pytorch-transformers-classification copied to clipboard

utils.py [output_mode = regression]

Open vr25 opened this issue 6 years ago • 3 comments

Hi,

I am trying to predict a score (float) using regression and I was wondering what changes need to be made in lines 254 and 258 in utils.py

Thanks!

vr25 avatar Nov 21 '19 20:11 vr25

Also, since it uses BinaryClassificationProcessor, it creates the logits tensor with size of [10,2] (say, my input file has 10 texts). After view(-1), logits becomes size=20 but the labels are still size=10. Hence, MSELoss() returns the following size mismatch error:

image

Thanks!

vr25 avatar Nov 21 '19 21:11 vr25

Set this in the args dict.

'output_mode': 'regression'

ThilinaRajapakse avatar Nov 22 '19 03:11 ThilinaRajapakse

On setting: 'output_mode': 'regression' it still gives the following error:

image

vr25 avatar Nov 22 '19 14:11 vr25