Skip to content

Add Siamese Network example #645

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

Open
piyush01123 opened this issue Oct 24, 2019 · 4 comments
Open

Add Siamese Network example #645

piyush01123 opened this issue Oct 24, 2019 · 4 comments

Comments

@piyush01123
Copy link

piyush01123 commented Oct 24, 2019

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.

@msaroufim
Copy link
Member

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

@piyush01123
Copy link
Author

piyush01123 commented Mar 31, 2022

I'll submit a PR in a couple of days for this in accordance with the existing examples of this repo.

@ma7dev
Copy link
Contributor

ma7dev commented May 5, 2022

I have implemented Siamese Network example in this PR #1003

@ma7dev
Copy link
Contributor

ma7dev commented May 13, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants