TensorFlow Intro Assignment C2 W3: compute_total_loss

Course: “Improving Deep Neural Networks: Hyperparameter Tuning, Regularization and Programming Frameworks”
Week #3: Programming Assignment: TensorFlow Introduction

when running: compute_total_loss_test(compute_total_loss, new_y_train ) I keep getting this: “AssertionError: Test 1 does not match. Did you get the reduce sum of your loss functions?”

I am using reduce_sum in my definition of total loss:

def compute_total_loss(logits, labels):
    # mentor edit: code removed

What am I doing wrong?

A reminder: Please do not share your code on the forum. That’s not allowed by the Code of Conduct.

That error message is just a suggestion for fixing one common problem. It’s not necessarily the only possible cause.

Hint:
You need to use tf.transpose() on the labels and logits.

This is hinted at in the instructions:

1 Like