keras-io
keras-io copied to clipboard
The example on Siamese Network is not really clear.
The example is interesting, but in the last part it is not really clear... and therefore doesn't seem an ... example.
-
Cosine similarity: It doesn't seem really different that for a 'positive distance the value is : 0.994 and for a "negative example" it is: 0.9918
-
In the section: explain what the network has learned there is a group of 3x3 images... but then the cosine similarity is computed only for one ... which one the first one?
-
It is not nice to show that the girl (first row) resembles to a... kind of dog. Since it is on a well-respected site, probably you should be more careful in deciding what to show (and what not...)
answer for question 2 : the cosine similarity is computed for the whole batch. question 1 : the model is not performing well at all.
Agree 100% with OP - not sure what is the value of an "example" that yields absolutely no result (positive and negative have essentially the same value)
I agree. And the performance issue is exacerbated by the fact that the sample that is used for evaluation comes from the training set - and the model can still barely tell the difference between a positive and a negative.
As it stands, the code serves more as a blue print for how to use tf.data, applying some transfer learning/fine-tuning to an existing model and implementing a custom loop, rather than a valid example of a functioning Siamese network.
The siamese similarity estimator example on digits may be less shiny, but at least it performs adequatly on proper test samples.
This doesn't seem to work for me either. The dataset is cool, but I don't believe that the positive and negative similarity is valid. doesn't matter what images I put in the cosine similarity is always about the same 0.99
Hey all, thanks for the discussion. Please feel free create a pull request for any changes you'd like to see to the example. The process is documented here: https://github.com/keras-team/keras-io#readme
I'll close this issue, but please feel free to continue discussion on one of the channels below: