CLI reference#

Complete flag lists, taken from the argparse definitions in train.py and test.py. (The README shows only the commonly used subset.)

train.py#

python train.py --group_id <id> [options]

Puzzle#

FlagTypeDefaultDescription
--group_idintrequiredGroup ID — which puzzle. See Groups
--target_idint0Target ID — which solved state

Model architecture#

FlagTypeDefaultDescription
--hd1int1024Size of the first hidden layer
--hd2int256Size of the second hidden layer (0 disables it)
--nrdint4Number of residual blocks (0 disables them)
--dropoutfloat0.0Dropout rate

Optimisation#

FlagTypeDefaultDescription
--epochsint256Number of training epochs
--batch_sizeint10000Batch size
--lrfloat0.001Learning rate
--K_minint1Minimum K for random walks
--K_maxint30Maximum K for random walks
--weightsstr""Warm-start from this checkpoint name (no extension) in weights/

Modified DQN phase#

FlagTypeDefaultDescription
--epochs_dqnint0Number of Modified DQN epochs (0 disables the phase)
--dqn_walkersint0Walkers per DQN epoch (0 = 1/10 of the warm-up walkers)
--dqn_roundflagoffRound DQN targets to integers

Runtime#

FlagTypeDefaultDescription
--device_idint0CUDA device index (ignored on CPU)

Note the defaults differ from the published configuration: the paper uses --hd2 256 --nrd 1, so pass --nrd 1 explicitly to reproduce it.

test.py#

python test.py --group_id <id> --model_id <id> --epoch <n> [options]

What to load#

FlagTypeDefaultDescription
--group_idintrequiredGroup ID
--target_idint0Target ID
--model_idintrequiredModel ID (int(time.time()) from training; 333/444/555 for released weights)
--epochintrequiredWhich epoch’s checkpoint to load
--datasetstrrndScramble set: rnd, santa, deepcubea, deepcubeadifficult, deepcubeahard
FlagTypeDefaultDescription
--Bint2**18Beam width
--num_stepsint200Max steps per beam search run
--num_attemptsint2Number of restarts

Which scrambles#

FlagTypeDefaultDescription
--tests_numint10Number of tests to run
--shiftint0Skip this many scrambles from the start of the dataset
--skip_liststr—IDs to skip, e.g. '[2, 5]' or '2,5'

Runtime and output#

FlagTypeDefaultDescription
--device_idint0CUDA device index
--verboseint0Show a tqdm progress bar if > 0
--return_treeint0Save the beam search tree to the forest/ folder

test.py takes no architecture flags: it reads hd1, hd2 and nrd back from the training log logs/model_pXXX-tXXX_<model_id>.json and rebuilds the network from those before loading weights/pXXX-tXXX_<model_id>_e<epoch:05d>.pth. Both files must be present for a model_id to be usable.