-
Notifications
You must be signed in to change notification settings - Fork 62
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 testing with two dissimilar images (entirely two different subjects) your code says that they are same. #5
Comments
Hi @Sumes! I can not provide any help with this limited information. Did you use the newest version of this rep? What's your pytorch version? What's the output of your training process, in which I output the prediction accuracy on test dataset after every 100 mini-batchs. You still train your model with batch_size = 1? Anyway, that will be very helpful for our discussion if you can provide your code and output in a jupyter/ipython file. |
I did not modify your code. can you please check the output with test batch
size equal to one for two entire two image sets (parallely)?
I think the problem is the with
pred = np.argmax(output)
This gives output as zero even if the images are different.
…On Fri, Nov 16, 2018 at 7:37 AM Pin,Fang ***@***.***> wrote:
Hi @Sumes <https://github.com/Sumes>! I can not provide any help with
this limited information. Did you use the newest version of this rep?
What's your pytorch version? What's the output of your training process, in
which I output the prediction accuracy on test dataset after every 100
mini-batchs. You still train your model with batch_size = 1? Anyway, that
will be very helpful for our discussion if you can provide your code and
output in a jupyter/ipython file.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoXVSzQGyR1CxaMu0tfaihpF9ZwazP6nks5uvh3hgaJpZM4YfsIJ>
.
|
I did not modify your code. can you please check the output with test batch size equal to one for two entire two image sets (in parallel)? pred value is zero even if the images are different. |
Please refer to this function: Line 96 in c2b1567
There is trick to sample test data. I record the target image in self.img1 and always put the image whose class is same as self.img1 into the first position of each mini-batch. So if the model makes a right prediction, the 'pred = np.argmax(output)' should be 0. Hope that will be helpful. @Sumes |
Will you please test that with two entirely different images and see what
pred is returning?
…On Fri, Nov 16, 2018 at 5:35 PM Pin,Fang ***@***.***> wrote:
Please refer to this function:
https://github.com/fangpin/siamese-pytorch/blob/c2b1567dc70539f4eddd2935df0c7140309cf20d/mydataset.py#L96
.
There is trick to sample test data. I record the target image in self.img1
and always put the image whose class is same as self.img1 into the first
position of each mini-batch. So if the model makes a right prediction, the
'pred = np.argmax(output)' should be 0. Hope that will be helpful. @Sumes
<https://github.com/Sumes>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AoXVS-9LDS8r4mXopJFIgxhStyXP420Gks5uvqoIgaJpZM4YfsIJ>
.
|
If the images are different it should return non zero value right?
I am requesting you to do a unit test kind of thing may be with a notebook
or so.
On Sun, Nov 18, 2018 at 10:47 AM Sumesh Uploader <[email protected]>
wrote:
… Will you please test that with two entirely different images and see what
pred is returning?
On Fri, Nov 16, 2018 at 5:35 PM Pin,Fang ***@***.***> wrote:
> Please refer to this function:
> https://github.com/fangpin/siamese-pytorch/blob/c2b1567dc70539f4eddd2935df0c7140309cf20d/mydataset.py#L96
> .
> There is trick to sample test data. I record the target image in
> self.img1 and always put the image whose class is same as self.img1 into
> the first position of each mini-batch. So if the model makes a right
> prediction, the 'pred = np.argmax(output)' should be 0. Hope that will be
> helpful. @Sumes <https://github.com/Sumes>
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#5 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AoXVS-9LDS8r4mXopJFIgxhStyXP420Gks5uvqoIgaJpZM4YfsIJ>
> .
>
|
loss_val += loss.data[0] |
When I am trying to print the value predicted (pred = np.argmax(output)), [100] right: 100 error: 0 precision: 1.000000 |
While testing with two dissimilar images (entirely two different subjects) your code says that they are same.
The text was updated successfully, but these errors were encountered: