How to predict the values between 0 and 1 except using MSE loss?

I have target labels which is between 0 and 1.
(ex. [0.2, 0.3, 0.0, 0.4])

This is a kind of regression problem, but I can’t use MSE loss because of some constraints.
Is there any way to predict the values between 0 and 1 ?

Yes, nn.BCEWithLogitsLoss for example takes targets in the range [0, 1] and could thus be used.
This use case would be applied for “soft” targets, which are between the two binary target classes 0 and 1.