segmentation_models.pytorch icon indicating copy to clipboard operation
segmentation_models.pytorch copied to clipboard

Support for continuous output?

Open ma-sadeghi opened this issue 3 years ago • 2 comments

Thank you for creating this great package! My question might not be very closely related to image segmentation, but I'll ask anyway: is it possible to use your package for continuous output data? My input data are binary and the output are continuous (floats between 0-1). So, it's in a way opposite the typical image segmentation. Thank you so much!

ma-sadeghi avatar Sep 05 '22 02:09 ma-sadeghi

Just get rid of the activation layer?

JulienMaille avatar Sep 05 '22 07:09 JulienMaille

I have the same question

I have currently setup the arch like so

model = smp.Unet( encoder_name="resnet18", # choose encoder, e.g. mobilenet_v2 or efficientnet-b7 encoder_weights= None, # use imagenet pre-trained weights for encoder initialization in_channels= 4, # model input channels (1 for gray-scale images, 3 for RGB, etc.) classes = 1, # model output channels (number of classes in your dataset) activation = 'identity' )

when I print the model. I see that all the decoder activations are 'identity' not just the final activation (which is needed for regression).

Any suggestions?

Geethen avatar Sep 05 '22 07:09 Geethen

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Nov 05 '22 02:11 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Nov 13 '22 02:11 github-actions[bot]

@JulienMaille Sorry for the super late reply. I actually used "sigmoid" for the output layer and it worked as I wanted. Thanks!

ma-sadeghi avatar Nov 20 '22 03:11 ma-sadeghi