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

请问General Recommendation的边是否能设置权重? #59

Open
ralgond opened this issue Feb 5, 2023 · 3 comments
Open

请问General Recommendation的边是否能设置权重? #59

ralgond opened this issue Feb 5, 2023 · 3 comments

Comments

@ralgond
Copy link

ralgond commented Feb 5, 2023

谢谢!

@hyp1231
Copy link
Member

hyp1231 commented Feb 20, 2023

您好!抱歉回复较晚。目前已实现的几个通用图卷积模块(LightGCN, BipartiteGCNConv, BiGNNConv)都提供了输入边的权重 edge_weight 的接口,如

class LightGCNConv(MessagePassing):
def __init__(self, dim):
super(LightGCNConv, self).__init__(aggr='add')
self.dim = dim
def forward(self, x, edge_index, edge_weight):
return self.propagate(edge_index, x=x, edge_weight=edge_weight)

您可以新建模型时调用这些类,并传入您希望设置的边权重。

@ralgond
Copy link
Author

ralgond commented Feb 27, 2023

“您可以新建模型时调用这些类,并传入您希望设置的边权重。”

我想请教一下新建模型的步骤,请问有没有参考文档和代码?

@hyp1231
Copy link
Member

hyp1231 commented Feb 28, 2023

您好,新建模型可以参考这篇 API Doc,同时您也可以参考 https://github.com/RUCAIBox/RecBole-GNN/tree/main/recbole_gnn/model 下面对应类别模型的实现。

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