Git Product home page Git Product logo

sat-solver-using-nns's Introduction

Predicting Satisfiability in SAT3 and Graph Coloring Problems using Graph Transformers Networks (GTNs) and Long Short-Term Memory Networks (LSTMs)

MSc-in-AI-Demokritos-Deep-Learning-Course

Author: Tatiana Boura MTN2210


Contents of this repository:

  • Report.pdf - The report of the project.

  • Presentation.pdf - The presentation of the project.

  • requirements.txt - Requirements.

  • datasets - Folder that includes the dataset for the SAT3 Problem and the dataset for the Graph-Coloring Problem.

  • classification/GNN - Folder that includes all prerequisites for the GTN training-tuning-evaluation. More specifically,

    • data_loader.py, data loader that processes raw .cnf data for the SAT3 problem,
    • dataset_pytorch.py, data loader that translates the processed data to the torch.geometric format,
    • model.py, where the GTN model architecture is located,
    • tuning.py, where functions for hyperparameter tuning are located,
    • train.py, where functions for training, testing and logging are located,
    • best_parameters_same_sets.txt & best_parameters_diff_test.txt, where best parameters are stored after tuning (for same distribution sets and different distribution sets, respectively),
    • final_model_same_sets.pth,final_model_diff_sets.pth & final_model_same_sets_c.pth, where best models are stored after tuning (for same distribution sets, different distribution sets and graph coloring, respectively),
    • folder >plots, where logging plots are located,
    • demo.py, demo that showcases the performance of best model (when trained and tested on data from same distribution) on the unseen testing example demo.cnf,
    • GNN/classification.ipynb, a Python notebook where the model is trained, tuned and evaluated (on two different evaluation sets).
  • classification/LSTM - Folder that includes all prerequisites for the LSTM training-tuning-evaluation. More specifically,

    • data_loader.py, data loader that processes raw .cnf data for the SAT3 problem,
    • dataset_pytorch.py, data loader that translates the processed data to the torch.utils.data format,
    • model.py, where the LSTM model architecture is located,
    • tuning.py, where functions for hyperparameter tuning are located,
    • train.py, where functions for training, testing and logging are located,
    • best_parameters_same_sets.txt, where best parameters are stored after tuning,
    • final_model.pth, where best model is stored after tuning,
    • folder >plots, where logging plots are located,
    • LSTM/classification.ipynb, a Python notebook where the model is trained, tuned and evaluated.
  • graph coloring - Folder that includes all prerequisites for transfer learning the best GTN model for the SAT3 problem to the Graph coloring problem. More specifically,

    • data_loader_c.py, data loader that processes raw .cnf data for the 3-colorable problem,
    • transfer_model.py, where functions for re-training and hyperparameter tuning are located,
    • best_parameters_same_sets.txt, where best parameters are stored after tuning the learning parameters of the transferred model,
    • folder >plots, where logging plots are located,
    • graph_coloring/test_model.ipynb, a Python notebook where the model is re-trained and evaluated.

Process

In order to run the whole process you should execute the notebooks,

  1. classification/GNN/classification.ipynb
  2. classification/LSTM/classification.ipynb
  3. graph_coloring/test_model.ipynb

with the given order.

However, every notebook can also be executed separately.

Otherwise, you could just run the demo. Note that the demo is only for the best-performing model: the one trained and tested on data from the same distribution of SAT3 problem instances.

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.