Hi everyone!
I’m trying to deploy a linear feedforward NN that, given an input that represents the parameters of a system, outputs its error probability. The final aim is to look for the right input parameter tuning through an iterative way: I start with an input, and if the corresponding error probability is above a threshold, I reduce one of the input parameters until I find a satisfactory error probability [below the threshold].
So, my dataset consists on a set of measurements which couple system parameters (which are simply real numbers) and error probabilities. The NN should learn the relationship between the system setting and its error probability. So, my first idea is to use the measured error probabilities as labels (obviously they are real numbers in the set {0,1})
The structure of the NN is given: the input layer has the same dimensionality of the system parameters obviously, then there are a set of hidden layers with ReLu() activation function and finally there is one single-neuron output layer activated by a sigmoid function.
The criterion that has to be used is the BCELoss().
[ I know that it is suggested to use the nn.BCEWithLogitsLoss without sigmoid activation function, but the structure should be given, so I would prefer to not change it].
My problem is that I am not able to well understand why and how the BCELoss() criterion is well suited for this kind of problem.
I knew that it is was suggested when there is a classification problem and the number of classes is 2: class 0 and class 1. In such a scenario, the NN learns how to classify its input, outputting the probability that the input belongs to class 1.
But in my case, how should I train the network?
I think to have two possible approaches:

I forget about the concept of class and I train the NN supervising the error probability.
Since it is defined a threshold, which differentiate between acceptable and not acceptable error probabilities, I can use the same threshold to modify my labels in 0 and 1.

The problem of the first approach is that I think that the Loss can not converge to small numbers Indeed, just try to put in the BCE formula y=0.5 for example (where y is the label, the groundtruth).  I have tried to train the NN and it reaches 0.4 of losses, even if the pattern of its curve is really good.
The problem of the second approach is that I don’t want my NN to tell if the error probability corresponding to its input is above or below a threshold, but I want to know how much the error probability is.
These last two points are my considerations, but they could be definitely wrong. That’s why I’m asking a more reliable opinion.