-
Notifications
You must be signed in to change notification settings - Fork 260
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
Custom loss function using intermediate layer output and output layers #182
Comments
It is definitely possible, though not out of the box. Have a look at the |
dfdf have you solved the problem? |
I need to create a loss function that uses values from a intermediate layer based on DeepID2.
Basically I have this network:
And I need to change the loss function to something like:
1 - Input two images file for each mini-batch
2 - If the images are from the same person (same ID) the loss function will be:
Loss_function:
Error from Image 1 (categorical_crossentropy[Image 1, ID1])
plus
Error from Image 2 ( categorical_crossentropy[Image 2, ID1])
plus
Error between the values of hidden4_layer for the Image 1 and Image 2
(Ex: get_output from hidden4 for image 1 and image 2 and apply squared_error )
3 - If the images are from different person:
Loss_function:
Error from Image 1 (categorical_crossentropy[Image 1, ID1])
plus
Error from Image 2 ( categorical_crossentropy[Image 2, ID2])
Is possible to do this in nolearn?
The text was updated successfully, but these errors were encountered: