Skip to content
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

Some questions about the optimization process #1

Closed
zyang1580 opened this issue Sep 30, 2021 · 1 comment
Closed

Some questions about the optimization process #1

zyang1580 opened this issue Sep 30, 2021 · 1 comment

Comments

@zyang1580
Copy link

Hi, I am reading your paper and codes, it is very interesting work and I would like to take your work as a baseline. But I have some questions about the implementation.

(1) when updating the filters, it seems that there are two goals -- minimize the recommendation loss and maximize the classification loss. In your paper, a hyperparameter $\lambda$ is used to combine the two losses together to realize the goals. But in your codes, it seems that the two corresponding losses are optimized separately, and the classification is only updated one batch as following. Which one should I make use of?

for user_batch, rating_batch, item_batch in train_loader: 
        user_batch = user_batch.cuda()
        rating_batch = rating_batch.cuda()
        item_batch = item_batch.cuda()
        d_g_l_get = model(copy.deepcopy(pos_adj),user_batch,rating_batch,item_batch)
        # d_g_l_get = model(copy.deepcopy(pos_adj),copy.deepcopy(pos_adj),user,item_i, item_j) 
        _,f_l,d_l = d_g_l_get 
        loss_current[0].append(f_l.item()) 
        # loss_current[1].append(d_l.item())  
        f_optimizer.zero_grad()
        f_l.backward()
        f_optimizer.step()
        # continue

    d_g_l_get =  model(copy.deepcopy(pos_adj),user_batch,rating_batch,item_batch)
    _,f_l,d_l = d_g_l_get 
    loss_current[1].append(d_l.item())  
    f_optimizer.zero_grad()
    d_l.backward()
    f_optimizer.step()

(2) if the prediction is not computed by inner product instead of neural networks(NN), do I need to update the NN together when I update the filters?

Looking forward to your reply!

@newlei
Copy link
Owner

newlei commented Oct 12, 2021

This is value function of FairGo.
image

This is a minimax game like GAN. Therefore, we adopt the method of alternating and two-step optimization.

For the second question, the two updates~(updating the NN and updating the filters ) also are separate.

@newlei newlei closed this as completed Nov 23, 2021
@newlei newlei reopened this Nov 23, 2021
@newlei newlei closed this as completed Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants