-
Notifications
You must be signed in to change notification settings - Fork 614
FIX: compile triplet loss within keras model #298
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
FIX: compile triplet loss within keras model #298
Conversation
The docstring says: Take for example yt_shape = tf.shape(y_true) # Tensor("Shape:0", shape=(3,), dtype=int32)
yt_shape.shape # (3,)
yt_shape.shape.rank # 1, passes the new assert The older assert seemed to do as intended, however during
This is what causes the older assert to fail. |
@Squadrick, you are right. I made some mistakes on shape inference here... |
I think it would be a dummy check as there is not explicit shape or rank checking in tf.keras.losses. @facaiy and @Squadrick, what do you feel about this? |
|
Facai, I add a testcase for invalid shape with calling triplet_semihard_loss directly. (Actually, I do not know how to specify the shape of y_true for keras sequential model...) |
I delete the requirement for new test case, Tzu-Wei. Let's add it later if we think it necessary :-) Apologized for the misleading message. |
@Squadrick Hi, Dheeraj, what do you think? |
Yeah, I think it's best we remove the check for now. Taking a look at tf.keras.losses, they don't seem to do a shape check either. As long as the results are numerically accurate, it should be good to go. |
No worries :-) It makes sense to add it when necessary. |
ummm. so, how should I fix ? |
Closes #295.