-
Notifications
You must be signed in to change notification settings - Fork 1
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
Is code in utils
line 117-line 120 real?
#1
Comments
PolarisRisingWar
changed the title
Is code in
Is code in Aug 12, 2021
utils
line 118-line 120 real?utils
line 117-line 120 real?
我试验了一下,底下那个i既在大循环又在小循环好像对小循环里面的i没有影响。 |
我看了一下在 def inference(self, h, adj):
y0 = torch.softmax(h, dim=-1)
y = y0
for i in range(self.K):
y = (1 - self.alpha) * torch.matmul(adj, y) + self.alpha * y0
return y 也是一样的问题,这个y能直接引用吗? |
感谢你对我们工作的关注。下面针对你提出的问题给出答复:
|
非常感谢!虽然我没搞懂机制,但是我自己调试了一下,确实是不会影响。感谢您的回复! |
另外还想问一下,我看到代码中除对邻接矩阵进行正则化外,还对feature也进行了正则化。请问对feature做正则化是专门有什么理论依据的吗? |
这个是follow之前的工作做的数据预处理。
PolarisRisingWar ***@***.***> 于2021年8月12日周四 下午12:59写道:
… 另外还想问一下,我看到代码中除对邻接矩阵进行正则化外,还对feature也进行了正则化。请问对feature做正则化是专门有什么理论依据的吗?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK2BV6NXKTIPEFLE6QDUTFLT4NIJZANCNFSM5B76VP4A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
感谢您的回复!我去看了一下PPNP项目的代码,他们对feature做的正则化好像是这个函数: def normalize_attributes(attr_matrix):
epsilon = 1e-12
if isinstance(attr_matrix, sp.csr_matrix):
attr_norms = spla.norm(attr_matrix, ord=1, axis=1)
attr_invnorms = 1 / np.maximum(attr_norms, epsilon)
attr_mat_norm = attr_matrix.multiply(attr_invnorms[:, np.newaxis])
else:
attr_norms = np.linalg.norm(attr_matrix, ord=1, axis=1)
attr_invnorms = 1 / np.maximum(attr_norms, epsilon)
attr_mat_norm = attr_matrix * attr_invnorms[:, np.newaxis]
return attr_mat_norm 想请问您是参考的这一代码吗? |
我参考的不是这段,具体是哪个代码记不太清楚了。最开始GCN的代码就是这样normalize
feature的,后面follow的工作不少都按照了这种方式预处理数据,特别是对这几个经典数据的预处理。
PolarisRisingWar ***@***.***> 于2021年8月12日周四 下午2:06写道:
… 感谢您的回复!我去看了一下PPNP项目的代码,他们对feature做的正则化好像是这个函数:
def normalize_attributes(attr_matrix):
epsilon = 1e-12
if isinstance(attr_matrix, sp.csr_matrix):
attr_norms = spla.norm(attr_matrix, ord=1, axis=1)
attr_invnorms = 1 / np.maximum(attr_norms, epsilon)
attr_mat_norm = attr_matrix.multiply(attr_invnorms[:, np.newaxis])
else:
attr_norms = np.linalg.norm(attr_matrix, ord=1, axis=1)
attr_invnorms = 1 / np.maximum(attr_norms, epsilon)
attr_mat_norm = attr_matrix * attr_invnorms[:, np.newaxis]
return attr_mat_norm
想请问您是参考的这一代码吗?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK2BV6MFBAIVOAICXJGQ4QLT4NQF3ANCNFSM5B76VP4A>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
好的,非常感谢您的耐心回复!也感谢您与您的团队创作出优秀的论文! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
i既在循环外又在循环内,是不是写错了?
另外最上面y=y0用的是直接引用,那后面对y做修改的话不会对y0也产生影响吗?这一步本来是想保存y0的值吗,那感觉应该用
copy()
或者clone()
之类的代码?The text was updated successfully, but these errors were encountered: