My code is passing for first few tests and failing { especially when there are multiple inputs }
9865.781 10190.6 0.2 -324.61835 0.0
loss = tf.Tensor(0.0, shape=(), dtype=float32)
0.0 0.0 5 5.0 5.0
0.0 2.0 3 1.0 1.0
2.0 0.0 0 2.0 2.0
0.0 0.0 -2 -2.0 0.0
0.0 4.0 3 -1.0 0.0
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
<ipython-input-96-afeb55507a50> in <module>
24 y_pred_perfect = ([[1., 0.], [1., 0.]],[[1., 0.], [1., 0.]], [[0., 1.], [0., 1.]])
25 loss = triplet_loss(y_true, y_pred_perfect, 3)
---> 26 assert loss == 2., "Wrong value. Are you applying tf.reduce_sum to get the loss?"
27 y_pred_perfect = ([[1., 1.], [2., 0.]], [[0., 3.], [1., 1.]], [[1., 0.], [0., 1.,]])
28 loss = triplet_loss(y_true, y_pred_perfect, 1)
AssertionError: Wrong value. Are you applying tf.reduce_sum to get the loss?
Can U you please comment where I am goofing up ? @paulinpaloalto