The notebook compiles and runs fine when I manually run it. Giving the correct output and the test passes. However, the autograder keeps failing with the following error:

Cell #UNQ_C3. Can’t compile the student’s code. Error: NotImplementedError(‘Cannot convert a symbolic Tensor (Const:0) to a numpy array.’,)

Notice for the final weight loss one is suppose to use pos_weights and neg_weights.
Also while you are implementation K.mean is correction but you do need to use keras mean separately for pos_weights and neg_Weights.
Also your operator placement(compare with the image shared) before Keras mean is incorrect here. The operator placement is for the sum of the pos weight and neg weights together and not for keras mean.

Write the equation in tuple for sum of these weightings the positive and negative labels within each class with the operator placed as per the image shared here and that equation needs to be implemented with keras mean.

Thank you for responding. The assignment specificially asked to use Keras and to leverage mean. Otherwise, I would have used numpy. I will see if numpy solves it