├── .gitattributes ├── GOOD ├── kernel │ ├── __init__.py │ └── __pycache__ │ │ ├── train.cpython-36.pyc │ │ ├── __init__.cpython-36.pyc │ │ ├── evaluation.cpython-36.pyc │ │ └── pipeline.cpython-36.pyc ├── utils │ ├── __pycache__ │ │ ├── args.cpython-36.pyc │ │ ├── data.cpython-36.pyc │ │ ├── logger.cpython-36.pyc │ │ ├── metric.cpython-36.pyc │ │ ├── train.cpython-36.pyc │ │ ├── __init__.cpython-36.pyc │ │ ├── initial.cpython-36.pyc │ │ ├── register.cpython-36.pyc │ │ └── config_reader.cpython-36.pyc │ ├── synthetic_data │ │ ├── __pycache__ │ │ │ ├── BA3_loc.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── synthetic_structsim.cpython-36.pyc │ │ ├── __init__.py │ │ └── BA3_loc.py │ ├── __init__.py │ ├── initial.py │ ├── register.py │ └── logger.py ├── data │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── dataset_manager.cpython-36.pyc │ ├── good_datasets │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── good_hiv.cpython-36.pyc │ │ │ ├── good_arxiv.cpython-36.pyc │ │ │ ├── good_cbas.cpython-36.pyc │ │ │ ├── good_cora.cpython-36.pyc │ │ │ ├── good_motif.cpython-36.pyc │ │ │ ├── good_pcba.cpython-36.pyc │ │ │ ├── good_zinc.cpython-36.pyc │ │ │ ├── orig_zinc.cpython-36.pyc │ │ │ └── good_cmnist.cpython-36.pyc │ │ └── __init__.py │ └── __init__.py ├── networks │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── model_manager.cpython-36.pyc │ ├── models │ │ ├── __pycache__ │ │ │ ├── DANNs.cpython-36.pyc │ │ │ ├── GCNs.cpython-36.pyc │ │ │ ├── GINs.cpython-36.pyc │ │ │ ├── BaseGNN.cpython-36.pyc │ │ │ ├── CoralNN.cpython-36.pyc │ │ │ ├── DANNGCNs.cpython-36.pyc │ │ │ ├── MixupGNN.cpython-36.pyc │ │ │ ├── Pooling.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── Classifiers.cpython-36.pyc │ │ │ ├── CoralGCNs.cpython-36.pyc │ │ │ ├── MixupGCNs.cpython-36.pyc │ │ │ ├── MolEncoders.cpython-36.pyc │ │ │ └── GINvirtualnode.cpython-36.pyc │ │ ├── __init__.py │ │ ├── Classifiers.py │ │ ├── CoralGCNs.py │ │ └── MolEncoders.py │ └── __init__.py ├── ood_algorithms │ ├── __init__.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── ood_manager.cpython-36.pyc │ ├── algorithms │ │ ├── __pycache__ │ │ │ ├── ERM.cpython-36.pyc │ │ │ ├── IRM.cpython-36.pyc │ │ │ ├── Coral.cpython-36.pyc │ │ │ ├── DANN.cpython-36.pyc │ │ │ ├── Mixup.cpython-36.pyc │ │ │ ├── VREx.cpython-36.pyc │ │ │ ├── BaseOOD.cpython-36.pyc │ │ │ ├── GroupDRO.cpython-36.pyc │ │ │ └── __init__.cpython-36.pyc │ │ ├── __init__.py │ │ ├── ERM.py │ │ ├── VREx.py │ │ └── GroupDRO.py │ └── ood_manager.py ├── __init__.py └── definitions.py ├── CMNIST ├── GOOD │ ├── kernel │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── pipeline.cpython-36.pyc │ │ │ └── evaluation.cpython-36.pyc │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── definitions.cpython-36.pyc │ ├── utils │ │ ├── __pycache__ │ │ │ ├── args.cpython-36.pyc │ │ │ ├── data.cpython-36.pyc │ │ │ ├── logger.cpython-36.pyc │ │ │ ├── metric.cpython-36.pyc │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── initial.cpython-36.pyc │ │ │ ├── register.cpython-36.pyc │ │ │ └── config_reader.cpython-36.pyc │ │ ├── synthetic_data │ │ │ ├── __pycache__ │ │ │ │ ├── BA3_loc.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── synthetic_structsim.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ └── BA3_loc.py │ │ ├── __init__.py │ │ ├── initial.py │ │ ├── register.py │ │ └── logger.py │ ├── data │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── dataset_manager.cpython-36.pyc │ │ ├── good_datasets │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── good_hiv.cpython-36.pyc │ │ │ │ ├── good_arxiv.cpython-36.pyc │ │ │ │ ├── good_cbas.cpython-36.pyc │ │ │ │ ├── good_cmnist.cpython-36.pyc │ │ │ │ ├── good_cora.cpython-36.pyc │ │ │ │ ├── good_motif.cpython-36.pyc │ │ │ │ ├── good_pcba.cpython-36.pyc │ │ │ │ ├── good_zinc.cpython-36.pyc │ │ │ │ └── orig_zinc.cpython-36.pyc │ │ │ └── __init__.py │ │ └── __init__.py │ ├── ood_algorithms │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── ood_manager.cpython-36.pyc │ │ ├── algorithms │ │ │ ├── __pycache__ │ │ │ │ ├── DANN.cpython-36.pyc │ │ │ │ ├── ERM.cpython-36.pyc │ │ │ │ ├── IRM.cpython-36.pyc │ │ │ │ ├── VREx.cpython-36.pyc │ │ │ │ ├── Coral.cpython-36.pyc │ │ │ │ ├── Mixup.cpython-36.pyc │ │ │ │ ├── BaseOOD.cpython-36.pyc │ │ │ │ ├── GroupDRO.cpython-36.pyc │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── ERM.py │ │ │ ├── VREx.py │ │ │ └── GroupDRO.py │ │ └── ood_manager.py │ ├── networks │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── model_manager.cpython-36.pyc │ │ ├── models │ │ │ ├── __pycache__ │ │ │ │ ├── GCNs.cpython-36.pyc │ │ │ │ ├── GINs.cpython-36.pyc │ │ │ │ ├── DANNs.cpython-36.pyc │ │ │ │ ├── BaseGNN.cpython-36.pyc │ │ │ │ ├── CoralGCNs.cpython-36.pyc │ │ │ │ ├── CoralNN.cpython-36.pyc │ │ │ │ ├── DANNGCNs.cpython-36.pyc │ │ │ │ ├── MixupGCNs.cpython-36.pyc │ │ │ │ ├── MixupGNN.cpython-36.pyc │ │ │ │ ├── Pooling.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── Classifiers.cpython-36.pyc │ │ │ │ ├── MolEncoders.cpython-36.pyc │ │ │ │ └── GINvirtualnode.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── Classifiers.py │ │ │ ├── CoralGCNs.py │ │ │ └── MolEncoders.py │ │ └── __init__.py │ ├── __init__.py │ └── definitions.py └── MolEncoders.py ├── Molbbbp ├── GOOD │ ├── kernel │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── pipeline.cpython-36.pyc │ │ │ └── evaluation.cpython-36.pyc │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── definitions.cpython-36.pyc │ ├── utils │ │ ├── __pycache__ │ │ │ ├── args.cpython-36.pyc │ │ │ ├── data.cpython-36.pyc │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── initial.cpython-36.pyc │ │ │ ├── logger.cpython-36.pyc │ │ │ ├── metric.cpython-36.pyc │ │ │ ├── register.cpython-36.pyc │ │ │ └── config_reader.cpython-36.pyc │ │ ├── synthetic_data │ │ │ ├── __pycache__ │ │ │ │ ├── BA3_loc.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── synthetic_structsim.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ └── BA3_loc.py │ │ ├── __init__.py │ │ ├── initial.py │ │ ├── register.py │ │ └── logger.py │ ├── data │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── dataset_manager.cpython-36.pyc │ │ ├── good_datasets │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── good_arxiv.cpython-36.pyc │ │ │ │ ├── good_cbas.cpython-36.pyc │ │ │ │ ├── good_cora.cpython-36.pyc │ │ │ │ ├── good_hiv.cpython-36.pyc │ │ │ │ ├── good_motif.cpython-36.pyc │ │ │ │ ├── good_pcba.cpython-36.pyc │ │ │ │ ├── good_zinc.cpython-36.pyc │ │ │ │ ├── orig_zinc.cpython-36.pyc │ │ │ │ └── good_cmnist.cpython-36.pyc │ │ │ └── __init__.py │ │ └── __init__.py │ ├── ood_algorithms │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── ood_manager.cpython-36.pyc │ │ ├── algorithms │ │ │ ├── __pycache__ │ │ │ │ ├── ERM.cpython-36.pyc │ │ │ │ ├── IRM.cpython-36.pyc │ │ │ │ ├── Coral.cpython-36.pyc │ │ │ │ ├── DANN.cpython-36.pyc │ │ │ │ ├── Mixup.cpython-36.pyc │ │ │ │ ├── VREx.cpython-36.pyc │ │ │ │ ├── BaseOOD.cpython-36.pyc │ │ │ │ ├── GroupDRO.cpython-36.pyc │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── ERM.py │ │ │ ├── VREx.py │ │ │ └── GroupDRO.py │ │ └── ood_manager.py │ ├── __init__.py │ ├── networks │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── model_manager.cpython-36.pyc │ │ ├── models │ │ │ ├── __pycache__ │ │ │ │ ├── DANNs.cpython-36.pyc │ │ │ │ ├── GCNs.cpython-36.pyc │ │ │ │ ├── GINs.cpython-36.pyc │ │ │ │ ├── BaseGNN.cpython-36.pyc │ │ │ │ ├── CoralNN.cpython-36.pyc │ │ │ │ ├── DANNGCNs.cpython-36.pyc │ │ │ │ ├── MixupGNN.cpython-36.pyc │ │ │ │ ├── Pooling.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── CoralGCNs.cpython-36.pyc │ │ │ │ ├── MixupGCNs.cpython-36.pyc │ │ │ │ ├── Classifiers.cpython-36.pyc │ │ │ │ ├── MolEncoders.cpython-36.pyc │ │ │ │ └── GINvirtualnode.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── Classifiers.py │ │ │ ├── CoralGCNs.py │ │ │ └── MolEncoders.py │ │ └── __init__.py │ └── definitions.py └── MolEncoders.py ├── Molhiv ├── GOOD │ ├── kernel │ │ ├── __init__.py │ │ └── pipeline.py │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── definitions.cpython-36.pyc │ ├── utils │ │ ├── __pycache__ │ │ │ ├── args.cpython-36.pyc │ │ │ ├── data.cpython-36.pyc │ │ │ ├── logger.cpython-36.pyc │ │ │ ├── metric.cpython-36.pyc │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── register.cpython-36.pyc │ │ │ └── config_reader.cpython-36.pyc │ │ ├── synthetic_data │ │ │ ├── __pycache__ │ │ │ │ ├── BA3_loc.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── synthetic_structsim.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ └── BA3_loc.py │ │ ├── __init__.py │ │ ├── initial.py │ │ ├── register.py │ │ └── logger.py │ ├── data │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── dataset_manager.cpython-36.pyc │ │ ├── good_datasets │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── good_hiv.cpython-36.pyc │ │ │ │ ├── good_arxiv.cpython-36.pyc │ │ │ │ ├── good_cbas.cpython-36.pyc │ │ │ │ ├── good_cmnist.cpython-36.pyc │ │ │ │ ├── good_cora.cpython-36.pyc │ │ │ │ ├── good_motif.cpython-36.pyc │ │ │ │ ├── good_pcba.cpython-36.pyc │ │ │ │ ├── good_zinc.cpython-36.pyc │ │ │ │ └── orig_zinc.cpython-36.pyc │ │ │ └── __init__.py │ │ └── __init__.py │ ├── ood_algorithms │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ └── __init__.cpython-36.pyc │ │ ├── algorithms │ │ │ ├── __pycache__ │ │ │ │ ├── DANN.cpython-36.pyc │ │ │ │ ├── ERM.cpython-36.pyc │ │ │ │ ├── IRM.cpython-36.pyc │ │ │ │ ├── VREx.cpython-36.pyc │ │ │ │ ├── Coral.cpython-36.pyc │ │ │ │ ├── Mixup.cpython-36.pyc │ │ │ │ ├── BaseOOD.cpython-36.pyc │ │ │ │ ├── GroupDRO.cpython-36.pyc │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── ERM.py │ │ │ ├── VREx.py │ │ │ └── GroupDRO.py │ │ └── ood_manager.py │ ├── networks │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── model_manager.cpython-36.pyc │ │ ├── models │ │ │ ├── __pycache__ │ │ │ │ ├── GCNs.cpython-36.pyc │ │ │ │ ├── GINs.cpython-36.pyc │ │ │ │ ├── DANNs.cpython-36.pyc │ │ │ │ ├── BaseGNN.cpython-36.pyc │ │ │ │ ├── CoralGCNs.cpython-36.pyc │ │ │ │ ├── CoralNN.cpython-36.pyc │ │ │ │ ├── DANNGCNs.cpython-36.pyc │ │ │ │ ├── MixupGCNs.cpython-36.pyc │ │ │ │ ├── MixupGNN.cpython-36.pyc │ │ │ │ ├── Pooling.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── Classifiers.cpython-36.pyc │ │ │ │ ├── MolEncoders.cpython-36.pyc │ │ │ │ └── GINvirtualnode.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── Classifiers.py │ │ │ ├── CoralGCNs.py │ │ │ └── MolEncoders.py │ │ └── __init__.py │ ├── __init__.py │ └── definitions.py └── MolEncoders.py ├── Motif ├── GOOD │ ├── __pycache__ │ │ ├── __init__.cpython-36.pyc │ │ └── definitions.cpython-36.pyc │ ├── kernel │ │ ├── __init__.py │ │ └── __pycache__ │ │ │ ├── train.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── pipeline.cpython-36.pyc │ │ │ └── evaluation.cpython-36.pyc │ ├── utils │ │ ├── __pycache__ │ │ │ ├── args.cpython-36.pyc │ │ │ ├── data.cpython-36.pyc │ │ │ ├── train.cpython-36.pyc │ │ │ ├── initial.cpython-36.pyc │ │ │ ├── logger.cpython-36.pyc │ │ │ ├── metric.cpython-36.pyc │ │ │ ├── __init__.cpython-36.pyc │ │ │ ├── register.cpython-36.pyc │ │ │ └── config_reader.cpython-36.pyc │ │ ├── synthetic_data │ │ │ ├── __pycache__ │ │ │ │ ├── BA3_loc.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ └── synthetic_structsim.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ └── BA3_loc.py │ │ ├── __init__.py │ │ ├── initial.py │ │ ├── register.py │ │ └── logger.py │ ├── data │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── dataset_manager.cpython-36.pyc │ │ ├── good_datasets │ │ │ ├── __pycache__ │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── good_cbas.cpython-36.pyc │ │ │ │ ├── good_cora.cpython-36.pyc │ │ │ │ ├── good_hiv.cpython-36.pyc │ │ │ │ ├── good_pcba.cpython-36.pyc │ │ │ │ ├── good_zinc.cpython-36.pyc │ │ │ │ ├── orig_zinc.cpython-36.pyc │ │ │ │ ├── good_arxiv.cpython-36.pyc │ │ │ │ ├── good_cmnist.cpython-36.pyc │ │ │ │ └── good_motif.cpython-36.pyc │ │ │ └── __init__.py │ │ └── __init__.py │ ├── ood_algorithms │ │ ├── __init__.py │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── ood_manager.cpython-36.pyc │ │ ├── algorithms │ │ │ ├── __pycache__ │ │ │ │ ├── Coral.cpython-36.pyc │ │ │ │ ├── DANN.cpython-36.pyc │ │ │ │ ├── ERM.cpython-36.pyc │ │ │ │ ├── IRM.cpython-36.pyc │ │ │ │ ├── Mixup.cpython-36.pyc │ │ │ │ ├── VREx.cpython-36.pyc │ │ │ │ ├── BaseOOD.cpython-36.pyc │ │ │ │ ├── GroupDRO.cpython-36.pyc │ │ │ │ └── __init__.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── ERM.py │ │ │ ├── VREx.py │ │ │ └── GroupDRO.py │ │ └── ood_manager.py │ ├── networks │ │ ├── __pycache__ │ │ │ ├── __init__.cpython-36.pyc │ │ │ └── model_manager.cpython-36.pyc │ │ ├── models │ │ │ ├── __pycache__ │ │ │ │ ├── DANNs.cpython-36.pyc │ │ │ │ ├── GCNs.cpython-36.pyc │ │ │ │ ├── GINs.cpython-36.pyc │ │ │ │ ├── BaseGNN.cpython-36.pyc │ │ │ │ ├── CoralNN.cpython-36.pyc │ │ │ │ ├── Pooling.cpython-36.pyc │ │ │ │ ├── CoralGCNs.cpython-36.pyc │ │ │ │ ├── DANNGCNs.cpython-36.pyc │ │ │ │ ├── MixupGCNs.cpython-36.pyc │ │ │ │ ├── MixupGNN.cpython-36.pyc │ │ │ │ ├── __init__.cpython-36.pyc │ │ │ │ ├── Classifiers.cpython-36.pyc │ │ │ │ ├── MolEncoders.cpython-36.pyc │ │ │ │ └── GINvirtualnode.cpython-36.pyc │ │ │ ├── __init__.py │ │ │ ├── Classifiers.py │ │ │ ├── CoralGCNs.py │ │ │ └── MolEncoders.py │ │ └── __init__.py │ ├── __init__.py │ └── definitions.py └── MolEncoders.py ├── MolEncoders.py └── utils.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /GOOD/kernel/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains project kernel configuring, training, testing, and evaluation pipelines. 3 | """ -------------------------------------------------------------------------------- /GOOD/kernel/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/kernel/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/args.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/args.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/data.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/data.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/metric.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/metric.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/kernel/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains project kernel configuring, training, testing, and evaluation pipelines. 3 | """ -------------------------------------------------------------------------------- /GOOD/data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/initial.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/register.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/register.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/kernel/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains project kernel configuring, training, testing, and evaluation pipelines. 3 | """ -------------------------------------------------------------------------------- /Molhiv/GOOD/kernel/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains project kernel configuring, training, testing, and evaluation pipelines. 3 | """ -------------------------------------------------------------------------------- /Motif/GOOD/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/kernel/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains project kernel configuring, training, testing, and evaluation pipelines. 3 | """ -------------------------------------------------------------------------------- /CMNIST/GOOD/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/args.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/args.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/data.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/data.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/kernel/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/kernel/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/kernel/__pycache__/evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/kernel/__pycache__/pipeline.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/args.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/args.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/data.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/data.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/__pycache__/definitions.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/__pycache__/definitions.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/args.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/args.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/data.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/data.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/__pycache__/definitions.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/__pycache__/definitions.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/kernel/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/kernel/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/metric.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/metric.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is comprised by 7 OOD algorithms and their loader. 3 | """ 4 | 5 | from .algorithms import * 6 | -------------------------------------------------------------------------------- /GOOD/utils/__pycache__/config_reader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/__pycache__/config_reader.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/__pycache__/definitions.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/__pycache__/definitions.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/args.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/args.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/data.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/data.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/__pycache__/definitions.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/__pycache__/definitions.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/metric.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/metric.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/kernel/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/kernel/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/initial.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/metric.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/metric.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/kernel/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/kernel/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is comprised by 7 OOD algorithms and their loader. 3 | """ 4 | 5 | from .algorithms import * 6 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/initial.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/register.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/register.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import config_summoner, args_parser 2 | from .utils.register import register 3 | from . import data, networks, ood_algorithms 4 | -------------------------------------------------------------------------------- /GOOD/data/__pycache__/dataset_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/__pycache__/model_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/__pycache__/model_manager.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/GINs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/kernel/__pycache__/train.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/kernel/__pycache__/train.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is comprised by 7 OOD algorithms and their loader. 3 | """ 4 | 5 | from .algorithms import * 6 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/initial.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/initial.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/logger.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/logger.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/metric.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/metric.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/register.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/register.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is comprised by 7 OOD algorithms and their loader. 3 | """ 4 | 5 | from .algorithms import * 6 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/register.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/register.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/kernel/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/kernel/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is comprised by 7 OOD algorithms and their loader. 3 | """ 4 | 5 | from .algorithms import * 6 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/register.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/register.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/kernel/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/kernel/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/kernel/__pycache__/pipeline.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import config_summoner, args_parser 2 | from .utils.register import register 3 | from . import data, networks, ood_algorithms 4 | -------------------------------------------------------------------------------- /CMNIST/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__pycache__/config_reader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/__pycache__/config_reader.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import config_summoner, args_parser 2 | from .utils.register import register 3 | from . import data, networks, ood_algorithms 4 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/kernel/__pycache__/evaluation.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__pycache__/config_reader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/__pycache__/config_reader.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import config_summoner, args_parser 2 | from .utils.register import register 3 | from . import data, networks, ood_algorithms 4 | -------------------------------------------------------------------------------- /Molhiv/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__pycache__/config_reader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/__pycache__/config_reader.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/__init__.py: -------------------------------------------------------------------------------- 1 | from .utils import config_summoner, args_parser 2 | from .utils.register import register 3 | from . import data, networks, ood_algorithms 4 | -------------------------------------------------------------------------------- /Motif/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/__pycache__/config_reader.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/__pycache__/config_reader.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/__pycache__/model_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/__pycache__/model_manager.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/__pycache__/dataset_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/GCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/GINs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/__pycache__/model_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/__pycache__/model_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/DANNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/__pycache__/model_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/__pycache__/model_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/__pycache__/model_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/__pycache__/model_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/BaseGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/CoralNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/Pooling.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/DANNGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/MixupGNN.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/CoralGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/MixupGCNs.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/__pycache__/ood_manager.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_hiv.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/Classifiers.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/MolEncoders.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_cbas.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_cora.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_pcba.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/good_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/data/good_datasets/__pycache__/orig_zinc.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/synthetic_data/__pycache__/BA3_loc.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_arxiv.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/data/good_datasets/__pycache__/good_motif.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/ERM.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/IRM.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/synthetic_data/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/networks/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | A module that design GNN structures and manage GNN loadings. 3 | """ 4 | from .model_manager import load_model, config_model 5 | from .models import * 6 | -------------------------------------------------------------------------------- /GOOD/utils/synthetic_data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Utilities for generating certain graph shapes. 3 | 4 | Copied from `gnn-model-explainer `_ 5 | """ -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/data/good_datasets/__pycache__/good_cmnist.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/networks/models/__pycache__/GINvirtualnode.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/DANN.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/VREx.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/Coral.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/Mixup.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | A module that design GNN structures and manage GNN loadings. 3 | """ 4 | from .model_manager import load_model, config_model 5 | from .models import * 6 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | A module that design GNN structures and manage GNN loadings. 3 | """ 4 | from .model_manager import load_model, config_model 5 | from .models import * 6 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | A module that design GNN structures and manage GNN loadings. 3 | """ 4 | from .model_manager import load_model, config_model 5 | from .models import * 6 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/BaseOOD.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/networks/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | A module that design GNN structures and manage GNN loadings. 3 | """ 4 | from .model_manager import load_model, config_model 5 | from .models import * 6 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/GroupDRO.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/ood_algorithms/algorithms/__pycache__/__init__.cpython-36.pyc -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/synthetic_data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Utilities for generating certain graph shapes. 3 | 4 | Copied from `gnn-model-explainer `_ 5 | """ -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/synthetic_data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Utilities for generating certain graph shapes. 3 | 4 | Copied from `gnn-model-explainer `_ 5 | """ -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/synthetic_data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Utilities for generating certain graph shapes. 3 | 4 | Copied from `gnn-model-explainer `_ 5 | """ -------------------------------------------------------------------------------- /Motif/GOOD/utils/synthetic_data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Utilities for generating certain graph shapes. 3 | 4 | Copied from `gnn-model-explainer `_ 5 | """ -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/CMNIST/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molhiv/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc -------------------------------------------------------------------------------- /Motif/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Motif/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongduosui/AIA/HEAD/Molbbbp/GOOD/utils/synthetic_data/__pycache__/synthetic_structsim.cpython-36.pyc -------------------------------------------------------------------------------- /GOOD/data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This data module includes 8 GOOD datasets and a dataloader for an organized data loading process. 3 | """ 4 | from GOOD.data.dataset_manager import load_dataset, create_dataloader 5 | from .good_datasets import * 6 | -------------------------------------------------------------------------------- /Motif/GOOD/data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This data module includes 8 GOOD datasets and a dataloader for an organized data loading process. 3 | """ 4 | from GOOD.data.dataset_manager import load_dataset, create_dataloader 5 | from .good_datasets import * 6 | -------------------------------------------------------------------------------- /CMNIST/GOOD/data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This data module includes 8 GOOD datasets and a dataloader for an organized data loading process. 3 | """ 4 | from GOOD.data.dataset_manager import load_dataset, create_dataloader 5 | from .good_datasets import * 6 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This data module includes 8 GOOD datasets and a dataloader for an organized data loading process. 3 | """ 4 | from GOOD.data.dataset_manager import load_dataset, create_dataloader 5 | from .good_datasets import * 6 | -------------------------------------------------------------------------------- /Molhiv/GOOD/data/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This data module includes 8 GOOD datasets and a dataloader for an organized data loading process. 3 | """ 4 | from GOOD.data.dataset_manager import load_dataset, create_dataloader 5 | from .good_datasets import * 6 | -------------------------------------------------------------------------------- /GOOD/utils/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains various utilities, such as a component register, an argument parser, a configuration reader, and 3 | a metric object. 4 | """ 5 | from .config_reader import config_summoner 6 | from .args import args_parser 7 | from .logger import load_logger 8 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains various utilities, such as a component register, an argument parser, a configuration reader, and 3 | a metric object. 4 | """ 5 | from .config_reader import config_summoner 6 | from .args import args_parser 7 | from .logger import load_logger 8 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains various utilities, such as a component register, an argument parser, a configuration reader, and 3 | a metric object. 4 | """ 5 | from .config_reader import config_summoner 6 | from .args import args_parser 7 | from .logger import load_logger 8 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains various utilities, such as a component register, an argument parser, a configuration reader, and 3 | a metric object. 4 | """ 5 | from .config_reader import config_summoner 6 | from .args import args_parser 7 | from .logger import load_logger 8 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module contains various utilities, such as a component register, an argument parser, a configuration reader, and 3 | a metric object. 4 | """ 5 | from .config_reader import config_summoner 6 | from .args import args_parser 7 | from .logger import load_logger 8 | -------------------------------------------------------------------------------- /GOOD/definitions.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Only for project usage. This module includes a preset project root and a storage root. 3 | """ 4 | import os 5 | 6 | # root outside the GOOD 7 | STORAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'storage') #: :str - Storage root=/storage/. 8 | ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) #: str - Project root or Repo root. 9 | -------------------------------------------------------------------------------- /CMNIST/GOOD/definitions.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Only for project usage. This module includes a preset project root and a storage root. 3 | """ 4 | import os 5 | 6 | # root outside the GOOD 7 | STORAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'storage') #: :str - Storage root=/storage/. 8 | ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) #: str - Project root or Repo root. 9 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/definitions.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Only for project usage. This module includes a preset project root and a storage root. 3 | """ 4 | import os 5 | 6 | # root outside the GOOD 7 | STORAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'storage') #: :str - Storage root=/storage/. 8 | ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) #: str - Project root or Repo root. 9 | -------------------------------------------------------------------------------- /Molhiv/GOOD/definitions.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Only for project usage. This module includes a preset project root and a storage root. 3 | """ 4 | import os 5 | 6 | # root outside the GOOD 7 | STORAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'storage') #: :str - Storage root=/storage/. 8 | ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) #: str - Project root or Repo root. 9 | -------------------------------------------------------------------------------- /Motif/GOOD/definitions.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Only for project usage. This module includes a preset project root and a storage root. 3 | """ 4 | import os 5 | 6 | # root outside the GOOD 7 | STORAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), 'storage') #: :str - Storage root=/storage/. 8 | ROOT_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) #: str - Project root or Repo root. 9 | -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is for OOD algorithms. It is a good idea to inherit the BaseOOD class for new OOD algorithm designs. 3 | """ 4 | 5 | import glob 6 | from os.path import dirname, basename, isfile, join 7 | 8 | modules = glob.glob(join(dirname(__file__), "*.py")) 9 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 10 | 11 | from . import * 12 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is for OOD algorithms. It is a good idea to inherit the BaseOOD class for new OOD algorithm designs. 3 | """ 4 | 5 | import glob 6 | from os.path import dirname, basename, isfile, join 7 | 8 | modules = glob.glob(join(dirname(__file__), "*.py")) 9 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 10 | 11 | from . import * 12 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is for OOD algorithms. It is a good idea to inherit the BaseOOD class for new OOD algorithm designs. 3 | """ 4 | 5 | import glob 6 | from os.path import dirname, basename, isfile, join 7 | 8 | modules = glob.glob(join(dirname(__file__), "*.py")) 9 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 10 | 11 | from . import * 12 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is for OOD algorithms. It is a good idea to inherit the BaseOOD class for new OOD algorithm designs. 3 | """ 4 | 5 | import glob 6 | from os.path import dirname, basename, isfile, join 7 | 8 | modules = glob.glob(join(dirname(__file__), "*.py")) 9 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 10 | 11 | from . import * 12 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module is for OOD algorithms. It is a good idea to inherit the BaseOOD class for new OOD algorithm designs. 3 | """ 4 | 5 | import glob 6 | from os.path import dirname, basename, isfile, join 7 | 8 | modules = glob.glob(join(dirname(__file__), "*.py")) 9 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 10 | 11 | from . import * 12 | -------------------------------------------------------------------------------- /GOOD/networks/models/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes GNNs used in our leaderboard. It includes: GINs, GINvirtualnodes, and GCNs, in which GCNs are only 3 | for node classifications. 4 | """ 5 | 6 | import glob 7 | from os.path import dirname, basename, isfile, join 8 | 9 | modules = glob.glob(join(dirname(__file__), "*.py")) 10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 11 | 12 | from . import * 13 | -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes GNNs used in our leaderboard. It includes: GINs, GINvirtualnodes, and GCNs, in which GCNs are only 3 | for node classifications. 4 | """ 5 | 6 | import glob 7 | from os.path import dirname, basename, isfile, join 8 | 9 | modules = glob.glob(join(dirname(__file__), "*.py")) 10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 11 | 12 | from . import * 13 | -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes GNNs used in our leaderboard. It includes: GINs, GINvirtualnodes, and GCNs, in which GCNs are only 3 | for node classifications. 4 | """ 5 | 6 | import glob 7 | from os.path import dirname, basename, isfile, join 8 | 9 | modules = glob.glob(join(dirname(__file__), "*.py")) 10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 11 | 12 | from . import * 13 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes GNNs used in our leaderboard. It includes: GINs, GINvirtualnodes, and GCNs, in which GCNs are only 3 | for node classifications. 4 | """ 5 | 6 | import glob 7 | from os.path import dirname, basename, isfile, join 8 | 9 | modules = glob.glob(join(dirname(__file__), "*.py")) 10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 11 | 12 | from . import * 13 | -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes GNNs used in our leaderboard. It includes: GINs, GINvirtualnodes, and GCNs, in which GCNs are only 3 | for node classifications. 4 | """ 5 | 6 | import glob 7 | from os.path import dirname, basename, isfile, join 8 | 9 | modules = glob.glob(join(dirname(__file__), "*.py")) 10 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 11 | 12 | from . import * 13 | -------------------------------------------------------------------------------- /GOOD/data/good_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes 8 GOOD datasets. 3 | 4 | - Graph prediction datasets: GOOD-HIV, GOOD-PCBA, GOOD-ZINC, GOOD-CMNIST, GOOD-Motif. 5 | - Node prediction datasets: GOOD-Cora, GOOD-Arxiv, GOOD-CBAS. 6 | """ 7 | 8 | import glob 9 | from os.path import dirname, basename, isfile, join 10 | 11 | modules = glob.glob(join(dirname(__file__), "*.py")) 12 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 13 | 14 | from . import * 15 | 16 | -------------------------------------------------------------------------------- /Motif/GOOD/data/good_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes 8 GOOD datasets. 3 | 4 | - Graph prediction datasets: GOOD-HIV, GOOD-PCBA, GOOD-ZINC, GOOD-CMNIST, GOOD-Motif. 5 | - Node prediction datasets: GOOD-Cora, GOOD-Arxiv, GOOD-CBAS. 6 | """ 7 | 8 | import glob 9 | from os.path import dirname, basename, isfile, join 10 | 11 | modules = glob.glob(join(dirname(__file__), "*.py")) 12 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 13 | 14 | from . import * 15 | 16 | -------------------------------------------------------------------------------- /CMNIST/GOOD/data/good_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes 8 GOOD datasets. 3 | 4 | - Graph prediction datasets: GOOD-HIV, GOOD-PCBA, GOOD-ZINC, GOOD-CMNIST, GOOD-Motif. 5 | - Node prediction datasets: GOOD-Cora, GOOD-Arxiv, GOOD-CBAS. 6 | """ 7 | 8 | import glob 9 | from os.path import dirname, basename, isfile, join 10 | 11 | modules = glob.glob(join(dirname(__file__), "*.py")) 12 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 13 | 14 | from . import * 15 | 16 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/data/good_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes 8 GOOD datasets. 3 | 4 | - Graph prediction datasets: GOOD-HIV, GOOD-PCBA, GOOD-ZINC, GOOD-CMNIST, GOOD-Motif. 5 | - Node prediction datasets: GOOD-Cora, GOOD-Arxiv, GOOD-CBAS. 6 | """ 7 | 8 | import glob 9 | from os.path import dirname, basename, isfile, join 10 | 11 | modules = glob.glob(join(dirname(__file__), "*.py")) 12 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 13 | 14 | from . import * 15 | 16 | -------------------------------------------------------------------------------- /Molhiv/GOOD/data/good_datasets/__init__.py: -------------------------------------------------------------------------------- 1 | r""" 2 | This module includes 8 GOOD datasets. 3 | 4 | - Graph prediction datasets: GOOD-HIV, GOOD-PCBA, GOOD-ZINC, GOOD-CMNIST, GOOD-Motif. 5 | - Node prediction datasets: GOOD-Cora, GOOD-Arxiv, GOOD-CBAS. 6 | """ 7 | 8 | import glob 9 | from os.path import dirname, basename, isfile, join 10 | 11 | modules = glob.glob(join(dirname(__file__), "*.py")) 12 | __all__ = [basename(f)[:-3] for f in modules if isfile(f) and not f.endswith('__init__.py')] 13 | 14 | from . import * 15 | 16 | -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/ERM.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the baseline ERM 3 | """ 4 | from GOOD import register 5 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 6 | from .BaseOOD import BaseOODAlg 7 | 8 | 9 | @register.ood_alg_register 10 | class ERM(BaseOODAlg): 11 | r""" 12 | Implementation of the baseline ERM 13 | 14 | Args: 15 | config (Union[CommonArgs, Munch]): munchified dictionary of args 16 | """ 17 | def __init__(self, config: Union[CommonArgs, Munch]): 18 | super(ERM, self).__init__(config) 19 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/ERM.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the baseline ERM 3 | """ 4 | from GOOD import register 5 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 6 | from .BaseOOD import BaseOODAlg 7 | 8 | 9 | @register.ood_alg_register 10 | class ERM(BaseOODAlg): 11 | r""" 12 | Implementation of the baseline ERM 13 | 14 | Args: 15 | config (Union[CommonArgs, Munch]): munchified dictionary of args 16 | """ 17 | def __init__(self, config: Union[CommonArgs, Munch]): 18 | super(ERM, self).__init__(config) 19 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/ERM.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the baseline ERM 3 | """ 4 | from GOOD import register 5 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 6 | from .BaseOOD import BaseOODAlg 7 | 8 | 9 | @register.ood_alg_register 10 | class ERM(BaseOODAlg): 11 | r""" 12 | Implementation of the baseline ERM 13 | 14 | Args: 15 | config (Union[CommonArgs, Munch]): munchified dictionary of args 16 | """ 17 | def __init__(self, config: Union[CommonArgs, Munch]): 18 | super(ERM, self).__init__(config) 19 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/ERM.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the baseline ERM 3 | """ 4 | from GOOD import register 5 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 6 | from .BaseOOD import BaseOODAlg 7 | 8 | 9 | @register.ood_alg_register 10 | class ERM(BaseOODAlg): 11 | r""" 12 | Implementation of the baseline ERM 13 | 14 | Args: 15 | config (Union[CommonArgs, Munch]): munchified dictionary of args 16 | """ 17 | def __init__(self, config: Union[CommonArgs, Munch]): 18 | super(ERM, self).__init__(config) 19 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/ERM.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the baseline ERM 3 | """ 4 | from GOOD import register 5 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 6 | from .BaseOOD import BaseOODAlg 7 | 8 | 9 | @register.ood_alg_register 10 | class ERM(BaseOODAlg): 11 | r""" 12 | Implementation of the baseline ERM 13 | 14 | Args: 15 | config (Union[CommonArgs, Munch]): munchified dictionary of args 16 | """ 17 | def __init__(self, config: Union[CommonArgs, Munch]): 18 | super(ERM, self).__init__(config) 19 | -------------------------------------------------------------------------------- /GOOD/ood_algorithms/ood_manager.py: -------------------------------------------------------------------------------- 1 | """A module that is consist of an OOD algorithm loader. 2 | """ 3 | 4 | from GOOD import register 5 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 6 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 7 | 8 | 9 | def load_ood_alg(name, config: Union[CommonArgs, Munch]): 10 | r""" 11 | OOD algorithm loader. 12 | Args: 13 | name: Name of the chosen OOD algorithm. 14 | config: please refer to specific algorithms for required configs. 15 | 16 | Returns: 17 | An OOD algorithm object. 18 | 19 | """ 20 | try: 21 | ood_algorithm: BaseOODAlg = register.ood_algs[name](config) 22 | except KeyError as e: 23 | print(f'#E#OOD algorithm of given name does not exist.') 24 | raise e 25 | return ood_algorithm 26 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/ood_manager.py: -------------------------------------------------------------------------------- 1 | """A module that is consist of an OOD algorithm loader. 2 | """ 3 | 4 | from GOOD import register 5 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 6 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 7 | 8 | 9 | def load_ood_alg(name, config: Union[CommonArgs, Munch]): 10 | r""" 11 | OOD algorithm loader. 12 | Args: 13 | name: Name of the chosen OOD algorithm. 14 | config: please refer to specific algorithms for required configs. 15 | 16 | Returns: 17 | An OOD algorithm object. 18 | 19 | """ 20 | try: 21 | ood_algorithm: BaseOODAlg = register.ood_algs[name](config) 22 | except KeyError as e: 23 | print(f'#E#OOD algorithm of given name does not exist.') 24 | raise e 25 | return ood_algorithm 26 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/ood_manager.py: -------------------------------------------------------------------------------- 1 | """A module that is consist of an OOD algorithm loader. 2 | """ 3 | 4 | from GOOD import register 5 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 6 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 7 | 8 | 9 | def load_ood_alg(name, config: Union[CommonArgs, Munch]): 10 | r""" 11 | OOD algorithm loader. 12 | Args: 13 | name: Name of the chosen OOD algorithm. 14 | config: please refer to specific algorithms for required configs. 15 | 16 | Returns: 17 | An OOD algorithm object. 18 | 19 | """ 20 | try: 21 | ood_algorithm: BaseOODAlg = register.ood_algs[name](config) 22 | except KeyError as e: 23 | print(f'#E#OOD algorithm of given name does not exist.') 24 | raise e 25 | return ood_algorithm 26 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/ood_manager.py: -------------------------------------------------------------------------------- 1 | """A module that is consist of an OOD algorithm loader. 2 | """ 3 | 4 | from GOOD import register 5 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 6 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 7 | 8 | 9 | def load_ood_alg(name, config: Union[CommonArgs, Munch]): 10 | r""" 11 | OOD algorithm loader. 12 | Args: 13 | name: Name of the chosen OOD algorithm. 14 | config: please refer to specific algorithms for required configs. 15 | 16 | Returns: 17 | An OOD algorithm object. 18 | 19 | """ 20 | try: 21 | ood_algorithm: BaseOODAlg = register.ood_algs[name](config) 22 | except KeyError as e: 23 | print(f'#E#OOD algorithm of given name does not exist.') 24 | raise e 25 | return ood_algorithm 26 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/ood_manager.py: -------------------------------------------------------------------------------- 1 | """A module that is consist of an OOD algorithm loader. 2 | """ 3 | 4 | from GOOD import register 5 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 6 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 7 | 8 | 9 | def load_ood_alg(name, config: Union[CommonArgs, Munch]): 10 | r""" 11 | OOD algorithm loader. 12 | Args: 13 | name: Name of the chosen OOD algorithm. 14 | config: please refer to specific algorithms for required configs. 15 | 16 | Returns: 17 | An OOD algorithm object. 18 | 19 | """ 20 | try: 21 | ood_algorithm: BaseOODAlg = register.ood_algs[name](config) 22 | except KeyError as e: 23 | print(f'#E#OOD algorithm of given name does not exist.') 24 | raise e 25 | return ood_algorithm 26 | -------------------------------------------------------------------------------- /GOOD/utils/initial.py: -------------------------------------------------------------------------------- 1 | r"""Initial process for fixing all possible random seed. 2 | """ 3 | 4 | import random 5 | 6 | import numpy as np 7 | import torch 8 | 9 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 10 | 11 | 12 | def init(config: Union[CommonArgs, Munch]): 13 | r""" 14 | Initial process for fixing all possible random seed. 15 | 16 | Args: 17 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.random_seed`) 18 | 19 | 20 | """ 21 | # Fix Random seed 22 | random.seed(config.random_seed) 23 | np.random.seed(config.random_seed) 24 | torch.manual_seed(config.random_seed) 25 | torch.cuda.manual_seed(config.random_seed) 26 | torch.cuda.manual_seed_all(config.random_seed) 27 | torch.backends.cudnn.deterministic = True 28 | torch.backends.cudnn.CEX = False 29 | 30 | # Default state is a training state 31 | torch.enable_grad() 32 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/initial.py: -------------------------------------------------------------------------------- 1 | r"""Initial process for fixing all possible random seed. 2 | """ 3 | 4 | import random 5 | 6 | import numpy as np 7 | import torch 8 | 9 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 10 | 11 | 12 | def init(config: Union[CommonArgs, Munch]): 13 | r""" 14 | Initial process for fixing all possible random seed. 15 | 16 | Args: 17 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.random_seed`) 18 | 19 | 20 | """ 21 | # Fix Random seed 22 | random.seed(config.random_seed) 23 | np.random.seed(config.random_seed) 24 | torch.manual_seed(config.random_seed) 25 | torch.cuda.manual_seed(config.random_seed) 26 | torch.cuda.manual_seed_all(config.random_seed) 27 | torch.backends.cudnn.deterministic = True 28 | torch.backends.cudnn.CEX = False 29 | 30 | # Default state is a training state 31 | torch.enable_grad() 32 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/initial.py: -------------------------------------------------------------------------------- 1 | r"""Initial process for fixing all possible random seed. 2 | """ 3 | 4 | import random 5 | 6 | import numpy as np 7 | import torch 8 | 9 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 10 | 11 | 12 | def init(config: Union[CommonArgs, Munch]): 13 | r""" 14 | Initial process for fixing all possible random seed. 15 | 16 | Args: 17 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.random_seed`) 18 | 19 | 20 | """ 21 | # Fix Random seed 22 | random.seed(config.random_seed) 23 | np.random.seed(config.random_seed) 24 | torch.manual_seed(config.random_seed) 25 | torch.cuda.manual_seed(config.random_seed) 26 | torch.cuda.manual_seed_all(config.random_seed) 27 | torch.backends.cudnn.deterministic = True 28 | torch.backends.cudnn.CEX = False 29 | 30 | # Default state is a training state 31 | torch.enable_grad() 32 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/initial.py: -------------------------------------------------------------------------------- 1 | r"""Initial process for fixing all possible random seed. 2 | """ 3 | 4 | import random 5 | 6 | import numpy as np 7 | import torch 8 | 9 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 10 | 11 | 12 | def init(config: Union[CommonArgs, Munch]): 13 | r""" 14 | Initial process for fixing all possible random seed. 15 | 16 | Args: 17 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.random_seed`) 18 | 19 | 20 | """ 21 | # Fix Random seed 22 | random.seed(config.random_seed) 23 | np.random.seed(config.random_seed) 24 | torch.manual_seed(config.random_seed) 25 | torch.cuda.manual_seed(config.random_seed) 26 | torch.cuda.manual_seed_all(config.random_seed) 27 | torch.backends.cudnn.deterministic = True 28 | torch.backends.cudnn.CEX = False 29 | 30 | # Default state is a training state 31 | torch.enable_grad() 32 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/initial.py: -------------------------------------------------------------------------------- 1 | r"""Initial process for fixing all possible random seed. 2 | """ 3 | 4 | import random 5 | 6 | import numpy as np 7 | import torch 8 | 9 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 10 | 11 | 12 | def init(config: Union[CommonArgs, Munch]): 13 | r""" 14 | Initial process for fixing all possible random seed. 15 | 16 | Args: 17 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.random_seed`) 18 | 19 | 20 | """ 21 | # Fix Random seed 22 | random.seed(config.random_seed) 23 | np.random.seed(config.random_seed) 24 | torch.manual_seed(config.random_seed) 25 | torch.cuda.manual_seed(config.random_seed) 26 | torch.cuda.manual_seed_all(config.random_seed) 27 | torch.backends.cudnn.deterministic = True 28 | torch.backends.cudnn.CEX = False 29 | 30 | # Default state is a training state 31 | torch.enable_grad() 32 | -------------------------------------------------------------------------------- /GOOD/utils/synthetic_data/BA3_loc.py: -------------------------------------------------------------------------------- 1 | """BA3_loc.py 2 | """ 3 | 4 | import numpy as np 5 | 6 | figsize = (8, 6) 7 | 8 | 9 | #################################### 10 | # 11 | # Experiment utilities 12 | # 13 | #################################### 14 | def perturb(graph_list, p, id=None): 15 | """ Perturb the list of (sparse) graphs by adding/removing edges. 16 | Args: 17 | p: proportion of added edges based on current number of edges. 18 | Returns: 19 | A list of graphs that are perturbed from the original graphs. 20 | :param graph_list: 21 | :param id: 22 | """ 23 | perturbed_graph_list = [] 24 | for G_original in graph_list: 25 | G = G_original.copy() 26 | edge_count = int(G.number_of_edges() * p) 27 | # randomly add the edges between a pair of nodes without an edge. 28 | for _ in range(edge_count): 29 | while True: 30 | u = np.random.randint(0, G.number_of_nodes()) 31 | v = np.random.randint(0, G.number_of_nodes()) 32 | if (not G.has_edge(u, v)) and (u != v): 33 | break 34 | if (not id == None) and (id[u] == 0 or id[v] == 0): 35 | G.add_edge(u, v) 36 | perturbed_graph_list.append(G) 37 | return perturbed_graph_list 38 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/synthetic_data/BA3_loc.py: -------------------------------------------------------------------------------- 1 | """BA3_loc.py 2 | """ 3 | 4 | import numpy as np 5 | 6 | figsize = (8, 6) 7 | 8 | 9 | #################################### 10 | # 11 | # Experiment utilities 12 | # 13 | #################################### 14 | def perturb(graph_list, p, id=None): 15 | """ Perturb the list of (sparse) graphs by adding/removing edges. 16 | Args: 17 | p: proportion of added edges based on current number of edges. 18 | Returns: 19 | A list of graphs that are perturbed from the original graphs. 20 | :param graph_list: 21 | :param id: 22 | """ 23 | perturbed_graph_list = [] 24 | for G_original in graph_list: 25 | G = G_original.copy() 26 | edge_count = int(G.number_of_edges() * p) 27 | # randomly add the edges between a pair of nodes without an edge. 28 | for _ in range(edge_count): 29 | while True: 30 | u = np.random.randint(0, G.number_of_nodes()) 31 | v = np.random.randint(0, G.number_of_nodes()) 32 | if (not G.has_edge(u, v)) and (u != v): 33 | break 34 | if (not id == None) and (id[u] == 0 or id[v] == 0): 35 | G.add_edge(u, v) 36 | perturbed_graph_list.append(G) 37 | return perturbed_graph_list 38 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/synthetic_data/BA3_loc.py: -------------------------------------------------------------------------------- 1 | """BA3_loc.py 2 | """ 3 | 4 | import numpy as np 5 | 6 | figsize = (8, 6) 7 | 8 | 9 | #################################### 10 | # 11 | # Experiment utilities 12 | # 13 | #################################### 14 | def perturb(graph_list, p, id=None): 15 | """ Perturb the list of (sparse) graphs by adding/removing edges. 16 | Args: 17 | p: proportion of added edges based on current number of edges. 18 | Returns: 19 | A list of graphs that are perturbed from the original graphs. 20 | :param graph_list: 21 | :param id: 22 | """ 23 | perturbed_graph_list = [] 24 | for G_original in graph_list: 25 | G = G_original.copy() 26 | edge_count = int(G.number_of_edges() * p) 27 | # randomly add the edges between a pair of nodes without an edge. 28 | for _ in range(edge_count): 29 | while True: 30 | u = np.random.randint(0, G.number_of_nodes()) 31 | v = np.random.randint(0, G.number_of_nodes()) 32 | if (not G.has_edge(u, v)) and (u != v): 33 | break 34 | if (not id == None) and (id[u] == 0 or id[v] == 0): 35 | G.add_edge(u, v) 36 | perturbed_graph_list.append(G) 37 | return perturbed_graph_list 38 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/synthetic_data/BA3_loc.py: -------------------------------------------------------------------------------- 1 | """BA3_loc.py 2 | """ 3 | 4 | import numpy as np 5 | 6 | figsize = (8, 6) 7 | 8 | 9 | #################################### 10 | # 11 | # Experiment utilities 12 | # 13 | #################################### 14 | def perturb(graph_list, p, id=None): 15 | """ Perturb the list of (sparse) graphs by adding/removing edges. 16 | Args: 17 | p: proportion of added edges based on current number of edges. 18 | Returns: 19 | A list of graphs that are perturbed from the original graphs. 20 | :param graph_list: 21 | :param id: 22 | """ 23 | perturbed_graph_list = [] 24 | for G_original in graph_list: 25 | G = G_original.copy() 26 | edge_count = int(G.number_of_edges() * p) 27 | # randomly add the edges between a pair of nodes without an edge. 28 | for _ in range(edge_count): 29 | while True: 30 | u = np.random.randint(0, G.number_of_nodes()) 31 | v = np.random.randint(0, G.number_of_nodes()) 32 | if (not G.has_edge(u, v)) and (u != v): 33 | break 34 | if (not id == None) and (id[u] == 0 or id[v] == 0): 35 | G.add_edge(u, v) 36 | perturbed_graph_list.append(G) 37 | return perturbed_graph_list 38 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/synthetic_data/BA3_loc.py: -------------------------------------------------------------------------------- 1 | """BA3_loc.py 2 | """ 3 | 4 | import numpy as np 5 | 6 | figsize = (8, 6) 7 | 8 | 9 | #################################### 10 | # 11 | # Experiment utilities 12 | # 13 | #################################### 14 | def perturb(graph_list, p, id=None): 15 | """ Perturb the list of (sparse) graphs by adding/removing edges. 16 | Args: 17 | p: proportion of added edges based on current number of edges. 18 | Returns: 19 | A list of graphs that are perturbed from the original graphs. 20 | :param graph_list: 21 | :param id: 22 | """ 23 | perturbed_graph_list = [] 24 | for G_original in graph_list: 25 | G = G_original.copy() 26 | edge_count = int(G.number_of_edges() * p) 27 | # randomly add the edges between a pair of nodes without an edge. 28 | for _ in range(edge_count): 29 | while True: 30 | u = np.random.randint(0, G.number_of_nodes()) 31 | v = np.random.randint(0, G.number_of_nodes()) 32 | if (not G.has_edge(u, v)) and (u != v): 33 | break 34 | if (not id == None) and (id[u] == 0 or id[v] == 0): 35 | G.add_edge(u, v) 36 | perturbed_graph_list.append(G) 37 | return perturbed_graph_list 38 | -------------------------------------------------------------------------------- /GOOD/networks/models/Classifiers.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Applies a linear transformation to complete classification from representations. 3 | """ 4 | import torch 5 | import torch.nn as nn 6 | from torch import Tensor 7 | 8 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 9 | 10 | 11 | class Classifier(torch.nn.Module): 12 | r""" 13 | Applies a linear transformation to complete classification from representations. 14 | 15 | Args: 16 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.dataset.num_classes`) 17 | """ 18 | def __init__(self, config: Union[CommonArgs, Munch]): 19 | 20 | super(Classifier, self).__init__() 21 | # self.classifier = nn.Sequential(*( 22 | # [nn.Linear(config.model.dim_hidden, 2 * config.model.dim_ffn), nn.BatchNorm1d(2 * config.model.dim_ffn)] + 23 | # [nn.ReLU(), nn.Linear(2 * config.model.dim_ffn, config.dataset.num_classes)] 24 | # )) 25 | self.classifier = nn.Sequential(*( 26 | [nn.Linear(config.model.dim_hidden, config.dataset.num_classes)] 27 | )) 28 | 29 | def forward(self, feat: Tensor) -> Tensor: 30 | r""" 31 | Applies a linear transformation to feature representations. 32 | 33 | Args: 34 | feat (Tensor): feature representations 35 | 36 | Returns (Tensor): 37 | label predictions 38 | 39 | """ 40 | return self.classifier(feat) 41 | -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/Classifiers.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Applies a linear transformation to complete classification from representations. 3 | """ 4 | import torch 5 | import torch.nn as nn 6 | from torch import Tensor 7 | 8 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 9 | 10 | 11 | class Classifier(torch.nn.Module): 12 | r""" 13 | Applies a linear transformation to complete classification from representations. 14 | 15 | Args: 16 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.dataset.num_classes`) 17 | """ 18 | def __init__(self, config: Union[CommonArgs, Munch]): 19 | 20 | super(Classifier, self).__init__() 21 | # self.classifier = nn.Sequential(*( 22 | # [nn.Linear(config.model.dim_hidden, 2 * config.model.dim_ffn), nn.BatchNorm1d(2 * config.model.dim_ffn)] + 23 | # [nn.ReLU(), nn.Linear(2 * config.model.dim_ffn, config.dataset.num_classes)] 24 | # )) 25 | self.classifier = nn.Sequential(*( 26 | [nn.Linear(config.model.dim_hidden, config.dataset.num_classes)] 27 | )) 28 | 29 | def forward(self, feat: Tensor) -> Tensor: 30 | r""" 31 | Applies a linear transformation to feature representations. 32 | 33 | Args: 34 | feat (Tensor): feature representations 35 | 36 | Returns (Tensor): 37 | label predictions 38 | 39 | """ 40 | return self.classifier(feat) 41 | -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/Classifiers.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Applies a linear transformation to complete classification from representations. 3 | """ 4 | import torch 5 | import torch.nn as nn 6 | from torch import Tensor 7 | 8 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 9 | 10 | 11 | class Classifier(torch.nn.Module): 12 | r""" 13 | Applies a linear transformation to complete classification from representations. 14 | 15 | Args: 16 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.dataset.num_classes`) 17 | """ 18 | def __init__(self, config: Union[CommonArgs, Munch]): 19 | 20 | super(Classifier, self).__init__() 21 | # self.classifier = nn.Sequential(*( 22 | # [nn.Linear(config.model.dim_hidden, 2 * config.model.dim_ffn), nn.BatchNorm1d(2 * config.model.dim_ffn)] + 23 | # [nn.ReLU(), nn.Linear(2 * config.model.dim_ffn, config.dataset.num_classes)] 24 | # )) 25 | self.classifier = nn.Sequential(*( 26 | [nn.Linear(config.model.dim_hidden, config.dataset.num_classes)] 27 | )) 28 | 29 | def forward(self, feat: Tensor) -> Tensor: 30 | r""" 31 | Applies a linear transformation to feature representations. 32 | 33 | Args: 34 | feat (Tensor): feature representations 35 | 36 | Returns (Tensor): 37 | label predictions 38 | 39 | """ 40 | return self.classifier(feat) 41 | -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/Classifiers.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Applies a linear transformation to complete classification from representations. 3 | """ 4 | import torch 5 | import torch.nn as nn 6 | from torch import Tensor 7 | 8 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 9 | 10 | 11 | class Classifier(torch.nn.Module): 12 | r""" 13 | Applies a linear transformation to complete classification from representations. 14 | 15 | Args: 16 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.dataset.num_classes`) 17 | """ 18 | def __init__(self, config: Union[CommonArgs, Munch]): 19 | 20 | super(Classifier, self).__init__() 21 | # self.classifier = nn.Sequential(*( 22 | # [nn.Linear(config.model.dim_hidden, 2 * config.model.dim_ffn), nn.BatchNorm1d(2 * config.model.dim_ffn)] + 23 | # [nn.ReLU(), nn.Linear(2 * config.model.dim_ffn, config.dataset.num_classes)] 24 | # )) 25 | self.classifier = nn.Sequential(*( 26 | [nn.Linear(config.model.dim_hidden, config.dataset.num_classes)] 27 | )) 28 | 29 | def forward(self, feat: Tensor) -> Tensor: 30 | r""" 31 | Applies a linear transformation to feature representations. 32 | 33 | Args: 34 | feat (Tensor): feature representations 35 | 36 | Returns (Tensor): 37 | label predictions 38 | 39 | """ 40 | return self.classifier(feat) 41 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/Classifiers.py: -------------------------------------------------------------------------------- 1 | r""" 2 | Applies a linear transformation to complete classification from representations. 3 | """ 4 | import torch 5 | import torch.nn as nn 6 | from torch import Tensor 7 | 8 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 9 | 10 | 11 | class Classifier(torch.nn.Module): 12 | r""" 13 | Applies a linear transformation to complete classification from representations. 14 | 15 | Args: 16 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.dataset.num_classes`) 17 | """ 18 | def __init__(self, config: Union[CommonArgs, Munch]): 19 | 20 | super(Classifier, self).__init__() 21 | # self.classifier = nn.Sequential(*( 22 | # [nn.Linear(config.model.dim_hidden, 2 * config.model.dim_ffn), nn.BatchNorm1d(2 * config.model.dim_ffn)] + 23 | # [nn.ReLU(), nn.Linear(2 * config.model.dim_ffn, config.dataset.num_classes)] 24 | # )) 25 | self.classifier = nn.Sequential(*( 26 | [nn.Linear(config.model.dim_hidden, config.dataset.num_classes)] 27 | )) 28 | 29 | def forward(self, feat: Tensor) -> Tensor: 30 | r""" 31 | Applies a linear transformation to feature representations. 32 | 33 | Args: 34 | feat (Tensor): feature representations 35 | 36 | Returns (Tensor): 37 | label predictions 38 | 39 | """ 40 | return self.classifier(feat) 41 | -------------------------------------------------------------------------------- /GOOD/utils/register.py: -------------------------------------------------------------------------------- 1 | r"""A kernel module that contains a global register for unified model, dataset, and OOD algorithms access. 2 | """ 3 | 4 | class Register(object): 5 | r""" 6 | Global register for unified model, dataset, and OOD algorithms access. 7 | """ 8 | 9 | def __init__(self): 10 | self.models = dict() 11 | self.datasets = dict() 12 | self.ood_algs = dict() 13 | 14 | def model_register(self, model_class): 15 | r""" 16 | Register for model access. 17 | 18 | Args: 19 | model_class (class): model class 20 | 21 | Returns (class): 22 | model class 23 | 24 | """ 25 | self.models[model_class.__name__] = model_class 26 | return model_class 27 | 28 | def dataset_register(self, dataset_class): 29 | r""" 30 | Register for dataset access. 31 | 32 | Args: 33 | dataset_class (class): dataset class 34 | 35 | Returns (class): 36 | dataset class 37 | 38 | """ 39 | self.datasets[dataset_class.__name__] = dataset_class 40 | return dataset_class 41 | 42 | def ood_alg_register(self, ood_alg_class): 43 | r""" 44 | Register for OOD algorithms access. 45 | 46 | Args: 47 | ood_alg_class (class): OOD algorithms class 48 | 49 | Returns (class): 50 | OOD algorithms class 51 | 52 | """ 53 | self.ood_algs[ood_alg_class.__name__] = ood_alg_class 54 | return ood_alg_class 55 | 56 | 57 | register = Register() #: The GOOD register object used for accessing models, datasets and OOD algorithms. 58 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/register.py: -------------------------------------------------------------------------------- 1 | r"""A kernel module that contains a global register for unified model, dataset, and OOD algorithms access. 2 | """ 3 | 4 | class Register(object): 5 | r""" 6 | Global register for unified model, dataset, and OOD algorithms access. 7 | """ 8 | 9 | def __init__(self): 10 | self.models = dict() 11 | self.datasets = dict() 12 | self.ood_algs = dict() 13 | 14 | def model_register(self, model_class): 15 | r""" 16 | Register for model access. 17 | 18 | Args: 19 | model_class (class): model class 20 | 21 | Returns (class): 22 | model class 23 | 24 | """ 25 | self.models[model_class.__name__] = model_class 26 | return model_class 27 | 28 | def dataset_register(self, dataset_class): 29 | r""" 30 | Register for dataset access. 31 | 32 | Args: 33 | dataset_class (class): dataset class 34 | 35 | Returns (class): 36 | dataset class 37 | 38 | """ 39 | self.datasets[dataset_class.__name__] = dataset_class 40 | return dataset_class 41 | 42 | def ood_alg_register(self, ood_alg_class): 43 | r""" 44 | Register for OOD algorithms access. 45 | 46 | Args: 47 | ood_alg_class (class): OOD algorithms class 48 | 49 | Returns (class): 50 | OOD algorithms class 51 | 52 | """ 53 | self.ood_algs[ood_alg_class.__name__] = ood_alg_class 54 | return ood_alg_class 55 | 56 | 57 | register = Register() #: The GOOD register object used for accessing models, datasets and OOD algorithms. 58 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/register.py: -------------------------------------------------------------------------------- 1 | r"""A kernel module that contains a global register for unified model, dataset, and OOD algorithms access. 2 | """ 3 | 4 | class Register(object): 5 | r""" 6 | Global register for unified model, dataset, and OOD algorithms access. 7 | """ 8 | 9 | def __init__(self): 10 | self.models = dict() 11 | self.datasets = dict() 12 | self.ood_algs = dict() 13 | 14 | def model_register(self, model_class): 15 | r""" 16 | Register for model access. 17 | 18 | Args: 19 | model_class (class): model class 20 | 21 | Returns (class): 22 | model class 23 | 24 | """ 25 | self.models[model_class.__name__] = model_class 26 | return model_class 27 | 28 | def dataset_register(self, dataset_class): 29 | r""" 30 | Register for dataset access. 31 | 32 | Args: 33 | dataset_class (class): dataset class 34 | 35 | Returns (class): 36 | dataset class 37 | 38 | """ 39 | self.datasets[dataset_class.__name__] = dataset_class 40 | return dataset_class 41 | 42 | def ood_alg_register(self, ood_alg_class): 43 | r""" 44 | Register for OOD algorithms access. 45 | 46 | Args: 47 | ood_alg_class (class): OOD algorithms class 48 | 49 | Returns (class): 50 | OOD algorithms class 51 | 52 | """ 53 | self.ood_algs[ood_alg_class.__name__] = ood_alg_class 54 | return ood_alg_class 55 | 56 | 57 | register = Register() #: The GOOD register object used for accessing models, datasets and OOD algorithms. 58 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/register.py: -------------------------------------------------------------------------------- 1 | r"""A kernel module that contains a global register for unified model, dataset, and OOD algorithms access. 2 | """ 3 | 4 | class Register(object): 5 | r""" 6 | Global register for unified model, dataset, and OOD algorithms access. 7 | """ 8 | 9 | def __init__(self): 10 | self.models = dict() 11 | self.datasets = dict() 12 | self.ood_algs = dict() 13 | 14 | def model_register(self, model_class): 15 | r""" 16 | Register for model access. 17 | 18 | Args: 19 | model_class (class): model class 20 | 21 | Returns (class): 22 | model class 23 | 24 | """ 25 | self.models[model_class.__name__] = model_class 26 | return model_class 27 | 28 | def dataset_register(self, dataset_class): 29 | r""" 30 | Register for dataset access. 31 | 32 | Args: 33 | dataset_class (class): dataset class 34 | 35 | Returns (class): 36 | dataset class 37 | 38 | """ 39 | self.datasets[dataset_class.__name__] = dataset_class 40 | return dataset_class 41 | 42 | def ood_alg_register(self, ood_alg_class): 43 | r""" 44 | Register for OOD algorithms access. 45 | 46 | Args: 47 | ood_alg_class (class): OOD algorithms class 48 | 49 | Returns (class): 50 | OOD algorithms class 51 | 52 | """ 53 | self.ood_algs[ood_alg_class.__name__] = ood_alg_class 54 | return ood_alg_class 55 | 56 | 57 | register = Register() #: The GOOD register object used for accessing models, datasets and OOD algorithms. 58 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/register.py: -------------------------------------------------------------------------------- 1 | r"""A kernel module that contains a global register for unified model, dataset, and OOD algorithms access. 2 | """ 3 | 4 | class Register(object): 5 | r""" 6 | Global register for unified model, dataset, and OOD algorithms access. 7 | """ 8 | 9 | def __init__(self): 10 | self.models = dict() 11 | self.datasets = dict() 12 | self.ood_algs = dict() 13 | 14 | def model_register(self, model_class): 15 | r""" 16 | Register for model access. 17 | 18 | Args: 19 | model_class (class): model class 20 | 21 | Returns (class): 22 | model class 23 | 24 | """ 25 | self.models[model_class.__name__] = model_class 26 | return model_class 27 | 28 | def dataset_register(self, dataset_class): 29 | r""" 30 | Register for dataset access. 31 | 32 | Args: 33 | dataset_class (class): dataset class 34 | 35 | Returns (class): 36 | dataset class 37 | 38 | """ 39 | self.datasets[dataset_class.__name__] = dataset_class 40 | return dataset_class 41 | 42 | def ood_alg_register(self, ood_alg_class): 43 | r""" 44 | Register for OOD algorithms access. 45 | 46 | Args: 47 | ood_alg_class (class): OOD algorithms class 48 | 49 | Returns (class): 50 | OOD algorithms class 51 | 52 | """ 53 | self.ood_algs[ood_alg_class.__name__] = ood_alg_class 54 | return ood_alg_class 55 | 56 | 57 | register = Register() #: The GOOD register object used for accessing models, datasets and OOD algorithms. 58 | -------------------------------------------------------------------------------- /GOOD/utils/logger.py: -------------------------------------------------------------------------------- 1 | r"""A logger related utils file: tqdm style, logger loader. 2 | """ 3 | import os 4 | from datetime import datetime 5 | 6 | from cilog import create_logger 7 | from torch.utils.tensorboard import SummaryWriter 8 | 9 | pbar_setting = {'colour': '#a48fff', 'bar_format': '{l_bar}{bar:20}{r_bar}', 10 | 'dynamic_ncols': True, 'ascii': '░▒█'} 11 | 12 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 13 | 14 | 15 | def load_logger(config: Union[CommonArgs, Munch], sub_print=True): 16 | r""" 17 | Logger loader 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.log_path`, :obj:`config.tensorboard_logdir`, :obj:`config.log_file`) 21 | sub_print (bool): Whether the logger substitutes general print function. If Ture, logger.info will be equal to 22 | print(f'#IN#Message'), where #IN# represents info. Similarly, other level of log can be used by adding prefixes 23 | (Not capital sensitive): Debug: #d#, #De#, #Debug#, etc. Info: #I#, #In#, #inf#, #INFO#, etc. Important: #IM#, 24 | #important#, etc. Warning: #W#, #war#, etc. Error: #E#, #err#, etc. Critical: #C#, #Cri#, #critical#, etc. If 25 | there is no prefix, the general print function will be used. 26 | 27 | Returns: 28 | [cilog Logger, tensorboard summary writer] 29 | 30 | """ 31 | if sub_print: 32 | print("This logger will substitute general print function") 33 | logger = create_logger(name='GNN_log', 34 | file=config.log_path, 35 | enable_mail=False, 36 | sub_print=sub_print) 37 | 38 | current_time = datetime.now().strftime('%b%d_%H-%M-%S') 39 | writer = SummaryWriter( 40 | log_dir=os.path.join(config.tensorboard_logdir, f'{config.log_file}_{current_time}')) 41 | return logger, writer 42 | -------------------------------------------------------------------------------- /CMNIST/GOOD/utils/logger.py: -------------------------------------------------------------------------------- 1 | r"""A logger related utils file: tqdm style, logger loader. 2 | """ 3 | import os 4 | from datetime import datetime 5 | 6 | from cilog import create_logger 7 | from torch.utils.tensorboard import SummaryWriter 8 | 9 | pbar_setting = {'colour': '#a48fff', 'bar_format': '{l_bar}{bar:20}{r_bar}', 10 | 'dynamic_ncols': True, 'ascii': '░▒█'} 11 | 12 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 13 | 14 | 15 | def load_logger(config: Union[CommonArgs, Munch], sub_print=True): 16 | r""" 17 | Logger loader 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.log_path`, :obj:`config.tensorboard_logdir`, :obj:`config.log_file`) 21 | sub_print (bool): Whether the logger substitutes general print function. If Ture, logger.info will be equal to 22 | print(f'#IN#Message'), where #IN# represents info. Similarly, other level of log can be used by adding prefixes 23 | (Not capital sensitive): Debug: #d#, #De#, #Debug#, etc. Info: #I#, #In#, #inf#, #INFO#, etc. Important: #IM#, 24 | #important#, etc. Warning: #W#, #war#, etc. Error: #E#, #err#, etc. Critical: #C#, #Cri#, #critical#, etc. If 25 | there is no prefix, the general print function will be used. 26 | 27 | Returns: 28 | [cilog Logger, tensorboard summary writer] 29 | 30 | """ 31 | if sub_print: 32 | print("This logger will substitute general print function") 33 | logger = create_logger(name='GNN_log', 34 | file=config.log_path, 35 | enable_mail=False, 36 | sub_print=sub_print) 37 | 38 | current_time = datetime.now().strftime('%b%d_%H-%M-%S') 39 | writer = SummaryWriter( 40 | log_dir=os.path.join(config.tensorboard_logdir, f'{config.log_file}_{current_time}')) 41 | return logger, writer 42 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/utils/logger.py: -------------------------------------------------------------------------------- 1 | r"""A logger related utils file: tqdm style, logger loader. 2 | """ 3 | import os 4 | from datetime import datetime 5 | 6 | from cilog import create_logger 7 | from torch.utils.tensorboard import SummaryWriter 8 | 9 | pbar_setting = {'colour': '#a48fff', 'bar_format': '{l_bar}{bar:20}{r_bar}', 10 | 'dynamic_ncols': True, 'ascii': '░▒█'} 11 | 12 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 13 | 14 | 15 | def load_logger(config: Union[CommonArgs, Munch], sub_print=True): 16 | r""" 17 | Logger loader 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.log_path`, :obj:`config.tensorboard_logdir`, :obj:`config.log_file`) 21 | sub_print (bool): Whether the logger substitutes general print function. If Ture, logger.info will be equal to 22 | print(f'#IN#Message'), where #IN# represents info. Similarly, other level of log can be used by adding prefixes 23 | (Not capital sensitive): Debug: #d#, #De#, #Debug#, etc. Info: #I#, #In#, #inf#, #INFO#, etc. Important: #IM#, 24 | #important#, etc. Warning: #W#, #war#, etc. Error: #E#, #err#, etc. Critical: #C#, #Cri#, #critical#, etc. If 25 | there is no prefix, the general print function will be used. 26 | 27 | Returns: 28 | [cilog Logger, tensorboard summary writer] 29 | 30 | """ 31 | if sub_print: 32 | print("This logger will substitute general print function") 33 | logger = create_logger(name='GNN_log', 34 | file=config.log_path, 35 | enable_mail=False, 36 | sub_print=sub_print) 37 | 38 | current_time = datetime.now().strftime('%b%d_%H-%M-%S') 39 | writer = SummaryWriter( 40 | log_dir=os.path.join(config.tensorboard_logdir, f'{config.log_file}_{current_time}')) 41 | return logger, writer 42 | -------------------------------------------------------------------------------- /Molhiv/GOOD/utils/logger.py: -------------------------------------------------------------------------------- 1 | r"""A logger related utils file: tqdm style, logger loader. 2 | """ 3 | import os 4 | from datetime import datetime 5 | 6 | from cilog import create_logger 7 | from torch.utils.tensorboard import SummaryWriter 8 | 9 | pbar_setting = {'colour': '#a48fff', 'bar_format': '{l_bar}{bar:20}{r_bar}', 10 | 'dynamic_ncols': True, 'ascii': '░▒█'} 11 | 12 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 13 | 14 | 15 | def load_logger(config: Union[CommonArgs, Munch], sub_print=True): 16 | r""" 17 | Logger loader 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.log_path`, :obj:`config.tensorboard_logdir`, :obj:`config.log_file`) 21 | sub_print (bool): Whether the logger substitutes general print function. If Ture, logger.info will be equal to 22 | print(f'#IN#Message'), where #IN# represents info. Similarly, other level of log can be used by adding prefixes 23 | (Not capital sensitive): Debug: #d#, #De#, #Debug#, etc. Info: #I#, #In#, #inf#, #INFO#, etc. Important: #IM#, 24 | #important#, etc. Warning: #W#, #war#, etc. Error: #E#, #err#, etc. Critical: #C#, #Cri#, #critical#, etc. If 25 | there is no prefix, the general print function will be used. 26 | 27 | Returns: 28 | [cilog Logger, tensorboard summary writer] 29 | 30 | """ 31 | if sub_print: 32 | print("This logger will substitute general print function") 33 | logger = create_logger(name='GNN_log', 34 | file=config.log_path, 35 | enable_mail=False, 36 | sub_print=sub_print) 37 | 38 | current_time = datetime.now().strftime('%b%d_%H-%M-%S') 39 | writer = SummaryWriter( 40 | log_dir=os.path.join(config.tensorboard_logdir, f'{config.log_file}_{current_time}')) 41 | return logger, writer 42 | -------------------------------------------------------------------------------- /Motif/GOOD/utils/logger.py: -------------------------------------------------------------------------------- 1 | r"""A logger related utils file: tqdm style, logger loader. 2 | """ 3 | import os 4 | from datetime import datetime 5 | 6 | from cilog import create_logger 7 | from torch.utils.tensorboard import SummaryWriter 8 | 9 | pbar_setting = {'colour': '#a48fff', 'bar_format': '{l_bar}{bar:20}{r_bar}', 10 | 'dynamic_ncols': True, 'ascii': '░▒█'} 11 | 12 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 13 | 14 | 15 | def load_logger(config: Union[CommonArgs, Munch], sub_print=True): 16 | r""" 17 | Logger loader 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.log_path`, :obj:`config.tensorboard_logdir`, :obj:`config.log_file`) 21 | sub_print (bool): Whether the logger substitutes general print function. If Ture, logger.info will be equal to 22 | print(f'#IN#Message'), where #IN# represents info. Similarly, other level of log can be used by adding prefixes 23 | (Not capital sensitive): Debug: #d#, #De#, #Debug#, etc. Info: #I#, #In#, #inf#, #INFO#, etc. Important: #IM#, 24 | #important#, etc. Warning: #W#, #war#, etc. Error: #E#, #err#, etc. Critical: #C#, #Cri#, #critical#, etc. If 25 | there is no prefix, the general print function will be used. 26 | 27 | Returns: 28 | [cilog Logger, tensorboard summary writer] 29 | 30 | """ 31 | if sub_print: 32 | print("This logger will substitute general print function") 33 | logger = create_logger(name='GNN_log', 34 | file=config.log_path, 35 | enable_mail=False, 36 | sub_print=sub_print) 37 | 38 | current_time = datetime.now().strftime('%b%d_%H-%M-%S') 39 | writer = SummaryWriter( 40 | log_dir=os.path.join(config.tensorboard_logdir, f'{config.log_file}_{current_time}')) 41 | return logger, writer 42 | -------------------------------------------------------------------------------- /GOOD/networks/models/CoralGCNs.py: -------------------------------------------------------------------------------- 1 | """ 2 | GCN implementation of the Deep Coral algorithm from `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 3 | `_ paper 4 | """ 5 | from typing import Tuple 6 | 7 | import torch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseGNN import GNNBasic 12 | from .Classifiers import Classifier 13 | from .GCNs import GCNFeatExtractor 14 | 15 | 16 | @register.model_register 17 | class Coral_GCN(GNNBasic): 18 | r""" 19 | The Graph Neural Network modified from the `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 20 | `_ paper and `"Semi-supervised Classification with Graph Convolutional Networks" 21 | `_ paper. 22 | 23 | Args: 24 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.model.model_layer`, :obj:`config.dataset.dim_node`, :obj:`config.dataset.num_classes`) 25 | """ 26 | 27 | def __init__(self, config: Union[CommonArgs, Munch]): 28 | super().__init__(config) 29 | self.feat_encoder = GCNFeatExtractor(config) 30 | self.classifier = Classifier(config) 31 | self.graph_repr = None 32 | 33 | def forward(self, *args, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]: 34 | r""" 35 | The Deep Coral-GCN model implementation. 36 | 37 | Args: 38 | *args (list): argument list for the use of arguments_read. Refer to :func:`arguments_read ` 39 | **kwargs (dict): key word arguments for the use of arguments_read. Refer to :func:`arguments_read ` 40 | 41 | Returns (Tensor): 42 | [label predictions, features] 43 | 44 | """ 45 | out_readout = self.feat_encoder(*args, **kwargs) 46 | 47 | out = self.classifier(out_readout) 48 | return out, out_readout 49 | -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/CoralGCNs.py: -------------------------------------------------------------------------------- 1 | """ 2 | GCN implementation of the Deep Coral algorithm from `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 3 | `_ paper 4 | """ 5 | from typing import Tuple 6 | 7 | import torch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseGNN import GNNBasic 12 | from .Classifiers import Classifier 13 | from .GCNs import GCNFeatExtractor 14 | 15 | 16 | @register.model_register 17 | class Coral_GCN(GNNBasic): 18 | r""" 19 | The Graph Neural Network modified from the `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 20 | `_ paper and `"Semi-supervised Classification with Graph Convolutional Networks" 21 | `_ paper. 22 | 23 | Args: 24 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.model.model_layer`, :obj:`config.dataset.dim_node`, :obj:`config.dataset.num_classes`) 25 | """ 26 | 27 | def __init__(self, config: Union[CommonArgs, Munch]): 28 | super().__init__(config) 29 | self.feat_encoder = GCNFeatExtractor(config) 30 | self.classifier = Classifier(config) 31 | self.graph_repr = None 32 | 33 | def forward(self, *args, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]: 34 | r""" 35 | The Deep Coral-GCN model implementation. 36 | 37 | Args: 38 | *args (list): argument list for the use of arguments_read. Refer to :func:`arguments_read ` 39 | **kwargs (dict): key word arguments for the use of arguments_read. Refer to :func:`arguments_read ` 40 | 41 | Returns (Tensor): 42 | [label predictions, features] 43 | 44 | """ 45 | out_readout = self.feat_encoder(*args, **kwargs) 46 | 47 | out = self.classifier(out_readout) 48 | return out, out_readout 49 | -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/CoralGCNs.py: -------------------------------------------------------------------------------- 1 | """ 2 | GCN implementation of the Deep Coral algorithm from `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 3 | `_ paper 4 | """ 5 | from typing import Tuple 6 | 7 | import torch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseGNN import GNNBasic 12 | from .Classifiers import Classifier 13 | from .GCNs import GCNFeatExtractor 14 | 15 | 16 | @register.model_register 17 | class Coral_GCN(GNNBasic): 18 | r""" 19 | The Graph Neural Network modified from the `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 20 | `_ paper and `"Semi-supervised Classification with Graph Convolutional Networks" 21 | `_ paper. 22 | 23 | Args: 24 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.model.model_layer`, :obj:`config.dataset.dim_node`, :obj:`config.dataset.num_classes`) 25 | """ 26 | 27 | def __init__(self, config: Union[CommonArgs, Munch]): 28 | super().__init__(config) 29 | self.feat_encoder = GCNFeatExtractor(config) 30 | self.classifier = Classifier(config) 31 | self.graph_repr = None 32 | 33 | def forward(self, *args, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]: 34 | r""" 35 | The Deep Coral-GCN model implementation. 36 | 37 | Args: 38 | *args (list): argument list for the use of arguments_read. Refer to :func:`arguments_read ` 39 | **kwargs (dict): key word arguments for the use of arguments_read. Refer to :func:`arguments_read ` 40 | 41 | Returns (Tensor): 42 | [label predictions, features] 43 | 44 | """ 45 | out_readout = self.feat_encoder(*args, **kwargs) 46 | 47 | out = self.classifier(out_readout) 48 | return out, out_readout 49 | -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/CoralGCNs.py: -------------------------------------------------------------------------------- 1 | """ 2 | GCN implementation of the Deep Coral algorithm from `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 3 | `_ paper 4 | """ 5 | from typing import Tuple 6 | 7 | import torch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseGNN import GNNBasic 12 | from .Classifiers import Classifier 13 | from .GCNs import GCNFeatExtractor 14 | 15 | 16 | @register.model_register 17 | class Coral_GCN(GNNBasic): 18 | r""" 19 | The Graph Neural Network modified from the `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 20 | `_ paper and `"Semi-supervised Classification with Graph Convolutional Networks" 21 | `_ paper. 22 | 23 | Args: 24 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.model.model_layer`, :obj:`config.dataset.dim_node`, :obj:`config.dataset.num_classes`) 25 | """ 26 | 27 | def __init__(self, config: Union[CommonArgs, Munch]): 28 | super().__init__(config) 29 | self.feat_encoder = GCNFeatExtractor(config) 30 | self.classifier = Classifier(config) 31 | self.graph_repr = None 32 | 33 | def forward(self, *args, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]: 34 | r""" 35 | The Deep Coral-GCN model implementation. 36 | 37 | Args: 38 | *args (list): argument list for the use of arguments_read. Refer to :func:`arguments_read ` 39 | **kwargs (dict): key word arguments for the use of arguments_read. Refer to :func:`arguments_read ` 40 | 41 | Returns (Tensor): 42 | [label predictions, features] 43 | 44 | """ 45 | out_readout = self.feat_encoder(*args, **kwargs) 46 | 47 | out = self.classifier(out_readout) 48 | return out, out_readout 49 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/CoralGCNs.py: -------------------------------------------------------------------------------- 1 | """ 2 | GCN implementation of the Deep Coral algorithm from `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 3 | `_ paper 4 | """ 5 | from typing import Tuple 6 | 7 | import torch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseGNN import GNNBasic 12 | from .Classifiers import Classifier 13 | from .GCNs import GCNFeatExtractor 14 | 15 | 16 | @register.model_register 17 | class Coral_GCN(GNNBasic): 18 | r""" 19 | The Graph Neural Network modified from the `"Deep CORAL: Correlation Alignment for Deep Domain Adaptation" 20 | `_ paper and `"Semi-supervised Classification with Graph Convolutional Networks" 21 | `_ paper. 22 | 23 | Args: 24 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.model.dim_hidden`, :obj:`config.model.model_layer`, :obj:`config.dataset.dim_node`, :obj:`config.dataset.num_classes`) 25 | """ 26 | 27 | def __init__(self, config: Union[CommonArgs, Munch]): 28 | super().__init__(config) 29 | self.feat_encoder = GCNFeatExtractor(config) 30 | self.classifier = Classifier(config) 31 | self.graph_repr = None 32 | 33 | def forward(self, *args, **kwargs) -> Tuple[torch.Tensor, torch.Tensor]: 34 | r""" 35 | The Deep Coral-GCN model implementation. 36 | 37 | Args: 38 | *args (list): argument list for the use of arguments_read. Refer to :func:`arguments_read ` 39 | **kwargs (dict): key word arguments for the use of arguments_read. Refer to :func:`arguments_read ` 40 | 41 | Returns (Tensor): 42 | [label predictions, features] 43 | 44 | """ 45 | out_readout = self.feat_encoder(*args, **kwargs) 46 | 47 | out = self.classifier(out_readout) 48 | return out, out_readout 49 | -------------------------------------------------------------------------------- /MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | import pdb 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /CMNIST/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | import pdb 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Molbbbp/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | import pdb 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Molhiv/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | import pdb 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Motif/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | import pdb 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /GOOD/networks/models/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /CMNIST/GOOD/networks/models/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/networks/models/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Molhiv/GOOD/networks/models/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /Motif/GOOD/networks/models/MolEncoders.py: -------------------------------------------------------------------------------- 1 | """ 2 | Atom (node) and bond (edge) feature encoding specified for molecule data. 3 | """ 4 | import torch 5 | from torch import Tensor 6 | from GOOD.utils.data import x_map, e_map 7 | 8 | 9 | class AtomEncoder(torch.nn.Module): 10 | r""" 11 | atom (node) feature encoding specified for molecule data. 12 | 13 | Args: 14 | emb_dim: number of dimensions of embedding 15 | """ 16 | 17 | def __init__(self, emb_dim): 18 | 19 | super(AtomEncoder, self).__init__() 20 | 21 | self.atom_embedding_list = torch.nn.ModuleList() 22 | 23 | feat_dims = list(map(len, x_map.values())) 24 | 25 | for i, dim in enumerate(feat_dims): 26 | emb = torch.nn.Embedding(dim, emb_dim) 27 | torch.nn.init.xavier_uniform_(emb.weight.data) 28 | self.atom_embedding_list.append(emb) 29 | 30 | def forward(self, x): 31 | r""" 32 | atom (node) feature encoding specified for molecule data. 33 | 34 | Args: 35 | x (Tensor): node features 36 | 37 | Returns (Tensor): 38 | atom (node) embeddings 39 | """ 40 | x_embedding = 0 41 | for i in range(x.shape[1]): 42 | x_embedding += self.atom_embedding_list[i](x[:, i]) 43 | 44 | return x_embedding 45 | 46 | 47 | class BondEncoder(torch.nn.Module): 48 | r""" 49 | bond (edge) feature encoding specified for molecule data. 50 | 51 | Args: 52 | emb_dim: number of dimensions of embedding 53 | """ 54 | 55 | def __init__(self, emb_dim): 56 | super(BondEncoder, self).__init__() 57 | 58 | self.bond_embedding_list = torch.nn.ModuleList() 59 | 60 | edge_feat_dims = list(map(len, e_map.values())) 61 | 62 | for i, dim in enumerate(edge_feat_dims): 63 | emb = torch.nn.Embedding(dim, emb_dim) 64 | torch.nn.init.xavier_uniform_(emb.weight.data) 65 | self.bond_embedding_list.append(emb) 66 | 67 | def forward(self, edge_attr): 68 | r""" 69 | bond (edge) feature encoding specified for molecule data. 70 | 71 | Args: 72 | edge_attr (Tensor): edge attributes 73 | 74 | Returns (Tensor): 75 | bond (edge) embeddings 76 | 77 | """ 78 | bond_embedding = 0 79 | for i in range(edge_attr.shape[1]): 80 | bond_embedding += self.bond_embedding_list[i](edge_attr[:, i]) 81 | 82 | return bond_embedding 83 | -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/VREx.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | from GOOD import register 9 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | 12 | 13 | @register.ood_alg_register 14 | class VREx(BaseOODAlg): 15 | r""" 16 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 17 | `_ paper 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 21 | """ 22 | def __init__(self, config: Union[CommonArgs, Munch]): 23 | super(VREx, self).__init__(config) 24 | 25 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 26 | r""" 27 | Process loss based on VREx algorithm 28 | 29 | Args: 30 | loss (Tensor): base loss between model predictions and input labels 31 | data (Batch): input data 32 | mask (Tensor): NAN masks for data formats 33 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 34 | 35 | .. code-block:: python 36 | 37 | config = munchify({device: torch.device('cuda'), 38 | dataset: {num_envs: int(10)}, 39 | ood: {ood_param: float(0.1)} 40 | }) 41 | 42 | 43 | Returns (Tensor): 44 | loss based on VREx algorithm 45 | 46 | """ 47 | loss_list = [] 48 | for i in range(config.dataset.num_envs): 49 | env_idx = data.env_id == i 50 | if loss[env_idx].shape[0] > 0: 51 | loss_list.append(loss[env_idx].sum() / mask[env_idx].sum()) 52 | spec_loss = config.ood.ood_param * torch.var(torch.tensor(loss_list, device=config.device)) 53 | if torch.isnan(spec_loss): 54 | spec_loss = 0 55 | mean_loss = loss.sum() / mask.sum() 56 | loss = spec_loss + mean_loss 57 | self.mean_loss = mean_loss 58 | self.spec_loss = spec_loss 59 | return loss 60 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/VREx.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | from GOOD import register 9 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | 12 | 13 | @register.ood_alg_register 14 | class VREx(BaseOODAlg): 15 | r""" 16 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 17 | `_ paper 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 21 | """ 22 | def __init__(self, config: Union[CommonArgs, Munch]): 23 | super(VREx, self).__init__(config) 24 | 25 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 26 | r""" 27 | Process loss based on VREx algorithm 28 | 29 | Args: 30 | loss (Tensor): base loss between model predictions and input labels 31 | data (Batch): input data 32 | mask (Tensor): NAN masks for data formats 33 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 34 | 35 | .. code-block:: python 36 | 37 | config = munchify({device: torch.device('cuda'), 38 | dataset: {num_envs: int(10)}, 39 | ood: {ood_param: float(0.1)} 40 | }) 41 | 42 | 43 | Returns (Tensor): 44 | loss based on VREx algorithm 45 | 46 | """ 47 | loss_list = [] 48 | for i in range(config.dataset.num_envs): 49 | env_idx = data.env_id == i 50 | if loss[env_idx].shape[0] > 0: 51 | loss_list.append(loss[env_idx].sum() / mask[env_idx].sum()) 52 | spec_loss = config.ood.ood_param * torch.var(torch.tensor(loss_list, device=config.device)) 53 | if torch.isnan(spec_loss): 54 | spec_loss = 0 55 | mean_loss = loss.sum() / mask.sum() 56 | loss = spec_loss + mean_loss 57 | self.mean_loss = mean_loss 58 | self.spec_loss = spec_loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/VREx.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | from GOOD import register 9 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | 12 | 13 | @register.ood_alg_register 14 | class VREx(BaseOODAlg): 15 | r""" 16 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 17 | `_ paper 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 21 | """ 22 | def __init__(self, config: Union[CommonArgs, Munch]): 23 | super(VREx, self).__init__(config) 24 | 25 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 26 | r""" 27 | Process loss based on VREx algorithm 28 | 29 | Args: 30 | loss (Tensor): base loss between model predictions and input labels 31 | data (Batch): input data 32 | mask (Tensor): NAN masks for data formats 33 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 34 | 35 | .. code-block:: python 36 | 37 | config = munchify({device: torch.device('cuda'), 38 | dataset: {num_envs: int(10)}, 39 | ood: {ood_param: float(0.1)} 40 | }) 41 | 42 | 43 | Returns (Tensor): 44 | loss based on VREx algorithm 45 | 46 | """ 47 | loss_list = [] 48 | for i in range(config.dataset.num_envs): 49 | env_idx = data.env_id == i 50 | if loss[env_idx].shape[0] > 0: 51 | loss_list.append(loss[env_idx].sum() / mask[env_idx].sum()) 52 | spec_loss = config.ood.ood_param * torch.var(torch.tensor(loss_list, device=config.device)) 53 | if torch.isnan(spec_loss): 54 | spec_loss = 0 55 | mean_loss = loss.sum() / mask.sum() 56 | loss = spec_loss + mean_loss 57 | self.mean_loss = mean_loss 58 | self.spec_loss = spec_loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/VREx.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | from GOOD import register 9 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | 12 | 13 | @register.ood_alg_register 14 | class VREx(BaseOODAlg): 15 | r""" 16 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 17 | `_ paper 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 21 | """ 22 | def __init__(self, config: Union[CommonArgs, Munch]): 23 | super(VREx, self).__init__(config) 24 | 25 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 26 | r""" 27 | Process loss based on VREx algorithm 28 | 29 | Args: 30 | loss (Tensor): base loss between model predictions and input labels 31 | data (Batch): input data 32 | mask (Tensor): NAN masks for data formats 33 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 34 | 35 | .. code-block:: python 36 | 37 | config = munchify({device: torch.device('cuda'), 38 | dataset: {num_envs: int(10)}, 39 | ood: {ood_param: float(0.1)} 40 | }) 41 | 42 | 43 | Returns (Tensor): 44 | loss based on VREx algorithm 45 | 46 | """ 47 | loss_list = [] 48 | for i in range(config.dataset.num_envs): 49 | env_idx = data.env_id == i 50 | if loss[env_idx].shape[0] > 0: 51 | loss_list.append(loss[env_idx].sum() / mask[env_idx].sum()) 52 | spec_loss = config.ood.ood_param * torch.var(torch.tensor(loss_list, device=config.device)) 53 | if torch.isnan(spec_loss): 54 | spec_loss = 0 55 | mean_loss = loss.sum() / mask.sum() 56 | loss = spec_loss + mean_loss 57 | self.mean_loss = mean_loss 58 | self.spec_loss = spec_loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/VREx.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | from GOOD import register 9 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | 12 | 13 | @register.ood_alg_register 14 | class VREx(BaseOODAlg): 15 | r""" 16 | Implementation of the VREx algorithm from `"Out-of-Distribution Generalization via Risk Extrapolation (REx)" 17 | `_ paper 18 | 19 | Args: 20 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 21 | """ 22 | def __init__(self, config: Union[CommonArgs, Munch]): 23 | super(VREx, self).__init__(config) 24 | 25 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 26 | r""" 27 | Process loss based on VREx algorithm 28 | 29 | Args: 30 | loss (Tensor): base loss between model predictions and input labels 31 | data (Batch): input data 32 | mask (Tensor): NAN masks for data formats 33 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 34 | 35 | .. code-block:: python 36 | 37 | config = munchify({device: torch.device('cuda'), 38 | dataset: {num_envs: int(10)}, 39 | ood: {ood_param: float(0.1)} 40 | }) 41 | 42 | 43 | Returns (Tensor): 44 | loss based on VREx algorithm 45 | 46 | """ 47 | loss_list = [] 48 | for i in range(config.dataset.num_envs): 49 | env_idx = data.env_id == i 50 | if loss[env_idx].shape[0] > 0: 51 | loss_list.append(loss[env_idx].sum() / mask[env_idx].sum()) 52 | spec_loss = config.ood.ood_param * torch.var(torch.tensor(loss_list, device=config.device)) 53 | if torch.isnan(spec_loss): 54 | spec_loss = 0 55 | mean_loss = loss.sum() / mask.sum() 56 | loss = spec_loss + mean_loss 57 | self.mean_loss = mean_loss 58 | self.spec_loss = spec_loss 59 | return loss 60 | -------------------------------------------------------------------------------- /GOOD/ood_algorithms/algorithms/GroupDRO.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseOOD import BaseOODAlg 12 | 13 | 14 | @register.ood_alg_register 15 | class GroupDRO(BaseOODAlg): 16 | r""" 17 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 18 | `_ paper 19 | 20 | Args: 21 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 22 | """ 23 | def __init__(self, config: Union[CommonArgs, Munch]): 24 | super(GroupDRO, self).__init__(config) 25 | 26 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 27 | r""" 28 | Process loss based on GroupDRO algorithm 29 | 30 | Args: 31 | loss (Tensor): base loss between model predictions and input labels 32 | data (Batch): input data 33 | mask (Tensor): NAN masks for data formats 34 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 35 | 36 | .. code-block:: python 37 | 38 | config = munchify({device: torch.device('cuda'), 39 | dataset: {num_envs: int(10)}, 40 | ood: {ood_param: float(0.1)} 41 | }) 42 | 43 | 44 | Returns (Tensor): 45 | loss based on GroupDRO algorithm 46 | 47 | """ 48 | loss_list = [] 49 | for i in range(config.dataset.num_envs): 50 | env_idx = data.env_id == i 51 | if loss[env_idx].shape[0] > 0: 52 | loss_list.append(loss[env_idx].sum() / mask.sum()) 53 | losses = torch.stack(loss_list) 54 | group_weights = torch.ones(losses.shape[0], device=config.device) 55 | group_weights *= torch.exp(config.ood.ood_param * losses) 56 | group_weights /= group_weights.sum() 57 | loss = losses @ group_weights 58 | self.mean_loss = loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Motif/GOOD/ood_algorithms/algorithms/GroupDRO.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseOOD import BaseOODAlg 12 | 13 | 14 | @register.ood_alg_register 15 | class GroupDRO(BaseOODAlg): 16 | r""" 17 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 18 | `_ paper 19 | 20 | Args: 21 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 22 | """ 23 | def __init__(self, config: Union[CommonArgs, Munch]): 24 | super(GroupDRO, self).__init__(config) 25 | 26 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 27 | r""" 28 | Process loss based on GroupDRO algorithm 29 | 30 | Args: 31 | loss (Tensor): base loss between model predictions and input labels 32 | data (Batch): input data 33 | mask (Tensor): NAN masks for data formats 34 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 35 | 36 | .. code-block:: python 37 | 38 | config = munchify({device: torch.device('cuda'), 39 | dataset: {num_envs: int(10)}, 40 | ood: {ood_param: float(0.1)} 41 | }) 42 | 43 | 44 | Returns (Tensor): 45 | loss based on GroupDRO algorithm 46 | 47 | """ 48 | loss_list = [] 49 | for i in range(config.dataset.num_envs): 50 | env_idx = data.env_id == i 51 | if loss[env_idx].shape[0] > 0: 52 | loss_list.append(loss[env_idx].sum() / mask.sum()) 53 | losses = torch.stack(loss_list) 54 | group_weights = torch.ones(losses.shape[0], device=config.device) 55 | group_weights *= torch.exp(config.ood.ood_param * losses) 56 | group_weights /= group_weights.sum() 57 | loss = losses @ group_weights 58 | self.mean_loss = loss 59 | return loss 60 | -------------------------------------------------------------------------------- /CMNIST/GOOD/ood_algorithms/algorithms/GroupDRO.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseOOD import BaseOODAlg 12 | 13 | 14 | @register.ood_alg_register 15 | class GroupDRO(BaseOODAlg): 16 | r""" 17 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 18 | `_ paper 19 | 20 | Args: 21 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 22 | """ 23 | def __init__(self, config: Union[CommonArgs, Munch]): 24 | super(GroupDRO, self).__init__(config) 25 | 26 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 27 | r""" 28 | Process loss based on GroupDRO algorithm 29 | 30 | Args: 31 | loss (Tensor): base loss between model predictions and input labels 32 | data (Batch): input data 33 | mask (Tensor): NAN masks for data formats 34 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 35 | 36 | .. code-block:: python 37 | 38 | config = munchify({device: torch.device('cuda'), 39 | dataset: {num_envs: int(10)}, 40 | ood: {ood_param: float(0.1)} 41 | }) 42 | 43 | 44 | Returns (Tensor): 45 | loss based on GroupDRO algorithm 46 | 47 | """ 48 | loss_list = [] 49 | for i in range(config.dataset.num_envs): 50 | env_idx = data.env_id == i 51 | if loss[env_idx].shape[0] > 0: 52 | loss_list.append(loss[env_idx].sum() / mask.sum()) 53 | losses = torch.stack(loss_list) 54 | group_weights = torch.ones(losses.shape[0], device=config.device) 55 | group_weights *= torch.exp(config.ood.ood_param * losses) 56 | group_weights /= group_weights.sum() 57 | loss = losses @ group_weights 58 | self.mean_loss = loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Molbbbp/GOOD/ood_algorithms/algorithms/GroupDRO.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseOOD import BaseOODAlg 12 | 13 | 14 | @register.ood_alg_register 15 | class GroupDRO(BaseOODAlg): 16 | r""" 17 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 18 | `_ paper 19 | 20 | Args: 21 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 22 | """ 23 | def __init__(self, config: Union[CommonArgs, Munch]): 24 | super(GroupDRO, self).__init__(config) 25 | 26 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 27 | r""" 28 | Process loss based on GroupDRO algorithm 29 | 30 | Args: 31 | loss (Tensor): base loss between model predictions and input labels 32 | data (Batch): input data 33 | mask (Tensor): NAN masks for data formats 34 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 35 | 36 | .. code-block:: python 37 | 38 | config = munchify({device: torch.device('cuda'), 39 | dataset: {num_envs: int(10)}, 40 | ood: {ood_param: float(0.1)} 41 | }) 42 | 43 | 44 | Returns (Tensor): 45 | loss based on GroupDRO algorithm 46 | 47 | """ 48 | loss_list = [] 49 | for i in range(config.dataset.num_envs): 50 | env_idx = data.env_id == i 51 | if loss[env_idx].shape[0] > 0: 52 | loss_list.append(loss[env_idx].sum() / mask.sum()) 53 | losses = torch.stack(loss_list) 54 | group_weights = torch.ones(losses.shape[0], device=config.device) 55 | group_weights *= torch.exp(config.ood.ood_param * losses) 56 | group_weights /= group_weights.sum() 57 | loss = losses @ group_weights 58 | self.mean_loss = loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Molhiv/GOOD/ood_algorithms/algorithms/GroupDRO.py: -------------------------------------------------------------------------------- 1 | """ 2 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 3 | `_ paper 4 | """ 5 | import torch 6 | from torch import Tensor 7 | from torch_geometric.data import Batch 8 | 9 | from GOOD import register 10 | from GOOD.utils.config_reader import Union, CommonArgs, Munch 11 | from .BaseOOD import BaseOODAlg 12 | 13 | 14 | @register.ood_alg_register 15 | class GroupDRO(BaseOODAlg): 16 | r""" 17 | Implementation of the GroupDRO algorithm from `"Distributionally Robust Neural Networks for Group Shifts: On the Importance of Regularization for Worst-Case Generalization" 18 | `_ paper 19 | 20 | Args: 21 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 22 | """ 23 | def __init__(self, config: Union[CommonArgs, Munch]): 24 | super(GroupDRO, self).__init__(config) 25 | 26 | def loss_postprocess(self, loss: Tensor, data: Batch, mask: Tensor, config: Union[CommonArgs, Munch], **kwargs) -> Tensor: 27 | r""" 28 | Process loss based on GroupDRO algorithm 29 | 30 | Args: 31 | loss (Tensor): base loss between model predictions and input labels 32 | data (Batch): input data 33 | mask (Tensor): NAN masks for data formats 34 | config (Union[CommonArgs, Munch]): munchified dictionary of args (:obj:`config.device`, :obj:`config.dataset.num_envs`, :obj:`config.ood.ood_param`) 35 | 36 | .. code-block:: python 37 | 38 | config = munchify({device: torch.device('cuda'), 39 | dataset: {num_envs: int(10)}, 40 | ood: {ood_param: float(0.1)} 41 | }) 42 | 43 | 44 | Returns (Tensor): 45 | loss based on GroupDRO algorithm 46 | 47 | """ 48 | loss_list = [] 49 | for i in range(config.dataset.num_envs): 50 | env_idx = data.env_id == i 51 | if loss[env_idx].shape[0] > 0: 52 | loss_list.append(loss[env_idx].sum() / mask.sum()) 53 | losses = torch.stack(loss_list) 54 | group_weights = torch.ones(losses.shape[0], device=config.device) 55 | group_weights *= torch.exp(config.ood.ood_param * losses) 56 | group_weights /= group_weights.sum() 57 | loss = losses @ group_weights 58 | self.mean_loss = loss 59 | return loss 60 | -------------------------------------------------------------------------------- /Molhiv/GOOD/kernel/pipeline.py: -------------------------------------------------------------------------------- 1 | r"""Kernel pipeline: main pipeline, initialization, task loading, etc. 2 | """ 3 | 4 | import time 5 | from typing import Tuple, Union 6 | 7 | import torch.nn 8 | from torch.utils.data import DataLoader 9 | 10 | from GOOD import config_summoner 11 | from GOOD.data import load_dataset, create_dataloader 12 | from GOOD.kernel.train import train 13 | from GOOD.networks.model_manager import load_model, config_model 14 | from GOOD.ood_algorithms.algorithms.BaseOOD import BaseOODAlg 15 | from GOOD.ood_algorithms.ood_manager import load_ood_alg 16 | from GOOD.utils.args import args_parser 17 | from GOOD.utils.config_reader import CommonArgs, Munch 18 | from GOOD.utils.initial import init 19 | from GOOD.utils.logger import load_logger 20 | 21 | 22 | def initialize_model_dataset(config: Union[CommonArgs, Munch]) -> Tuple[torch.nn.Module, Union[dict, DataLoader]]: 23 | r""" 24 | Fix random seeds and initialize a GNN and a dataset. (For project use only) 25 | 26 | Returns: 27 | A GNN and a data loader. 28 | """ 29 | # Initial 30 | init(config) 31 | 32 | print(f'#IN#\n-----------------------------------\n Task: {config.task}\n' 33 | f'{time.asctime(time.localtime(time.time()))}') 34 | # Load dataset 35 | print(f'#IN#Load Dataset {config.dataset.dataset_name}') 36 | dataset = load_dataset(config.dataset.dataset_name, config) 37 | print(f"#D#Dataset: {dataset}") 38 | print('#D#', dataset['train'][0] if type(dataset) is dict else dataset[0]) 39 | 40 | loader = create_dataloader(dataset, config) 41 | 42 | # Load model 43 | print('#IN#Loading model...') 44 | model = load_model(config.model.model_name, config) 45 | 46 | return model, loader 47 | 48 | 49 | def load_task(task: str, model: torch.nn.Module, loader: DataLoader, ood_algorithm: BaseOODAlg, 50 | config: Union[CommonArgs, Munch]): 51 | r""" 52 | Launch a training or a test. (Project use only) 53 | """ 54 | if task == 'train': 55 | train(model, loader, ood_algorithm, config) 56 | 57 | elif task == 'test': 58 | 59 | # config model 60 | print('#D#Config model and output the best checkpoint info...') 61 | test_score, test_loss = config_model(model, 'test', config=config) 62 | 63 | 64 | def main(): 65 | args = args_parser() 66 | config = config_summoner(args) 67 | load_logger(config) 68 | 69 | model, loader = initialize_model_dataset(config) 70 | ood_algorithm = load_ood_alg(config.ood.ood_alg, config) 71 | 72 | load_task(config.task, model, loader, ood_algorithm, config) 73 | 74 | if config.task == 'train': 75 | load_task('test', model, loader, ood_algorithm, config) 76 | 77 | 78 | if __name__ == '__main__': 79 | main() 80 | -------------------------------------------------------------------------------- /utils.py: -------------------------------------------------------------------------------- 1 | import torch 2 | import numpy as np 3 | import random 4 | import pdb 5 | from torch_geometric.transforms import BaseTransform 6 | 7 | def get_info_dataset(args, dataset, split_idx): 8 | 9 | total = [] 10 | for mode in ['train', 'valid', 'test']: 11 | mode_max_node = 0 12 | mode_min_node = 9999 13 | mode_avg_node = 0 14 | mode_tot_node = 0.0 15 | 16 | dataset_name = dataset[split_idx[mode]] 17 | mode_num_graphs = len(dataset_name) 18 | for data in dataset_name: 19 | num_node = data.num_nodes 20 | mode_tot_node += num_node 21 | if num_node > mode_max_node: 22 | mode_max_node = num_node 23 | if num_node < mode_min_node: 24 | mode_min_node = num_node 25 | print("{} {:<5} | Graphs num:{:<5} | Node num max:{:<4}, min:{:<4}, avg:{:.2f}" 26 | .format(args.dataset, mode, mode_num_graphs, 27 | mode_max_node, 28 | mode_min_node, 29 | mode_tot_node / mode_num_graphs)) 30 | total.append(mode_num_graphs) 31 | all_graph_num = sum(total) 32 | print("train:{:.2f}%, val:{:.2f}%, test:{:.2f}%" 33 | .format(float(total[0]) * 100 / all_graph_num, 34 | float(total[1]) * 100 / all_graph_num, 35 | float(total[2]) * 100 / all_graph_num)) 36 | 37 | def size_split_idx(dataset, mode): 38 | 39 | num_graphs = len(dataset) 40 | num_val = int(0.1 * num_graphs) 41 | num_test = int(0.1 * num_graphs) 42 | num_train = num_graphs - num_test - num_val 43 | 44 | num_node_list = [] 45 | train_idx = [] 46 | valtest_list = [] 47 | 48 | for data in dataset: 49 | num_node_list.append(data.num_nodes) 50 | 51 | sort_list = np.argsort(num_node_list) 52 | 53 | if mode == 'ls': 54 | train_idx = sort_list[2 * num_val:] 55 | valid_test_idx = sort_list[:2 * num_val] 56 | else: 57 | train_idx = sort_list[:-2 * num_val] 58 | valid_test_idx = sort_list[-2 * num_val:] 59 | random.shuffle(valid_test_idx) 60 | valid_idx = valid_test_idx[:num_val] 61 | test_idx = valid_test_idx[num_val:] 62 | 63 | split_idx = {'train': torch.tensor(train_idx, dtype = torch.long), 64 | 'valid': torch.tensor(valid_idx, dtype = torch.long), 65 | 'test': torch.tensor(test_idx, dtype = torch.long)} 66 | return split_idx 67 | 68 | 69 | 70 | class ToEnvs(BaseTransform): 71 | 72 | def __init__(self, envs=10): 73 | self.envs = envs 74 | 75 | def __call__(self, data): 76 | 77 | data.env_id = torch.randint(0, self.envs, (1,)) 78 | return data 79 | --------------------------------------------------------------------------------