jamesmullenbach / caml-mimic

multilabel classification of EHR notes
MIT License
278 stars 125 forks source link

Sigmoid before classification #20

Closed MorPeled closed 4 years ago

MorPeled commented 5 years ago

Hi,

If I got it right, models.py > ConvAttnPool is the relevant model to the suggested CAML architecture in the article. Looking in the forward function, I see that the last action occuring before calculating loss is linear (multiplying by final.weight & adding final.bias):

y = self.final.weight.mul(m).sum(dim=2).add(self.final.bias)

but theres no sigmoid after that, as suggested in the paper: image

What did I miss?

Thanks :-) Mor

sarahwie commented 5 years ago

Happens here: https://github.com/jamesmullenbach/caml-mimic/blob/7d8ce1585e2fe13fbd5e777d2206a82b0086fb1c/learn/training.py#L261 Also see #14