I have a custom neural network that I wrote from scratch and it does lot of mathematical computations and the output is a continuous value.
I want to get the binary class output from these continuous values. I applied sigmoid function on these output continuous values but the sigmoid values with the threshold of 0.5 is not giving the correct class labels as for the training data the value after applying sigmoid is all in the range of 0.5055, hence classifying all in tag 1.
I am not able to comprehend if there's any other way I should discretize the values or why sigmoid is not working well for me and if there's an optimal way to get the correct threshold.
One thing I figured out from an answer as to why sigmoid might not be working well could be because of class weights ?