how to use the repo
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
how to use the repo
Assistant
This repository implements a Graph Neural Network (GNN) approach to solve the Boolean Satisfiability (SAT) problem. Here's a breakdown of how to use it, following the order of operations as defined in the provided scripts:
1. Installation:
- Install necessary libraries:
bash
pip install torch_geometric pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu118.html pip install pytorch-lightning - Compile the MiniSat solver:
bash
cd FAST-GNN-SAT/PyMiniSolvers/ make cd ..
2. Data Generation:
- Generate training, validation, and test datasets: The
1_generate_problems.shscript generates random SAT problems in DIMACS format. It usesgenerate_random_sat.pywith different parameters for each set. The default settings create problems in the directorytemp/cnfs/selsam_3_40/:bash./1_generate_problems.sh--n_pairs: Specifies the number of problems to generate.--out_dir: Specifies the output directory for the generated problems.--min_nand--max_n: Control the number of variables in the generated problems. For the test set,min_nandmax_nare both set to 40, creating problems with exactly 40 variables (SR(40)). Training and validation sets utilize a range of problem sizes.
3. Training:
- Train the GNN model: The
2_train.shscript trains the model using the generated data. It offers two options: incremental and non-incremental training. Incremental training is the method used for the results in the paper (Figure 2).bash./2_train.sh # Incremental training (default) # OR # python train.py --datapath "temp/cnfs/selsam_3_40" --checkpoint "final_model_checkpoint.ckpt" --incremental 1 # Non-incremental training
- Install necessary libraries:
- User
用中文回答 这个代码应该怎么修改模型 增加diffusion
Assistant
这个仓库本身没有实现 diffusion 模型,所以你需要修改代码来添加它。以下提供一些修改模型并加入 diffusion 的思路,但需要你根据具体情况进行调整:
1. 选择 Diffusion 模型:
首先,你需要选择一个合适的 diffusion 模型。一些常见的 diffusion 模型包括:
- DDPM (Denoising Diffusion Probabilistic Models): 这是一个经典的 diffusion 模型,可以作为基础进行修改。
- Improved DDPM: 对 DDPM 的改进版本,训练更稳定,效果可能更好。
- Score-based diffusion models: 另一种类型的 diffusion 模型,可能需要对代码进行更大的修改才能适配。
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.