0
votes

I am trying to write a custom objective function for keras, and I need to manipulate the data in y_true, y_pred to do this.

def custom_objective(y_true, y_pred):
    print y_true, y_pred

When I print these values, I get:

dense_1_target Softmax.0

I am expecting, with a batch size of 128 and softmax with two classes, y_true and y_pred to be of shape (128, 2), but this is not the case.

How do I get to the data here?

1

1 Answers

0
votes

You can't print a tensor's value using the built-in print function. Check this other question and answers, and also Theano's documentation (if that's the backend you're using).