examples
examples copied to clipboard
Add Siamese Network example
Hi, I want to add an example for Siamese network, since it is one of the popular use cases in ML. I am thinking of implementing it in a way similar to other examples viz. command line arguments to choose which dataset to train, hyperparameters etc. Is there something I need to keep in mind specifically apart from these:
- Use torchvision's Dataset class and PyTorch's DataLoader class to handle data.
- Implement a simple CNN as a nn.Module subclass
- Implement triplet loss
- Create train and test functions and a main function that calls those 2 methods at each epoch.
- Report final loss and accuracy
Is this something that is worth adding to the repository.
Hi @piyush01123 you're welcome to try producing an example, I'd suggest taking a look at existing examples to see how to get going
I'll submit a PR in a couple of days for this in accordance with the existing examples of this repo.
I have implemented Siamese Network example in this PR https://github.com/pytorch/examples/pull/1003
I suggest closing this issue as #1003 has been merged to master. Thanks, @msaroufim for the feedback!
I can make another example that aligns with what the issue is suggesting in the matter of using a more proper dataset, TripletLoss, and implementing a simple CNN rather than ResNet18 which was used in #1003 implementation.