Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

While running "siamese_nn.py" file - Chapter 7 #7

Closed
Aayush360 opened this issue Aug 12, 2020 · 1 comment
Closed

While running "siamese_nn.py" file - Chapter 7 #7

Aayush360 opened this issue Aug 12, 2020 · 1 comment

Comments

@Aayush360
Copy link

TypeError: Input 'y' of 'Mul' Op has type float32 that does not match type int64 of argument 'x'.

@Aayush360
Copy link
Author

convert Y_true parameter to float in the loss function.

def contrastive_loss(Y_true, D):
margin = 1
return K.mean(np.float(Y_true) * K.square(D) + (1 - np.float(Y_true)) * K.maximum((margin-D),0))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant