{"id":18256290,"url":"https://github.com/taishan1994/pytorch_han","last_synced_at":"2025-04-04T17:31:55.960Z","repository":{"id":64187775,"uuid":"296843856","full_name":"taishan1994/pytorch_HAN","owner":"taishan1994","description":"异构图神经网络HAN。Heterogeneous Graph Attention Network (HAN) with pytorch","archived":false,"fork":false,"pushed_at":"2023-01-13T08:59:40.000Z","size":77,"stargazers_count":58,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-03-04T13:53:12.130Z","etag":null,"topics":["graph-attention-network","graph-neural-network","heterogeneous-graph","heterogeneous-graph-neural-network","heterogeneous-network","network-embedding"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taishan1994.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-19T10:32:46.000Z","updated_at":"2023-02-21T02:44:31.000Z","dependencies_parsed_at":"2023-01-15T03:31:23.572Z","dependency_job_id":null,"html_url":"https://github.com/taishan1994/pytorch_HAN","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taishan1994%2Fpytorch_HAN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taishan1994%2Fpytorch_HAN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taishan1994%2Fpytorch_HAN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taishan1994%2Fpytorch_HAN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taishan1994","download_url":"https://codeload.github.com/taishan1994/pytorch_HAN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223151647,"owners_count":17096147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-attention-network","graph-neural-network","heterogeneous-graph","heterogeneous-graph-neural-network","heterogeneous-network","network-embedding"],"created_at":"2024-11-05T10:21:04.667Z","updated_at":"2024-11-05T10:21:05.442Z","avatar_url":"https://github.com/taishan1994.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pytorch_HAN\n一位热心git友指出之前问题是过拟合了，修改以下utils.py相关地方得到以下结果：\n\n![1.image](https://github.com/taishan1994/pytorch_HAN/blob/master/images/1.png)\n![2.image](https://github.com/taishan1994/pytorch_HAN/blob/master/images/2.png)\n\n****\n\nPaper address:\u003cbr\u003e\n\u003ca href=\"https://github.com/Jhy1993/Representation-Learning-on-Heterogeneous-Graph\"\u003ehttps://github.com/Jhy1993/Representation-Learning-on-Heterogeneous-Graph\u003c/a\u003e\u003cbr\u003e\nHeterogeneous Graph Attention Network (HAN) with pytorch. If you want to pursue the performance in the original paper, \nthis may not be suitable for you, because there is still a problem: training loss decreases, but verification loss increases.\u003cbr\u003e\n\nIf you just want to figure out the basic principles of HAN and how to change tensorflow code to pytorch code, then this is for you.\nI implemented it according to the original tensorflow code structure.\u003cbr\u003e\n\nIf you want to pursue higher performance, please refer to:\u003cbr\u003e\nOfficial tensorflow implementation:\u003ca href=\"https://github.com/Jhy1993/HAN\"\u003ehttps://github.com/Jhy1993/HAN\u003c/a\u003e\u003cbr\u003e\nDGL implementation:\u003ca href=\"https://github.com/dmlc/dgl/tree/master/examples/pytorch/han\"\u003ehttps://github.com/dmlc/dgl/tree/master/examples/pytorch/han\u003c/a\u003e\u003cbr\u003e\n\n# The result\nAddress of ACM data set：\nPreprocessed ACM can be found in: \u003ca href=\"https://pan.baidu.com/s/1V2iOikRqHPtVvaANdkzROw\"\u003ehttps://pan.baidu.com/s/1V2iOikRqHPtVvaANdkzROw\u003c/a\u003e 提取码：50k2\u003cbr\u003e\n\nYou can use the following command to run:\n```python\npython main.py\n```\n\nTraining result:\n```python\n600 300 2125\ny_train:(3025, 3), y_val:(3025, 3), y_test:(3025, 3), train_idx:(1, 600), val_idx:(1, 300), test_idx:(1, 2125)\n2\nmodel: pre_trained/acm/acm_allMP_multi_fea_.ckpt\nfea_list[0].shape torch.Size([1, 1870, 3025])\nbiases_list[0].shape: torch.Size([1, 3025, 3025])\n3\n2\ntorch.Size([1, 1870, 3025]) torch.Size([1, 3025, 3025])\ntorch.Size([1, 1870, 3025]) torch.Size([1, 3025, 3025])\n训练节点个数： 600\n验证节点个数： 300\n测试节点个数： 2125\nepoch:001, loss:1.1004, TrainAcc:0.3517, ValLoss:1.1022, ValAcc:0.4000\nepoch:002, loss:1.0762, TrainAcc:0.4250, ValLoss:1.1980, ValAcc:0.0533\nepoch:003, loss:1.0007, TrainAcc:0.6300, ValLoss:1.4572, ValAcc:0.0533\nepoch:004, loss:0.8876, TrainAcc:0.6583, ValLoss:2.0040, ValAcc:0.0500\nepoch:005, loss:0.8145, TrainAcc:0.6350, ValLoss:2.7091, ValAcc:0.0500\nepoch:006, loss:0.7897, TrainAcc:0.6267, ValLoss:3.2186, ValAcc:0.0500\nepoch:007, loss:0.7804, TrainAcc:0.6150, ValLoss:3.4550, ValAcc:0.0500\nepoch:008, loss:0.7527, TrainAcc:0.6150, ValLoss:3.5096, ValAcc:0.0500\nepoch:009, loss:0.7404, TrainAcc:0.6117, ValLoss:3.5125, ValAcc:0.0600\nepoch:010, loss:0.7329, TrainAcc:0.6633, ValLoss:3.5349, ValAcc:0.0400\nepoch:011, loss:0.7169, TrainAcc:0.6983, ValLoss:3.5743, ValAcc:0.0133\nepoch:012, loss:0.6934, TrainAcc:0.6917, ValLoss:3.6612, ValAcc:0.0033\nepoch:013, loss:0.6711, TrainAcc:0.6750, ValLoss:3.7738, ValAcc:0.0033\nepoch:014, loss:0.6645, TrainAcc:0.6733, ValLoss:3.9418, ValAcc:0.0200\nepoch:015, loss:0.6652, TrainAcc:0.6833, ValLoss:4.0934, ValAcc:0.0300\nepoch:016, loss:0.6515, TrainAcc:0.6883, ValLoss:4.2498, ValAcc:0.0300\nepoch:017, loss:0.6238, TrainAcc:0.7050, ValLoss:4.4304, ValAcc:0.0300\nepoch:018, loss:0.6082, TrainAcc:0.7317, ValLoss:4.5820, ValAcc:0.0333\nepoch:019, loss:0.6030, TrainAcc:0.7517, ValLoss:4.7110, ValAcc:0.0367\nepoch:020, loss:0.5933, TrainAcc:0.7850, ValLoss:4.8053, ValAcc:0.0400\nepoch:021, loss:0.5824, TrainAcc:0.8267, ValLoss:4.8781, ValAcc:0.0333\nepoch:022, loss:0.5655, TrainAcc:0.8017, ValLoss:4.9006, ValAcc:0.0267\nepoch:023, loss:0.5333, TrainAcc:0.8083, ValLoss:4.9148, ValAcc:0.0167\nepoch:024, loss:0.5175, TrainAcc:0.8050, ValLoss:4.8788, ValAcc:0.0100\nepoch:025, loss:0.4994, TrainAcc:0.8117, ValLoss:4.7670, ValAcc:0.0033\nepoch:026, loss:0.4888, TrainAcc:0.8333, ValLoss:4.5965, ValAcc:0.0033\n```\nThis is where the problem lies.\u003cbr\u003e\nIf you know how to solve this problem, please don't hesitate to tell me.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaishan1994%2Fpytorch_han","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaishan1994%2Fpytorch_han","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaishan1994%2Fpytorch_han/lists"}