Guuuu11 / FC-HGNN_Pytorch

MIT License
5 stars 1 forks source link

CODE #1

Open torture123 opened 2 months ago

torture123 commented 2 months ago

非常感谢作者的论文,对我的研究有了启发,这篇文章的完整代码什么时候可以上传,想要研究学习一下

Guuuu11 commented 2 months ago

感谢关注,代码已上传,欢迎使用。

sws827767542 commented 1 month ago

Left and right hemisphere index of fmri data in the ABIDE dataset based on the HO Brain Atlas.

    leftBrain = torch.tensor([  6.,   5.,  55.,   1.,  98.,  71.,  73.,  77.,  63.,  96.,  79.,  15.,
    104.,   4.,  25.,  23.,  41.,  43.,  45.,  17.,  61.,  65.,  59.,  57.,
     86.,  21.,  35.,  37.,  39.,  94., 110.,   3.,  69.,  81.,  84., 100.,
    102., 106.,  47.,  27.,  75.,   2.,  67.,  19.,  49.,  31.,  33., 108.,
     51.,  53.,  88.,  90.,  92.,  29.,   0.])
    rightBrain = torch.tensor([ 13.,  12.,  54.,   8.,  97.,  70.,  72.,  76.,  62.,  95.,  78.,  14.,
    103.,  11.,  24.,  22.,  40.,  42.,  44.,  16.,  60.,  64.,  58.,  56.,
     85.,  20.,  34.,  36.,  38.,  93., 109.,  10.,  68.,  80.,  83.,  99.,
    101., 105.,  46.,  26.,  74.,   9.,  66.,  18.,  48.,  30.,  32., 107.,
     50.,  52.,  87.,  89.,  91.,  28.,   7.])

Thank you very much for your sharing. Could you please tell me how this is defined, and what error I get when I run it?Traceback (most recent call last): File "C:\Users\dell\Desktop\FC-HGNN\main.py", line 126, in train() File "C:\Users\dell\Desktop\FC-HGNN\main.py", line 70, in train node_logits = model(raw_features) File "D:\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(*args, kwargs) File "D:\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, *kwargs) File "C:\Users\dell\Desktop\FC-HGNN\model.py", line 212, in forward embedding= self.individual_graph_model(graph) File "D:\python\lib\site-packages\torch\nn\modules\module.py", line 1518, in _wrapped_call_impl return self._call_impl(args, kwargs) File "D:\python\lib\site-packages\torch\nn\modules\module.py", line 1527, in _call_impl return forward_call(*args, **kwargs) File "C:\Users\dell\Desktop\FC-HGNN\model.py", line 64, in forward new_left_edges,new_left_edge_attr = subgraph(subset=leftBrain.type(torch.long),edge_index=edges,edge_attr=edge_attr) File "D:\python\lib\site-packages\torch_geometric\utils\subgraph.py", line 40, in subgraph n_mask[subset] = 1 IndexError: index 110 is out of bounds for dimension 0 with size 110

cibimo commented 2 weeks ago

@sws827767542 同样的报错,您有解决么

sws827767542 commented 2 weeks ago

@sws827767542 同样的报错,您有解决么

NO

Guuuu11 commented 2 weeks ago

The torch and pyg versions used in my lab are older, so the function that extracts subgraphs in subgraph.py has been updated, and its input and output may have changed. new_left_edges,new_left_edge_attr = subgraph(subset=leftBrain.type(torch.long),edge_index=edges,edge_attr=edge_attr) This is actually a process for extracting subgraphs. If subgraph doesn't work in your environment, I still believe it can be done easily in many ways.