Working on assignment 1 week 1 and stumped when calculating weighted loss. I followed the suggestions given to use keras mean and log, but I’m unsure where the mean comes in.
So far, my idea for the loss calculation is
tf.keras.backend.mean((-1 * w_p * y_true * tf.keras.backend.log(y_pred)) + (w_n * (1-y_true) *tf.keras.backend.log(1-y_pred)))
Not completely sure where the epsilon comes in, but I tried adding it to y_pred and that did not work.
Any help would be much appreciated!