Machine-Learning icon indicating copy to clipboard operation
Machine-Learning copied to clipboard

Something strange in the codes of Siamese codes (declaration of CNN)

Open set92 opened this issue 8 years ago • 1 comments

In both siamese codes you have the class CNN with a parameter n_classes but you never used it, so you can initialize empty? or is a mistake and it need that parameter for something?

# define the CNN and move the network into GPU cnn = CNN(10) cnn.cuda()

And different question, Im thinking in building a Siamese network with LSTM for the quora questions competition of kaggle (learning purpose only), I thought maybe it was better to build first a Siamese with basic RNN but I didn't know where to start. It is suppose I had to know how to implement reading only the papers? Thanks

EDIT: Maybe the n_classes is the same as x in forward parameter? So, is a way of python to encapsule variables?

set92 avatar Jul 31 '17 18:07 set92

Thank you for mentioning the problem. I mistakenly added the "n_classes" to the class. As we do verification, we do not need the n_classes. I am going to remove it for the sake of clarification.

Basically, you need to know the theory and coding both to implement an idea. So you need to learn basic PyTorch (or Tensorflow) and the theory behind RNNs (including LSTM) and read lots of papers (if you are willing to do sth novel).

Anyway, I am going to add a tutorial for RNN and Siamese RNN in PyTorch soon.

hadikazemi avatar Aug 01 '17 14:08 hadikazemi