Cross-entropy with one-hot-like probability targets

in some situation,my target maybe like this target=[0,0,0,1.0,0,0.5], is not the standard one-hot form.

the loss function,torch.nn.CrossEntropyLoss(),can not accept this target as the input_target. Should I define a
new loss function ?

is there any way to solve this problem ?

I have got some solution from
How should I implement cross-entropy loss with continuous target outputs?

thanks veryone

1 Like