Expand 3d_classification example to multi-class use case #2020
Replies: 4 comments
-
In my particular use case, I have 14 classes coded as integer values between 0-13.
A search suggested that "When using PyTorch's nn.CrossEntropyLoss(), the target labels should not be one-hot encoded; instead, they should be integers representing the class indices." So my first attempted fix was to comment out the line that one-hot encodes the labels and leave them as a list of integers: However, this change results in |
Beta Was this translation helpful? Give feedback.
-
Ah... possibly this is as simple as keeping all the code the same but changing one line: |
Beta Was this translation helpful? Give feedback.
-
The tutorial doesn't explain where the final model is stored or how it could be extracted and deployed. Is there a separate tutorial for this? I would also like to run the model on the full training/test set to get predicted versus actual class for each input image and enable accuracy calculations by class. Can you include code in the tutorial for this kind of post-training model evaluation? |
Beta Was this translation helpful? Give feedback.
-
This bit of code might be used to load the existing best model and run in a evaluation loop on a different evaluation ImageDataset and DataLoader :
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
The current 3d_classification example only allows a binary label (outcome).
Could the example be easily expanded or updated to demonstrate a multi-class label (outcome) use case?
Beta Was this translation helpful? Give feedback.
All reactions