This package shows how to train a siamese network using Lasagne and Theano and includes network definitions for state-of-the-art networks including: DeepID, DeepID2, Chopra et. al, and Hani et. al. We also include one pre-trained model using a custom convolutional network.
What is the format/assumption about how the data is stored if we are training on our own data? Does each class contain its own folder of images in the root data directory?
Hello,
When I try to train my own dataset, after training I try to run the notebook, and at "Visualize the output of the network at any layer" step, I also get:
"ValueError: CorrMM images and kernel must have the same stack size"
I checked my resolution size, and made sure its 50, in all files. But still I get the error.
Hi @pkmital. In Line 2258 of siamese_net.py, for split in ['train', 'valid', 'test']:
The pairs in the training set seems to be used to measure the performance of the trained model. Is this intentional? Aren't one supposed to not include the training set to evaluate the model? Or is it a special case in Siamese Networks?
In the siamese_net.py in the contrastive_loss function I think the definition of the loss is implemented wrong.
The output of the function is the following: return T.mean(y * d + (1.0 - y) * T.maximum(margin - d, 0.0))
but according to the paper, if you see page 3 (bottom) according to the definition, the output must be: return T.mean((1.0 - y) * d + y * T.maximum(margin - d, 0.0))