GithubHelp home page GithubHelp logo

hkxiron / pointer-network-tensorflow Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devsisters/pointer-network-tensorflow

0.0 1.0 0.0 777 KB

TensorFlow implementation of "Pointer Networks"

License: MIT License

Python 100.00%

pointer-network-tensorflow's Introduction

Pointer Networks in Tensorflow

TensorFlow implementation of Pointer Networks.

model

Support multithreaded data pipelines to reduce I/O latency.

Requirements

Usage

To train a model:

$ python main.py --task=tsp --max_data_length=20 --hidden_dim=512 # download dataset used in the paper
$ python main.py --task=tsp --max_data_length=10 --hidden_dim=128 # generate dataset itself

To train a model:

$ python main.py
$ tensorboard --logdir=logs --host=0.0.0.0

To test a model:

$ python main.py --is_train=False

Results

Train/Test loss of max_data_length=10 after 24,000 steps:

$ python main.py --task=tsp --max_data_length=10 --hidden_dim=128
$ ...
$ 2017-01-18 17:17:48,054:INFO::
$ 2017-01-18 17:17:48,054:INFO::test loss: 0.00149279157631
$ 2017-01-18 17:17:48,055:INFO::test pred: [1 6 2 5 4 3 0 0 0 0 0]
$ 2017-01-18 17:17:48,057:INFO::test true: [1 6 2 5 4 3 0 0 0 0 0] (True)
$ 2017-01-18 17:17:48,059:INFO::test pred: [1 3 8 4 7 5 2 6 0 0 0]
$ 2017-01-18 17:17:48,059:INFO::test true: [1 3 8 4 7 5 2 6 0 0 0] (True)
$ 2017-01-18 17:17:48,058:INFO::test pred: [ 1  8  3  7  9  5  6  4  2 10  0]
$ 2017-01-18 17:17:48,058:INFO::test true: [ 1  8  3  7  9  5  6  4  2 10  0] (True)

model

Train/Test loss of max_data_length=20 after 16,000 steps:

$ python main.py --task=tsp --max_data_length=20 --hidden_dim=512
$ ...
$ 2017-01-18 17:30:44,738:INFO::
$ 2017-01-18 17:30:44,739:INFO::test loss: 0.0501566007733
$ 2017-01-18 17:30:44,739:INFO::test pred: [ 1  3 16 18  6  2  7  4  5 15 10  8 13 11 17 20 19 14  9 12  0]
$ 2017-01-18 17:30:44,740:INFO::test true: [ 1  3 16 18  6  2  7  4  5 15 10  8 13 11 17 20 19 14  9 12  0] (True)
$ 2017-01-18 17:30:44,741:INFO::test pred: [ 1  4 12  8  2 17 20  3 18 14 16 11 13 15  7 10  9  6 19  5  0]
$ 2017-01-18 17:30:44,741:INFO::test true: [ 1  4 12  8  2 17 20  3 18 14 16 11 13 15  7 10  9  6 19  5  0] (True)
$ 2017-01-18 17:30:44,742:INFO::test pred: [ 1  8 16 20 19 14 18  2  9 12 15 11  3 13  5  6  7  4 17 10  0]
$ 2017-01-18 17:30:44,742:INFO::test true: [ 1  8 16 20 19 14 18  2  9 12 15 11  3 13  5  6  7  4 17 10  0] (True)

model

Author

Taehoon Kim / @carpedm20

pointer-network-tensorflow's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.