1 Star 5 Fork 2

ThE_eXpLoReR/GNN_TSP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

图神经网络求解TSP问题

介绍

使用图神经网络求解TSP问题
使用的模型:GCN、GAT、GatedGCN
参考文献:Benchmarking Graph Neural Networks

模型说明

  • checkpoints: 保存模型训练权重的文件夹;已保存训练好的权重,使用者可自行训练保存
  • configs: 包含模型的参数设置文件
  • data: 包含数据预处理的类和函数
  • dataset: 保存的是数据集
  • layers: 包含三种模型的layer定义:GCN、GAT、GatedGCN
  • logs: 保存log信息的文件夹;已保存训练过的信息,保存时文件名称会命名为当前时间
  • nets: 包含三种模型的net定义:GCN、GAT、GatedGCN
  • pic: 保存的是在gitee上展示的图像
  • plat: 包含各种画图函数和类,可以对训练数据画图展示
  • test: 包含测试文件,通过读取checkpoints中保存的训练权重,对测试集中数据进行测试
  • train: 包含训练函数
  • main.py: 主函数

使用准备

  • dgl >= 0.4.2
  1. Anaconda (版本最好不要太旧)
  2. torch==1.6.0; torch_vision==0.7.0 及相关的包
  3. 其他相关的包,可自行调试判断

使用说明

  • 本代码仅供学习和学术研究下载
  • 如有问题请在评论区提问

训练效果

  1. GCN
    gcn_train
  2. GAT
    gat_train
  3. GatedGCN
    gatedgcn_train

模型效果

  • 真实路由:
    truth_tour
  1. GCN
  • F1值: 0.648648
    gcn_tour
  1. GAT
  • F1值: 0.771084
    gat_tour
  1. GatedGCN
  • F1值: 0.804597
    gatedgcn_tour

参与贡献

wang567

MIT License Copyright (c) 2022 LuChen Wang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

图神经网络求解TSP问题 展开 收起
Python
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/wang567/GNN_TSP.git
git@gitee.com:wang567/GNN_TSP.git
wang567
GNN_TSP
GNN_TSP
master

搜索帮助