# How to convert softmax output to target suitable for MSELoss?

**URL:** <https://discuss.pytorch.org/t/how-to-convert-softmax-output-to-target-suitable-for-mseloss/29190>\
**Category:** reinforcement-learning\
**Created:** [November 9, 2018, 3:12pm UTC](https://discuss.pytorch.org/t/how-to-convert-softmax-output-to-target-suitable-for-mseloss/29190 "2018-11-09T15:12:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![andreiliphd](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/andreiliphd/32/7286_2.png) [@andreiliphd](https://discuss.pytorch.org/u/andreiliphd)\
**Post date:** [November 9, 2018, 3:12pm UTC](https://discuss.pytorch.org/t/how-to-convert-softmax-output-to-target-suitable-for-mseloss/29190/1 "2018-11-09T15:12:01Z")

</div>

Hello!  
I am doing reinforcement learning. Started to write a technical specification but I am stuck with converting softmax output to target suitable for MSELoss(). So, softmax will give me a probability but I want to feed it to MSELoss in shape of [batch\_size, \*].  
How can I do it?

**EDIT:**  
Found an answer: [How should I implement cross-entropy loss with continuous target outputs?](https://discuss.pytorch.org/t/how-should-i-implement-cross-entropy-loss-with-continuous-target-outputs/10720/19) Sorry, but if you would like to add I will be happy to listen.
