This code is part of the ICLR 2026 submission "NEURAL NETWORK ISING MACHINES: ALGORITHM
UNROLLING FOR COMBINATORIAL OPTIMIZATION"

This code was used for all the numerical results and figures.

We include .sh scripts for figure 3a, 3c and 3d as well as figure 7 (train_size_comp_commands.sh).
If you would like instructions on how to reproduce other figures or tables please contact the authors.





General usage:



Train a model:

python main.py <T_c> <D> <M> <SEED> <INSTANCE_SET> <MODEL>

<T_c>,<D>,<M> are as defined in the text

<SEED>:  If SEED >= 0 then it is used as the random seed for PyTorch. 
If SEED <0 then -SEED will correspond to the pre-tuned parameters (p.txt and p_L.txt) which are loaded from the ./boot directory

<INSTANCE_SET>: Specifies the distribution of problem instances as well as the T parameter (number of iterations). 
For example "SK_1T_N_300" will train on a set of 100 problem instances of size N=300 where T = 1*N = 300.

<MODEL>: Type of model used.
4: cNPIM
6: dNPIM
-2: CAC



Evaluate trained model:


python eval.py <T_c> <D> <M> <SEED> <INSTANCE_SET_TRAIN> <MODEL> <INSTANCE_SET_EVAL> <EVAL_NAME>

<T_c>,<D>,<M> are as defined in the text

<SEED>: Either seed of the training run or seed of the boot file depending on the value of INSTANCE_SET_TRAIN

<INSTANCE_SET_TRAIN>: 
If INSTANCE_SET_TRAIN is "FROM_BOOT" than the parameters will be loaded from the ./boot directory corresponding to -SEED
Otherwise, the parameters are loaded from the ./out directory corresponding to T_c, D, M, SEED, INSTANCE_SET_TRAIN and MODEL

<MODEL>: Type of model used.

<INSTANCE_SET_EVAL>: The instance distribution to run the eval on (can be different than training distribution)

<EVAL_NAME>: Arbitrary name set by user corresponding to path in the ./eval directory where the eval is saved.



