naver / deep-image-retrieval

End-to-end learning of deep visual representations for image retrieval
https://europe.naverlabs.com/Research/Computer-Vision/Learning-Visual-Representations/Deep-Image-Retrieval/
BSD 3-Clause "New" or "Revised" License
646 stars 101 forks source link

GeM pooling parameter #9

Closed andrefaraujo closed 5 years ago

andrefaraujo commented 5 years ago

Hi @almazan ,

For your experiment trained on the Google Landmarks dataset 2018 (codenamed Resnet101-AP-GeM-LM18): could you share to which value the GeM pooling p parameter converged to?

If you could additionally share learning curve showing the evolution of p over the training run, that would be even better :)

Thanks!

almazan commented 5 years ago

Hi @andrefaraujo,

For that experiment, the GeM pooling p parameter converged to 2.99.

Unfortunately, I don't have its evolution because I don't have access to the intermediate snapshots anymore. However, given that we used 3 as the starting value, my guess is that that curve is pretty flat :D

Interestingly, all models converged to a similar value, not really moving away from the starting point.

I hope it helped.

Cheers!

andrefaraujo commented 5 years ago

Very interesting, thanks!

Zenobia7 commented 4 years ago

Hello, can you share the multistaged_backpropagation training process?How do you calculate the derivative of the similarity matrix S and matrix D?I calculated it automatically through pytorch, but the parameter update seems to be a bit problematic. ''' desc_db = Variable(torch.cuda.FloatTensor(desc_db),requires_grad=True) scores = torch.matmul(desc_db,desc_db.t()) vaild_index = np.arange(batch_sizeindex,batch_size(index+1),1) Y = np.array(Y_all)[vaild_index][:,vaild_index] Y = torch.cuda.FloatTensor(np.array(Y)) rank_loss = criterion(scores, Y)

rank_loss = Variable(rank_loss, requires_grad=True)

        rank_loss.backward()
        loss += rank_loss.item()
        net.train()
        for i,img in enumerate(imgs):
            img = Variable(img.cuda(),requires_grad=True)
            desc = net(img.unsqueeze(dim=0))
            one_grad = desc_db.grad[i].unsqueeze(0)
            desc.unsqueeze(0).backward(one_grad)
        optimizer.step()
        scheduler_mul.step()
        optimizer.zero_grad()
        lr = scheduler_mul.get_lr()[0]

'''