import tensorflow as tf
bce = tf.keras.losses.BinaryCrossentropy()
loss = bce([0.], [0.5])
print('loss', loss.numpy())
loss = -(1/1)*( 0*tf.math.log(0.5) + (1-0)*tf.math.log(1-0.5))
print(loss)
import tensorflow as tf
bce = tf.keras.losses.BinaryCrossentropy()
loss = bce([0.], [0.5])
print('loss', loss.numpy())
loss = -(1/1)*( 0*tf.math.log(0.5) + (1-0)*tf.math.log(1-0.5))
print(loss)