GithubHelp home page GithubHelp logo

zawagner22 / cross-entropy-for-combinatorics Goto Github PK

View Code? Open in Web Editor NEW
53.0 3.0 14.0 131 KB

Code accompanying the manuscript "Constructions in combinatorics via neural networks and LP solvers".

Python 100.00%

cross-entropy-for-combinatorics's Introduction

cross-entropy-for-combinatorics

Code accompanying the arXiv version of the manuscript "Constructions in combinatorics via neural networks" by A Z Wagner https://arxiv.org/abs/2104.14516

Software requirements

  • Tensorflow version 1.14.0
  • Python version 3.6.3
  • Keras version 2.3.1

Demos

The cem_binary_conj21.py file contains the solution to Conjecture 2.1 in the paper. The code is very simple and rather slow, but it is enough to find the counterexample given in the paper within a day.

The cem_binary_conj23_with_numba.py file contains the solution to Conjecture 2.3. It uses the numba package to speed up the calculation of the reward. It will find a graph similar to Figure 5 in the arXiv paper, within a few days.

Installation and usage

Install the versions of Tensorflow, Python, and Keras as above. Note that having higher versions of Tensorflow and Python might drastically reduce the performance of the code.

Download the code_template.py file. Change the variable DECISIONS to the number of binary decisions in your problem, and choose the hyperparameters. Next, fill in the reward function for your problem in the calc_score function. The input to this function is a 0-1 list of length DECISIONS, representing your graph or other object you have created. See demos for examples. Run the program simply with the python code_template.py command, no installation is necessary.

Output

During runtime, the program will display the scores of the best constructions in the current iteration. All the information is also saved every 20 iterations into files, both in pickle and txt formats, in the same folder as the .py file.

cross-entropy-for-combinatorics's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cross-entropy-for-combinatorics's Issues

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.