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

model_init #13

Open
11051911 opened this issue Sep 19, 2023 · 1 comment
Open

model_init #13

11051911 opened this issue Sep 19, 2023 · 1 comment

Comments

@11051911
Copy link

在`def model_init(model, X, y, A_norm):
"""
load the pre-train model and calculate similarity and cluster centers
Args:
model: Dual Correlation Reduction Network
X: input feature matrix
y: input label
A_norm: normalized adj
Returns: embedding similarity matrix
"""
# load pre-train model
model = load_pretrain_parameter(model)

# calculate embedding similarity
with torch.no_grad():
    _, _, _, sim, _, _, _, Z, _, _ = model(X, A_norm, X, A_norm)

# calculate cluster centers
acc, nmi, ari, f1, centers = clustering(Z, y)

return sim, centers`中
    _, _, _, sim, _, _, _, Z, _, _ = model(X, A_norm, X, A_norm)中X,A_norm出现了两次

在传入forward(self, X_tilde1, Am, X_tilde2, Ad)函数时是应该是x1一波和x2一波,
image
这样的话取平均好像好不取平均是一样的了 Z_ae = (Z_ae1 + Z_ae2) / 2
Z_igae = (Z_igae1 + Z_igae2) / 2

这个地方不太理解,可以解答一下吗?

@yueliu1999
Copy link
Owner

你好,感谢关注。在模型初始化的时候,还不需要做图数据增强,因此只有一个视图的数据,只需要传X和A_norm一次。这里写的应该只是为了适配那个函数的输入和输出,实际上只计算一次就可以,之后可以修改成只做一次encoding的。

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