PtrNet
chainer implementation of pointer networks with beam search
Install / Use
/learn @rkuga/PtrNetREADME
PtrNet
Chainer implementation of ptrnet for TSP.
The dataset is not available here so please it prepare by yourself. Discription is in /nets/base_network.py.
how to use
step1.
Install the chainer.
pip install chainer=='1.24.0'
step2.
Create the dataset as discribed in base_network.py.
I used 1048576 tours for train data.
step3.
Run the code for training.
python main.py
step4.
After training 10 epochs, run the code for testing
python main.py --mode test --load ptrnet 10 --beam_width 10
Beam search will be done if you assign the beam_width > 1.
result
The original paper said the average tour length predicted from ptrnets is 2.88 compared with its ground truth length 2.87, and actually I got 2.88.
Related Skills
node-connect
347.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
108.0kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
