chexpert | before add weights to each model , my best auc | Machine Learning library
kandi X-RAY | chexpert Summary
kandi X-RAY | chexpert Summary
before add weights to each model, my best auc is 0.922@2.2. after add weights to each model,my best auc is 0.923@2.8.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of chexpert
chexpert Key Features
chexpert Examples and Code Snippets
Community Discussions
Trending Discussions on chexpert
QUESTION
I borrowed code from this github repo for training of a DenseNet-121 [https://github.com/gaetandi/cheXpert/blob/master/cheXpert_final.ipynb][1]
The github code is for 14 class classification on the CheXpert chest X-ray dataset. I've revised it for binary classification.
...ANSWER
Answered 2020-Apr-18 at 04:07It looks like you have adapted the training correctly for the binary classification, but the prediction wasn't, as you are still trying it as if it were a multi-class prediction.
The output of your model (varOutput
) has the size (batch_size, 1), since there is only one class. The maximum across that dimension will always be 0, since that is the only class available, there is no separate class for 1.
This single class represents both cases (0 and 1), so you can consider it is a the probability of it being positive (1). To get the distinct value of either 0 or 1, you simply use a threshold of 0.5, so everything below that receives the class 0 and above that 1. This can be easily done with torch.round
.
But you also have another problem, you're applying the sigmoid function twice in a row, once in the classifier nn.Sigmoid()
and then afterwards again torch.sigmoid(varOutput)
. That is problematic, because sigmoid(0) = 0.5, hence all your probabilities are over 0.5.
The output of your model are already the probabilities, the only thing left is to round them:
QUESTION
I am trying to do some transfer learning using this github DenseNet121 model (https://github.com/gaetandi/cheXpert.git). I'm running into issues resizing the classification layer from 14 to 2 outputs.
Relevant part of the github code is:
...ANSWER
Answered 2019-Sep-05 at 19:18If you want to replace the classifier
inside densenet121
that is a member of your model
you need to assign
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install chexpert
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page