Hello Andrei!
The short (narrow) answer – use LogSigmoid.
LogSigmoid
Please see my reply to your “Weighted Binary Crossentropy” post:
Best.
K. Frank