jiangqy / dpsh-pytorch Goto Github PK
View Code? Open in Web Editor NEWA pytorch implementation for paper "Feature Learning based Deep Supervised Hashing with Pairwise Labels" with pytorch version
A pytorch implementation for paper "Feature Learning based Deep Supervised Hashing with Pairwise Labels" with pytorch version
Thanks for your effort, but I have two question about the loss:
In the Logtrick
function, why do you add torch.max(x, Variable(torch.FloatTensor([0.])))
;
In the end, why do you divide num_train * len(train_label)
.
Thank you for your reply.
how to download the complete dataset
I just started learning pytorch, how do I make a small demo that input two pictures to determine whether it is similar or not with your code ? Thank you .
The loss function is defined as
theta_x = train_outputs.mm(Variable(U).t()) / 2
logloss = (Variable(S)*theta_x - Logtrick(theta_x, use_gpu)).sum()
/ (num_train * len(train_label))
regterm = (Bbatch-train_outputs).pow(2).sum() / (num_train * len(train_label))
loss = - logloss + lamda * regterm
Why don't you use Variable(U).mm(Variable(U).t()) / 2 (All train data) or
train_outputs.mm(train_outputs.t()) / 2 (The mini-batch data ) when you calculate theta_x? In this condition,Sij can be the pairwise label between all train data or the mini-batch data. May I ask if there is any reason why you have to do so? I'm trying to rewrite the loss function in my way,but I get a huge loss. It even prints NaN,I don't know why this is happening.
I am very interested in this code ,can you give me some advice for a higher MAP based on your code?
Seeing map on the order of .0015 or less. I am trying alexnet with a small batchsize and epoch and getting very low map. I'm curious if you wanna chat about how to improve the results for other datasets. If you email me at posix4e at gmail dot com
Hi, Jang.
As we can see, you test the model after one epoch using test set as queries to retrieval from train set. So, I have some trouble about that.
It seems that you save the model after all train are finished, then how do you ensure the last model is the best one(lowerst loss or highest mAP)?
Why do you use mAP to val the model by using test set as queries to retrieval from train set? How about use the loss to val the model?
Thanks for your reply.
why the map is so low,approximately about 10%
@jiangqy hi, doctor jiang!
On the basis of DPSH, I added tanh as the last layer function of the network, and the loss suddenly increased during training, as shown below; when I removed tanh, everything was normal. Do you know what happened?
Epoch: 34/150 Train_loss: 0.23092
Epoch: 35/150 Train_loss: 0.22569
Epoch: 36/150 Train_loss: 0.22112
Epoch: 37/150 Train_loss: 0.21693
Epoch: 38/150 Train_loss: 3.01185
Epoch: 39/150 Train_loss: 4.22574
Epoch: 40/150 Train_loss: 5.80905
Epoch: 41/150 Train_loss: 9.34127
Epoch: 42/150 Train_loss: 4.26501
Epoch: 43/150 Train_loss: 5.96325
Epoch: 44/150 Train_loss: 5.72492
Epoch: 45/150 Train_loss: 6.11856
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.