jacobwwh / graphmatch_clone Goto Github PK
View Code? Open in Web Editor NEWCode and data for paper "Detecting Code Clones with Graph Neural Network and Flow-Augmented Abstract Syntax Tree".
Code and data for paper "Detecting Code Clones with Graph Neural Network and Flow-Augmented Abstract Syntax Tree".
Hi, l recently read your paper about Code Clones Detection with GNN. I appreciated that you opensource your codes and l have learned from them.
But when I ran ggnn_bcb.py without any modification, l got wrong with "Process finished with exit code 139" at GlobalAttention Step (line 3).
x = self.ggnnlayer(x, edge_index)
batch=torch.zeros(x.size(0),dtype=torch.long).to(self.device)
hg=self.pool(x,batch=batch)
It seems that one array access out of bounds when doing softmax. l don't know whether it went wrong when you did experiments.
Another question is, l found that you got edge_attr information when creating the fa-ast but didn't use it in the ggnn layer.
I hope to hear from your replies, thank you!
1、注释了propagate方法,却调用了它
2、object has no attribute 'update_args',class GMNlayer中并没有定义这个参数,
3、我安装了torch-geometric-1.4.3,报错:RuntimeError: scatter_add() Expected a value of type 'Tensor' for argument 'src' but instead found type 'NoneType'. ,,requirement.txt中要求版本为torch-geometric==1.6.3,,但是其中torch_geometric.utils import scatter_ 据说在1.4.3版本之后就废除了??试了几个高于1.4.3版本的全都是ImportError: cannot import name 'scatter_'
4、bug解决一个又一个,不知道是不是pytorch1.8版本过高的问题,但requirement.txt中确实这么要求了
5、bug太多了,requirement.txt中依赖那么多,实际上并不需要那么多,需要的几个依赖版本也不正确,令人费解ing...
6、RuntimeError: scatter_add() Expected a value of type 'Tensor' for argument 'src' but instead found type 'NoneType'.
def match(self, edge_index_i, x_i, x_j, size_i):
return
'''def match(self, edge_index_i, x_i, x_j, size_i):
#x_j = x_j.view(-1, 1, self.out_channels)
#alpha = torch.dot(x_i, x_j)
#print(edge_index_i.size())
#print(x_i.size(),x_j.size())
alpha=torch.sum(x_ix_j, dim=1)
#alpha=torch.bmm(x_i.unsqueeze(1), x_j.unsqueeze(2))
#print(alpha.size())
size_i=x_i.size(0)
alpha = softmax(alpha, edge_index_i, size_i)
#print(alpha.size())
c = torch.ones(A, B) * 2
v = torch.randn(A, B, C)
print(c)
print(v)
print(c[:,:, None].size())
d = c[:,:, None] * v
return alpha[:,None]x_j
#return x_j alpha.view(-1, 1, 1)
#return (x_i-x_j) alpha.view(-1, 1, 1)'''
这里match啥也不干吗,注释掉的match中“A、B、C”也没有定义
7、我是跑不通,数据处理还可以ggnn可以跑,gmn模型bug是真的多。(也许是环境问题,如果作者看到,还望不吝解答,感谢!!)
作者您好,
在论文中提到阈值是由验证集的结果进行调整,是根据验证集自动调整,还是读者自己调整呢?
如果是根据验证集自动调整,请问在代码run_bcb.py中什么位置呢?我没有找到自动调整阈值的代码。
如果是读者自己调整,那么调整的标准是什么呢?
望作者不吝赐教,非常感谢!
作者您好,我在运行run_bcb.py时出现了问题,提示如下:
Traceback (most recent call last):
File "run_bcb.py", line 15, in
import models
File "/home/zjk/data/yhx/FA-AST/models.py", line 5, in
from torch_geometric.nn import MessagePassing,GatedGraphConv
File "/home/zjk/data/anaconda3/envs/tf2.0/lib/python3.6/site-packages/torch_geometric/init.py", line 4, in
import torch_geometric.data
File "/home/zjk/data/anaconda3/envs/tf2.0/lib/python3.6/site-packages/torch_geometric/data/init.py", line 1, in
from .data import Data
File "/home/zjk/data/anaconda3/envs/tf2.0/lib/python3.6/site-packages/torch_geometric/data/data.py", line 3, in
from torch_geometric.typing import OptTensor, NodeType, EdgeType
File "/home/zjk/data/anaconda3/envs/tf2.0/lib/python3.6/site-packages/torch_geometric/typing.py", line 4, in
from torch_sparse import SparseTensor
ModuleNotFoundError: No module named 'torch_sparse'
我猜想是我安装的包版本问题,导致torch_sparse调用出现问题,我想问一下您所用torch_geometric以及torch是多少版本呢?
期待作者的回复,非常感谢!
Hi.
Thank you for open-sourcing your work. I'm aiming to replicate your work however, the versions of the packages that are used are not specified. I've tried different version combinations however they don't seem to work with each other. Can you please indicate the exact version for each of the packages that you have used?
作者您好,我有一点疑惑的地方,想向您请教。BigCloneBench数据集中把克隆对分成了五种克隆类型,分别为:T1, T2, ST3, MT3, WT3/T4。您在实验中是将这五种类型统一看成是克隆对和非克隆对,并用1和-1来做标签,没有按他们具体是哪种克隆类型来做区分(因为第五种克隆类型占比98%多,所以其他类型的相对来说可以忽略不计)。请问我的理解是正确的吗?请您赐教。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.