This commit is contained in:
araison 2023-01-09 23:54:55 +01:00
parent f7bb1e7858
commit d0faea89db
1 changed files with 58 additions and 64 deletions

View File

@ -2,15 +2,11 @@ import glob
import os
import shutil
from explaining_framework.utils.io import read_yaml, write_yaml
from torch_geometric.data.makedirs import makedirs
from torch_geometric.graphgym.loader import create_dataset
from torch_geometric.graphgym.utils.io import string_to_python
def chunkizing_list(l, n):
return [l[i : i + n] for i in range(0, len(l), n)]
from explaining_framework.utils.io import read_yaml, write_yaml
if "__main__" == __name__:
config_folder = os.path.abspath(
@ -21,61 +17,60 @@ if "__main__" == __name__:
makedirs(explaining_folder)
explainer_folder = os.path.join(config_folder, "explaining")
makedirs(explainer_folder)
chunk = list(range(154, 160, 2))
DATASET = [
"CIFAR10",
# "TRIANGLES",
# "COLORS-3",
# "REDDIT-BINARY",
# "REDDIT-MULTI-5K",
# "REDDIT-MULTI-12K",
# "COLLAB",
# "DBLP_v1",
# "COIL-DEL",
# "COIL-RAG",
# "Fingerprint",
# "Letter-high",
# "Letter-low",
# "Letter-med",
# "MSRC_9",
# "MSRC_21",
# "MSRC_21C",
# "DD",
# "ENZYMES",
# "PROTEINS",
# "QM9",
# "MUTAG",
# "Mutagenicity",
# "AIDS",
# "PATTERN",
# "CLUSTER",
# "MNIST",
# "CIFAR10",
# "TSP",
# "CSL",
# "KarateClub",
# "CS",
# "Physics",
# "BBBP",
# "Tox21",
# "HIV",
# "PCBA",
# "MUV",
# "BACE",
# "SIDER",
# "ClinTox",
# "AIFB",
# "AM",
# "MUTAG",
# "BGS",
# "FAUST",
# "DynamicFAUST",
# "ShapeNet",
# "ModelNet10",
# "ModelNet40",
# "PascalVOC-SP",
# "COCO-SP",
"TRIANGLES",
"COLORS-3",
"REDDIT-BINARY",
"REDDIT-MULTI-5K",
"REDDIT-MULTI-12K",
"COLLAB",
"DBLP_v1",
"COIL-DEL",
"COIL-RAG",
"Fingerprint",
"Letter-high",
"Letter-low",
"Letter-med",
"MSRC_9",
"MSRC_21",
"MSRC_21C",
"DD",
"ENZYMES",
"PROTEINS",
"QM9",
"MUTAG",
"Mutagenicity",
"AIDS",
"PATTERN",
"CLUSTER",
"MNIST",
"CIFAR10",
"TSP",
"CSL",
"KarateClub",
"CS",
"Physics",
"BBBP",
"Tox21",
"HIV",
"PCBA",
"MUV",
"BACE",
"SIDER",
"ClinTox",
"AIFB",
"AM",
"MUTAG",
"BGS",
"FAUST",
"DynamicFAUST",
"ShapeNet",
"ModelNet10",
"ModelNet40",
"PascalVOC-SP",
"COCO-SP",
]
EXPLAINER = [
"CAM",
@ -100,15 +95,14 @@ if "__main__" == __name__:
explaining_cfg = {}
# explaining_cfg['adjust']['strategy']= 'rpns'
# explaining_cfg['attack']['name']= 'all'
explaining_cfg[
"cfg_dest"
] = f"dataset={dataset_name}-model={model_kind}=explainer={explainer_name}-chunk=[{chunk[0]},{chunk[-1]}]"
explaining_cfg["cfg_dest"] = string_to_python(
f"dataset={dataset_name}-model={model_kind}=explainer={explainer_name}"
)
# = f"dataset={dataset_name}-model={model_kind}=explainer={explainer_name}-chunk=[{chunk[0]},{chunk[-1]}]"
# = string_to_python(
# f"dataset={dataset_name}-model={model_kind}=explainer={explainer_name}"
explaining_cfg["dataset"] = {}
explaining_cfg["dataset"]["name"] = string_to_python(dataset_name)
explaining_cfg["dataset"]["item"] = chunk
# explaining_cfg["dataset"]["item"] = chunk
# explaining_cfg['explainer']['cfg']= 'default'
explaining_cfg["explainer"] = {}
explaining_cfg["explainer"]["name"] = string_to_python(explainer_name)
@ -120,7 +114,7 @@ if "__main__" == __name__:
explaining_cfg["model"] = {}
explaining_cfg["model"]["ckpt"] = string_to_python(model_kind)
explaining_cfg["model"]["path"] = string_to_python(
"/home/SIC/araison/test_ggym/pytorch_geometric/graphgym/results"
"/media/data/SIC/araison/exps/pyg_fork/graphgym/results/graph_classif_base_grid_graph_classif_grid"
)
# explaining_cfg['out_dir']='./explanation'
# explaining_cfg['print']='both'