Git Product home page Git Product logo

Comments (3)

newlei avatar newlei commented on June 7, 2024

处理好完整的数据集是有的,你可以直接使用。由于处理数据集的步骤繁琐,无法直接提供从原始数据到最终npy的代码。目前的处理lastfm的data.py,只包含了如何处理原始数据,如何得到属性和rating的部分都有,你可以参考。后续还有过滤数据,清洗数据,拆分部分,这部分无法直接提供可处理的代码。

from fairgo.

TangJiakai avatar TangJiakai commented on June 7, 2024

感谢您的回答,但还有几个问题:

  1. 不知道您对于缺失数据是如何处理的呢?比如age和gender为空的,因为我看您处理前后user 数目都不变,说明您并没有过滤掉user
  2. 可否提供如何训练初始的item_emb和user_emb的code呢?因为我看您是直接使用预训练得到的embedding,而非从原始数据端到端训练FairGo的(当然这一点您在paper里面也强调了这是适用于任何模型的,但我想具体了解一下您使用的模型及参数设置等,便于我从头复现);
  3. 在您提供代码里面DisClf**部分的forward,将scores先后经过了log_softmax和CrossEntropyLoss,难道不应该只需要一个CrossEntropyLoss吗?或者说是经过logsoftmax后只需要再使用一个NLLLoss吗?
    def forward(self, ents_emb, labels, return_loss=True):
    scores = self.net(ents_emb)
    outputs = F.softmax(scores, dim=1)#F.log_softmax(scores, dim=1)
    # outputs=scores
    # pdb.set_trace()
    if return_loss:
    loss = self.criterion(outputs, labels)
    # pdb.set_trace()
    # if loss>100:
    # print('gender d process')
    # pdb.set_trace()
    return loss
    else:
    return outputs,labels
  4. paper里面说的VR和VG的比重,也就是说λ设为0.1或者0.2,但我看您代码里实际上VR和VG的比值却为1:1000?具体代码提现到这个地方
    d_loss_all= 10*(d_loss+0.5*d_loss_local)#+1*d_loss_local #+1*d_loss1_local.cpu().numpy()
    g_loss_all= (0.1*loss_p_square - 10*d_loss_all)
    g_d_loss_all = - 1*d_loss_all
    d_g_loss = [d_loss_all,g_loss_all,g_d_loss_all]
  5. 为什么要对rating除一个len_set呢?这个我没有想明白,您可以解释一下吗?
    user_items_matrix_v.append(r_v*1./len_set)
    .
  6. 看到您训练部分的代码,发现您在每一个epoch过程中都会使用一遍train_set、val_set和test_set,这好像不太妥吧。。。
    期待您的回答!

from fairgo.

newlei avatar newlei commented on June 7, 2024

1,离处理数据太久,不记得原始是否有缺失属性,你可以确定一下。如果确实按你说的,原始数据有缺失属性,而user数量不变,那么我是采用了填充方式来做的。
2,如你所说CrossEntropyLoss可以不需要log_softmax,感谢你指出来,你也可以看到部分代码是没有log_softmax,部分代码有log_softmax,由于上传时版本错误导致的,后续会更正。
3,剩余问题是基础性问题故不加以说明。如问题2,提取的emb模型就是普通基础模型BPR,GCN,可自行实现,论文中也有交代。

from fairgo.

Related Issues (5)

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.