HUJI-Deep / simnets-tf

SimNets implementation in TensorFlow
MIT License
7 stars 3 forks source link

Make gradient tests for similarity layer more general #17

Closed orsharir closed 7 years ago

orsharir commented 7 years ago

In the current tests of the similarity layer, most cases are not covered. These tests should be generalize to all possible combinations of the different flags supported by the similarity layer, and using random input / parameters.

elhanan7 commented 7 years ago

When making all the tensors constant, I saw that the computed gradients made sense, and the numeric gradients did not. I changed the test by moving the images and templates from 0 (by adding a constant to the random tensor), I also changed the delta of the gradient checker to 0.1 and now the tests pass with the required accuracy

sim_grad_error

You can see that the compted one is symmetric while the numeric one isn't. Looking at the actual numbers prove that the computed one is consistent while the numeric is not.

Anyway, we have exhaustive tests that pass

elhanan7 commented 7 years ago

@orsharir , What do you think? should we close this?