Hi Omran!
Responding solely to the title of your post:
BCELoss requires both its input and its target to be probabilities,
that is, numbers between zero and one.  (input must be in (0, 1),
exclusive, otherwise you can get -inf, while target can be in
[0, 1], inclusive, that is can be equal to 0 or 1.)
If you go outside of these ranges, you can get negative values.
(In general, you will prefer BCEWithLogitsLoss over BCELoss.)
Good luck.
K. Frank