Giter Site home page Giter Site logo

image-tsp's Introduction

image-tsp

This work is currently under review.

Setup

Ensure PYTHONPATH env variable is set first.

export PYTHONPATH="/insert/path/of/image-tsp"

Data Generation

All data generation code can be found in src/main/generate_data.py. The command line script to run would be python src/main/generate_data.py generate. Generating the data first entails generating the pickle files. the draw and drawall commands can then be used to draw the TSP images based on the pickle files. It is necessary to draw the pickle files as the training process will be simpler. Reading an image in from disk is easier than generating it every time is needed (probably faster too).

On MIT Supercloud, the file generate.sh has to be edited. and then sbatch generate.sh should be run. The function signature inside generate.sh should also be helpful in understanding how to run this.

After generating the pickle files, run python src/main/generate_data.py draw TSP400.pickle 400 "(1024, 1024, 3)" to draw the TSP images.

Training

To train a model:

  1. Edit the argument in run.sh that represents the number of cities you would like to train on.
  2. ./run.sh - Configured for MIT Supercloud.

To look deeper in the code, see src/nn/tspconv.py.

Testing

To run the test samples on the model:

  1. LLsub -i -g volta:1 to acquire a GPU node. Only for MIT Supercloud.
  2. python src/nn/tspconv_eval.py

Don't forget to configure the experiment folders inside tspconv_eval.py. If it doesn't run, check your PYTHONPATH.

Collaborators

  1. Matthias Winkenbach ([email protected])

image-tsp's People

Contributors

jkschin avatar

Stargazers

Jiayi Luo avatar

Watchers

 avatar

image-tsp's Issues

Write Analyzer for Naive vs CNN

  1. decoder.py has too much code bloat. It needs to be refactored out into an analyzer.
  2. This analyzer takes a given image ID (and the relevant num_cities, file paths, etc.) and outputs all the routes a particular node can go to. See figure below.
  3. Similarly, it should be able to highlight exactly which edges were pruned. Specifically, if the CNN pruned some edges, and that particular edge was in the near-optimal solution, this edge needs to be highlighted.
  4. The analyzer should output a summary image (to be defined) and the individual routes that allow a deep dive (figure below).

Fig 1

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.