Coder Social home page Coder Social logo

pytorch-siamese's Introduction

pytorch-siamese

This is a port of chainer-siamese

Install

This installation requires cuda to be installed.

$ virtualenv /usr/bin/python3.5 env
$ env/bin/pip install http://download.pytorch.org/whl/cu80/torch-0.1.12.post2-cp35-cp35m-linux_x86_64.whl 
$ env/bin/pip install torchvision

Run

$ env/bin/python train_mnist.py --epoch 10

This dumps for every epoch ther current state and creates a result.png.

Run specific model

$ env/bin/python train_mnist.py -m model-epoch-7.pth

Result

pytorch-siamese's People

Contributors

delijati avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pytorch-siamese's Issues

Loss: nan

I tried to run this train_mnist.py, but came across Loss: nan.

Also, it is not helpful to reduce the learning rate.

Do you have a way to make the network converge?

Many thanks!

A question about the implementation in pytorch

Hi, the way you implement siamese network is like that:

output1,output2 = model(x0, x1)
loss = criterion (output1,output2)

And here is the another way:

output1 = model.forward_once(x0)
output2 = model.forward_once(x1)
loss = criterion (output1,output2)

Are they different?

Trying to build a Siamese Network with your code as reference

Hello @delijati
I am trying to build a siamese network very similar to what you have done, I am looking to feed the outputs from the siamese network arms to a fully connected layer which has a loss function of its own.
Do you know how to do it in pytorch? Any kind of help is much appreciated!

Thanks

loss: nan

Hey,

Good work. However maybe you're aware, with default hyperparameter settings, loss: nan.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.