A Multi-granularity Graph-based Representation for Image Recognition
For mnist datasets:
-
Enter directory
\MGRIR\graph\mnist
, and replace the corresponding data path -
then run
python to_h5.py
-
If you want to filter edges, the code will in the
find_boundary.py
if weight >= 0: # you can set the threshold you want ...
The same is true for cifar data (skip)
For mnist datasets:
-
Enter directory
\MGRIR
, and replace the corresponding graph path and models -
Then run
python main_train.py
. The training model files will be stored in the ”checkpoints“ folder, and the training logs will be recorded in the ”runs“ folder. -
You can run the
test.py
to take the model named--checkpoint_path
to test the accuracy of all training sets. Replace the graph path--data_dir
If you want to visualization the graph, more details can be found in find_boundary.py