From 9abbe9fe76c245ff9352902e47b408a719c0ac4b Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Sat, 8 Aug 2026 11:23:01 +0200 Subject: [PATCH 01/26] chebi aug variant with all props except node level --- .../preprocessing/datasets/__init__.py | 4 +++- .../datasets/augmentation_base.py | 7 ++++++ chebai_graph/preprocessing/datasets/chebi.py | 7 ++++++ .../chebi50_all_props_except_node_lvl.yml | 24 +++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml diff --git a/chebai_graph/preprocessing/datasets/__init__.py b/chebai_graph/preprocessing/datasets/__init__.py index 9ee9856..c1e0a23 100644 --- a/chebai_graph/preprocessing/datasets/__init__.py +++ b/chebai_graph/preprocessing/datasets/__init__.py @@ -1,4 +1,5 @@ from .chebi import ( + ChEBI25GraphProperties, ChEBI50_Atom_WGNOnly_GraphProp, ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE, ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE, @@ -9,6 +10,7 @@ ChEBI50_StaticGNI, ChEBI50_WFGE_NGN_GraphProp, ChEBI50_WFGE_WGN_AsPerNodeType, + ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel, ChEBI50_WFGE_WGN_ForAtomAndFGLevelOnly, ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly, ChEBI50_WFGE_WGN_ForAtomLevelOnly, @@ -18,7 +20,6 @@ ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes, ChEBI50_WFGE_WGN_GraphProp, ChEBI50GraphData, - ChEBI25GraphProperties, ChEBI50GraphProperties, ChEBI100GraphProperties, ) @@ -60,6 +61,7 @@ "ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly", "ChEBI50_WFGE_WGN_ForFGLevelAndGraphNodeOnly", "ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes", + "ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel", "BACE_WFGE_WGN_AsPerNodeType", "BBBP_WFGE_WGN_AsPerNodeType", "ClinTox_WFGE_WGN_AsPerNodeType", diff --git a/chebai_graph/preprocessing/datasets/augmentation_base.py b/chebai_graph/preprocessing/datasets/augmentation_base.py index 9bf6cdc..20ce564 100644 --- a/chebai_graph/preprocessing/datasets/augmentation_base.py +++ b/chebai_graph/preprocessing/datasets/augmentation_base.py @@ -177,3 +177,10 @@ def _fill_node_tensor_with_molecule_type_property( is_graph_node: torch.Tensor, ) -> torch.Tensor: return node_tensor + + +class GraphPropAllPropsExceptNodeLevel(GraphPropAsPerNodeType): + def _fill_node_tensor_with_all_node_type_property( + self, node_tensor: torch.Tensor, property_values: torch.Tensor, offset: int + ) -> torch.Tensor: + return node_tensor diff --git a/chebai_graph/preprocessing/datasets/chebi.py b/chebai_graph/preprocessing/datasets/chebi.py index 1962c31..c4ac4ed 100644 --- a/chebai_graph/preprocessing/datasets/chebi.py +++ b/chebai_graph/preprocessing/datasets/chebi.py @@ -25,6 +25,7 @@ from .augmentation_base import ( AugGraphPropMixIn_NoGraphNode, AugGraphPropMixIn_WithGraphNode, + GraphPropAllPropsExceptNodeLevel, GraphPropForAtomAndFGLevelOnly, GraphPropForAtomLevelAndGraphNodeOnly, GraphPropForAtomLevelOnly, @@ -204,6 +205,12 @@ class ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes( READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel( + GraphPropAllPropsExceptNodeLevel, ChEBIOver50 +): + READER = AtomFGReader_WithFGEdges_WithGraphNode + + # ---------- Final Augmentation: Different Thresholds ------------------------------ class ChEBI100_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver100): READER = AtomFGReader_WithFGEdges_WithGraphNode diff --git a/configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml b/configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml new file mode 100644 index 0000000..a03da69 --- /dev/null +++ b/configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType From 05462dacf410bd216416aff568507cb100576a57 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Mon, 10 Aug 2026 20:42:36 +0200 Subject: [PATCH 02/26] allow adding new tokens through augmented class for atom specific props --- chebai_graph/preprocessing/properties/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chebai_graph/preprocessing/properties/base.py b/chebai_graph/preprocessing/properties/base.py index f148df8..1f2e0aa 100644 --- a/chebai_graph/preprocessing/properties/base.py +++ b/chebai_graph/preprocessing/properties/base.py @@ -209,8 +209,8 @@ def on_finish(self) -> None: hasattr(self.encoder, "cache") and len(self.encoder.cache) > self.encoder.index_length_start ): - raise ValueError( - f"{self.__class__.__name__} attempted to add new tokens " + print( + f"{self.__class__.__name__} added new tokens " f"to a frozen encoder at {self.encoder.index_path}" ) super().on_finish() From d26b9b9e04179b0ce851c75f74c47ec6e221d7f0 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Mon, 10 Aug 2026 20:42:52 +0200 Subject: [PATCH 03/26] BACE dataset tokens --- .../bin/bace/AtomCharge/indices_one_hot.txt | 3 ++ .../AtomFunctionalGroup/indices_one_hot.txt | 44 +++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 3 ++ .../bace/AtomNodeLevel/indices_one_hot.txt | 3 ++ .../bin/bace/AtomNumHs/indices_one_hot.txt | 4 ++ .../bin/bace/AtomType/indices_one_hot.txt | 8 ++++ .../bin/bace/BondLevel/indices_one_hot.txt | 4 ++ .../bin/bace/BondType/indices_one_hot.txt | 4 ++ .../bin/bace/NumAtomBonds/indices_one_hot.txt | 4 ++ 9 files changed, 77 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..d7e52d1 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomCharge/indices_one_hot.txt @@ -0,0 +1,3 @@ +0 +1 +-1 diff --git a/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..b621c2a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,44 @@ +RING_6 +difluoromethyl +RING_5 +ether +alkyne +alkyl +primary_amine +fluoro +amide +graph_fg +NO_FG +alkene +tertiary_carbon +alkene_carbon +nitrile +trifluoromethyl +ketone +chloro +quaternary_carbon +sulfonyl +hydroxyl +bromo +secondary_amine +ester +aldoxime +sulfide +iodo +tertiary_amine +RING_4 +secondary_ketimine +ketoxime +RING_3 +carboxylate +acetal +sulfinyl +RING_7 +RING_16 +RING_15 +nitro +primary_ketimine +sulfonate_ester +RING_8 +RING_14 +RING_13 diff --git a/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..7c99da3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,3 @@ +SP2 +SP3 +SP diff --git a/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..c4b216a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +0 +1 +3 +2 diff --git a/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..6da4980 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/AtomType/indices_one_hot.txt @@ -0,0 +1,8 @@ +6 +7 +8 +9 +17 +16 +35 +53 diff --git a/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f1a2ce5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +TRIPLE +DOUBLE diff --git a/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..cf286d6 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bace/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,4 @@ +3 +2 +4 +1 From 1ce48efaba747c6e84938c5a78ade85800ebae46 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Tue, 11 Aug 2026 23:59:57 +0200 Subject: [PATCH 04/26] check len of base_df after merge, to avoid memory blow due to duplicated entries leading to cross merge --- chebai_graph/preprocessing/datasets/base.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/chebai_graph/preprocessing/datasets/base.py b/chebai_graph/preprocessing/datasets/base.py index 4e8e6c3..84d42be 100644 --- a/chebai_graph/preprocessing/datasets/base.py +++ b/chebai_graph/preprocessing/datasets/base.py @@ -462,6 +462,7 @@ def load_processed_data( base_data = super().load_processed_data(kind, filename) base_df = pd.DataFrame(base_data) base_df["ident"] = base_df["ident"].astype(str) + len_base_df_before_merge = len(base_df) props_categories = { "AllNodeTypeProperties": [], "FGNodeTypeProperties": [], @@ -524,11 +525,21 @@ def load_processed_data( ) property_df = pd.DataFrame(property_data) + assert len(property_df) == len(property_df["ident"].unique()), ( + f"Duplicate entries found in property {property.name} data. " + f"Unique entries {len(property_df['ident'].unique())}. " + f"Total entries {len(property_df)}. " + ) property_df["ident"] = property_df["ident"].astype(str) property_df.rename( columns={property.name: f"{property.name}"}, inplace=True ) + base_df = base_df.merge(property_df, on="ident", how="left") + assert len(base_df) == len_base_df_before_merge, ( + f"Length mismatch after merging property {property.name}. " + f"Expected {len_base_df_before_merge}, got {len(base_df)}" + ) base_df["features"] = base_df.apply( lambda row: self._merge_props_into_base( From f590aebb32fcc2a7549680f41896fcc32588ca2e Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Wed, 12 Aug 2026 13:56:52 +0200 Subject: [PATCH 05/26] BBBP tokens --- .../bin/bbbp/AtomCharge/indices_one_hot.txt | 4 + .../AtomFunctionalGroup/indices_one_hot.txt | 80 +++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 4 + .../bbbp/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/bbbp/AtomNumHs/indices_one_hot.txt | 4 + .../bin/bbbp/AtomType/indices_one_hot.txt | 13 +++ .../bin/bbbp/BondLevel/indices_one_hot.txt | 4 + .../bin/bbbp/BondType/indices_one_hot.txt | 4 + .../bin/bbbp/NumAtomBonds/indices_one_hot.txt | 5 ++ 9 files changed, 121 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..7b6a00a --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomCharge/indices_one_hot.txt @@ -0,0 +1,4 @@ +0 +1 +-1 +2 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..d2ee211 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,80 @@ +alkyl +ester +chloro +RING_6 +tertiary_amine +graph_fg +tertiary_carbon +primary_amine +dichloromethyl +sulfonyl +ketone +secondary_amine +hydroxyl +ether +quaternary_carbon +amide +NO_FG +carboxyl +nitro +alkene +alkene_carbon +secondary_ketimine +secondary_aldimine +carboxylate +iodo +aldoxime +bromo +alkyne +fluoro +carbamate +trifluoromethyl +sulfide +trichloromethyl +hemiacetal +primary_ketimine +azide +4_ammonium_ion +sulfonate_ester +ketoxime +nitroso +sulfhydryl +difluoromethyl +fluorochloromethyl +chlorobromomethyl +phosphono +carbodithio +disulfide +difluorochloromethyl +carbonate_ester +phosphate +RING_5 +thiolester +RING_7 +nitrile +phosphoryl +aldehyde +sulfinyl +thioketone +acetal +RING_4 +sulfonic_acid +imide +RING_14 +RING_24 +amidine +RING_3 +RING_9 +RING_19 +RING_16 +RING_8 +isonitrile +RING_23 +RING_12 +RING_21 +RING_17 +RING_30 +RING_33 +RING_36 +azo +RING_15 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..0e4a9aa --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,4 @@ +SP3 +SP2 +S +SP diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..35f5032 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +2 +0 +1 +3 diff --git a/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..9500570 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt @@ -0,0 +1,13 @@ +6 +17 +8 +7 +16 +11 +53 +35 +9 +1 +15 +5 +20 diff --git a/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt new file mode 100644 index 0000000..a134437 --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +DOUBLE +SINGLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..5d07eee --- /dev/null +++ b/chebai_graph/preprocessing/bin/bbbp/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,5 @@ +2 +4 +1 +3 +0 From f4cb1ace533ddbbebcb2a40d046c59bb4317ef37 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Wed, 12 Aug 2026 14:27:20 +0200 Subject: [PATCH 06/26] hiv tokens --- .../bin/hiv/AtomCharge/indices_one_hot.txt | 9 ++ .../AtomFunctionalGroup/indices_one_hot.txt | 122 ++++++++++++++++++ .../hiv/AtomHybridization/indices_one_hot.txt | 7 + .../bin/hiv/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/hiv/AtomNumHs/indices_one_hot.txt | 5 + .../bin/hiv/AtomType/indices_one_hot.txt | 54 ++++++++ .../bin/hiv/BondLevel/indices_one_hot.txt | 0 .../bin/hiv/BondType/indices_one_hot.txt | 0 .../bin/hiv/NumAtomBonds/indices_one_hot.txt | 0 9 files changed, 200 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..22aacd7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomCharge/indices_one_hot.txt @@ -0,0 +1,9 @@ +0 +1 +-1 +3 +-4 +-3 +-2 +2 +-5 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..e5b33d4 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,122 @@ +alkyl +RING_6 +chloro +NO_FG +secondary_amine +graph_fg +carboxyl +primary_amine +sulfonic_acid +nitro +ketone +hydroxyl +sulfonyl +ester +nitroso +sulfhydryl +tertiary_carbon +tertiary_amine +dichloromethyl +nitrile +primary_ketimine +alkyne +alkene +ether +iodo +sulfide +secondary_aldimine +phosphoryl +thioketone +alkene_carbon +secondary_ketimine +nitrate +4_ammonium_ion +ketoxime +amide +amidine +trichloromethyl +fluoro +quaternary_carbon +hydrazone +disulfide +thiocyanate +carbamate +trifluoromethyl +phosphate +sulfonate_ester +sulfinyl +azo +bromo +imide +carbodithioic_acid +carbodithio +sulfino +silyl_ether +aldehyde +phosphono +azide +aldoxime +phosphino +trimethylsilyl +thionoester +thiolester +isonitrile +acetal +difluorochloromethyl +dibromomethyl +ketal +diiodomethyl +borono +isothiocyanate +difluoromethyl +tribromomethyl +carbonate_ester +hemiacetal +phosphodiester +carboxylate +orthoester +isocyanate +primary_aldimine +hemiketal +borinate +RING_5 +cyanate +RING_4 +RING_24 +RING_3 +thial +RING_7 +RING_12 +RING_9 +RING_16 +hydroperoxy +RING_15 +RING_18 +RING_8 +RING_35 +RING_10 +RING_19 +RING_17 +RING_29 +RING_23 +RING_27 +RING_11 +RING_14 +RING_20 +RING_33 +RING_13 +RING_31 +RING_21 +RING_28 +RING_22 +RING_30 +RING_34 +RING_54 +RING_38 +RING_36 +RING_26 +RING_32 +carboxylic_anhydride +RING_25 +carbothioic_S-acid +RING_40 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..cdc6985 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +SP3D +UNSPECIFIED diff --git a/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..df4a3e9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +3 +1 +0 +2 +4 diff --git a/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..95c9cba --- /dev/null +++ b/chebai_graph/preprocessing/bin/hiv/AtomType/indices_one_hot.txt @@ -0,0 +1,54 @@ +6 +17 +8 +7 +15 +16 +33 +53 +9 +35 +14 +11 +34 +79 +50 +80 +32 +51 +82 +5 +19 +3 +83 +29 +67 +44 +65 +74 +27 +55 +25 +26 +75 +42 +78 +47 +24 +46 +89 +20 +31 +12 +30 +28 +77 +1 +40 +81 +45 +22 +52 +64 +92 +23 diff --git a/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..e69de29 diff --git a/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt new file mode 100644 index 0000000..e69de29 diff --git a/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..e69de29 From d2b439dfd8a3fa0eb38e94d5bcb839b2e4f8566e Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Wed, 12 Aug 2026 15:02:52 +0200 Subject: [PATCH 07/26] clintox tokens --- .../clin_tox/AtomCharge/indices_one_hot.txt | 6 ++ .../AtomFunctionalGroup/indices_one_hot.txt | 84 +++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 7 ++ .../AtomNodeLevel/indices_one_hot.txt | 3 + .../clin_tox/AtomNumHs/indices_one_hot.txt | 4 + .../bin/clin_tox/AtomType/indices_one_hot.txt | 30 +++++++ .../clin_tox/BondLevel/indices_one_hot.txt | 4 + .../bin/clin_tox/BondType/indices_one_hot.txt | 5 ++ .../clin_tox/NumAtomBonds/indices_one_hot.txt | 6 ++ 9 files changed, 149 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..374de68 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +-1 +1 +3 +2 +-2 diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..36bc343 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,84 @@ +alkyl +chloro +RING_6 +ether +secondary_amine +fluoro +graph_fg +tertiary_carbon +hydroxyl +ketone +sulfonyl +carboxylate +RING_5 +NO_FG +amide +sulfide +RING_4 +quaternary_carbon +alkyne +alkene +primary_amine +carboxyl +trifluoromethyl +ester +alkene_carbon +RING_20 +sulfhydryl +nitrile +RING_3 +RING_29 +RING_7 +4_ammonium_ion +acetal +RING_9 +iodo +RING_38 +sulfinyl +difluoromethyl +imide +RING_16 +tertiary_amine +nitro +RING_8 +secondary_ketimine +nitrate +sulfonic_acid +carbamate +secondary_aldimine +bromo +thioketone +RING_14 +azo +RING_33 +trichloromethyl +RING_15 +ketoxime +phosphodiester +RING_24 +RING_22 +aldehyde +RING_18 +RING_21 +nitroso +dichloromethyl +carbonate_ester +silyl_ether +thiolester +borono +aldoxime +sulfonate_ester +RING_23 +RING_19 +RING_25 +carbodithio +disulfide +RING_36 +RING_31 +fluorochloromethyl +RING_12 +phosphate +azide +chlorobromomethyl +bromodifluoromethyl +phosphino diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..a96b9b3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +UNSPECIFIED +SP3D diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..1127527 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +3 +0 +2 +1 diff --git a/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..2c8a324 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/AtomType/indices_one_hot.txt @@ -0,0 +1,30 @@ +6 +17 +7 +8 +9 +16 +15 +53 +80 +1 +13 +35 +79 +0 +27 +22 +78 +33 +34 +30 +14 +5 +29 +24 +81 +43 +83 +25 +20 +26 diff --git a/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt new file mode 100644 index 0000000..bdc90d7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/BondType/indices_one_hot.txt @@ -0,0 +1,5 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE +DATIVE diff --git a/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..3c2db51 --- /dev/null +++ b/chebai_graph/preprocessing/bin/clin_tox/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +3 +2 +4 +0 +6 From 3a8b8ed3370ee628d3ef1ce0717135a9a95f6260 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Wed, 12 Aug 2026 15:03:55 +0200 Subject: [PATCH 08/26] sider tokens --- .../bin/sider/AtomCharge/indices_one_hot.txt | 6 ++ .../AtomFunctionalGroup/indices_one_hot.txt | 93 +++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 6 ++ .../sider/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/sider/AtomNumHs/indices_one_hot.txt | 5 + .../bin/sider/AtomType/indices_one_hot.txt | 40 ++++++++ .../bin/sider/BondLevel/indices_one_hot.txt | 4 + .../bin/sider/BondType/indices_one_hot.txt | 4 + .../sider/NumAtomBonds/indices_one_hot.txt | 6 ++ 9 files changed, 167 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..6f89a5d --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +1 +-1 +3 +2 +-2 diff --git a/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..6fbc2c2 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,93 @@ +alkyl +RING_6 +carboxyl +alkene +fluoro +sulfinyl +RING_5 +graph_fg +tertiary_carbon +secondary_amine +ketone +primary_amine +primary_ketimine +NO_FG +sulfide +hydroxyl +sulfonic_acid +bromo +4_ammonium_ion +chloro +quaternary_carbon +ether +carboxylate +tertiary_amine +amide +RING_3 +trifluoromethyl +ester +nitro +sulfonyl +iodo +secondary_ketimine +RING_7 +aldehyde +phosphono +alkyne +nitrile +carbamate +alkene_carbon +carbonate_ester +RING_4 +RING_18 +RING_24 +RING_14 +imide +sulfonate_ester +RING_81 +RING_20 +RING_8 +nitroso +RING_29 +RING_16 +RING_12 +RING_21 +sulfhydryl +thiolester +difluoromethyl +thioketone +RING_25 +RING_78 +RING_68 +RING_77 +nitrate +azo +RING_36 +phosphate +ketoxime +secondary_aldimine +dichloromethyl +carboxylic_anhydride +RING_33 +borono +RING_15 +diiodomethyl +RING_23 +carbodithio +disulfide +acetal +RING_40 +phosphodiester +fluorochloromethyl +RING_22 +RING_10 +RING_9 +azide +phosphino +RING_31 +RING_28 +RING_53 +RING_56 +RING_41 +RING_43 +RING_35 diff --git a/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..e9958eb --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,6 @@ +SP3 +SP2 +S +SP3D +SP +SP3D2 diff --git a/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..df4a3e9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +3 +1 +0 +2 +4 diff --git a/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..384eb37 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/AtomType/indices_one_hot.txt @@ -0,0 +1,40 @@ +6 +8 +9 +16 +7 +35 +17 +11 +64 +15 +24 +53 +47 +49 +1 +25 +29 +20 +62 +3 +19 +78 +39 +43 +31 +26 +5 +12 +38 +79 +33 +30 +56 +98 +34 +32 +27 +88 +81 +57 diff --git a/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..dfb5c6d --- /dev/null +++ b/chebai_graph/preprocessing/bin/sider/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +2 +3 +4 +0 +6 From 13234d125ac7674e72131531ab3c37118e1be4cb Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Wed, 12 Aug 2026 17:31:41 +0200 Subject: [PATCH 09/26] HIV tokens --- .../bin/hiv/BondLevel/indices_one_hot.txt | 4 ++++ .../bin/hiv/BondType/indices_one_hot.txt | 5 +++++ .../bin/hiv/NumAtomBonds/indices_one_hot.txt | 11 +++++++++++ 3 files changed, 20 insertions(+) diff --git a/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt index e69de29..6b48d66 100644 --- a/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt +++ b/chebai_graph/preprocessing/bin/hiv/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt index e69de29..58c0a5c 100644 --- a/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt +++ b/chebai_graph/preprocessing/bin/hiv/BondType/indices_one_hot.txt @@ -0,0 +1,5 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE +DATIVE diff --git a/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt index e69de29..88ddb48 100644 --- a/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt +++ b/chebai_graph/preprocessing/bin/hiv/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,11 @@ +1 +2 +3 +4 +0 +5 +6 +9 +7 +8 +10 From 185b78d7f5afe966257497820e33888b64d3355a Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Thu, 13 Aug 2026 12:18:36 +0200 Subject: [PATCH 10/26] muv tokens --- .../bin/muv/AtomCharge/indices_one_hot.txt | 3 + .../AtomFunctionalGroup/indices_one_hot.txt | 68 +++++++++++++++++++ .../muv/AtomHybridization/indices_one_hot.txt | 3 + .../bin/muv/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/muv/AtomNumHs/indices_one_hot.txt | 4 ++ .../bin/muv/AtomType/indices_one_hot.txt | 7 ++ .../bin/muv/BondLevel/indices_one_hot.txt | 4 ++ .../bin/muv/BondType/indices_one_hot.txt | 4 ++ .../bin/muv/NumAtomBonds/indices_one_hot.txt | 4 ++ 9 files changed, 100 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..d7e52d1 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomCharge/indices_one_hot.txt @@ -0,0 +1,3 @@ +0 +1 +-1 diff --git a/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..c55dc92 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,68 @@ +primary_amine +RING_6 +ketone +carboxyl +alkyl +tertiary_carbon +secondary_amine +graph_fg +hydroxyl +alkene +thioketone +bromo +fluoro +ester +ether +tertiary_amine +NO_FG +chloro +sulfonyl +difluoromethyl +quaternary_carbon +nitro +amide +alkyne +trifluoromethyl +aldoxime +alkene_carbon +nitrile +sulfide +secondary_aldimine +ketoxime +carbodithio +secondary_ketimine +thionoester +thiolester +sulfinyl +carbamate +thiocyanate +aldehyde +sulfonate_ester +amidine +trichloromethyl +sulfhydryl +sulfonic_acid +RING_5 +nitroso +acetal +carbonate_ester +imide +azo +primary_ketimine +dichloromethyl +RING_7 +RING_3 +RING_8 +hydrazone +RING_4 +RING_15 +RING_12 +azide +RING_13 +RING_18 +difluorochloromethyl +RING_14 +RING_9 +RING_11 +disulfide +4_ammonium_ion diff --git a/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..7c99da3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,3 @@ +SP2 +SP3 +SP diff --git a/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..52db5ae --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,4 @@ +2 +1 +0 +3 diff --git a/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..c36ddc7 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/AtomType/indices_one_hot.txt @@ -0,0 +1,7 @@ +7 +6 +8 +35 +9 +16 +17 diff --git a/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..94ebaf9 --- /dev/null +++ b/chebai_graph/preprocessing/bin/muv/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,4 @@ +1 +2 +3 +4 From b6bc71d12d42bb20ab1e84028c02c525bbd53b81 Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Fri, 14 Aug 2026 23:11:50 +0200 Subject: [PATCH 11/26] pcba tokens --- .../bin/pcba/AtomCharge/indices_one_hot.txt | 8 ++ .../AtomFunctionalGroup/indices_one_hot.txt | 127 ++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 7 + .../pcba/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/pcba/AtomNumHs/indices_one_hot.txt | 6 + .../bin/pcba/AtomType/indices_one_hot.txt | 44 ++++++ .../bin/pcba/BondLevel/indices_one_hot.txt | 4 + .../bin/pcba/BondType/indices_one_hot.txt | 4 + .../bin/pcba/NumAtomBonds/indices_one_hot.txt | 6 + 9 files changed, 209 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..7897486 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomCharge/indices_one_hot.txt @@ -0,0 +1,8 @@ +0 +1 +-1 +3 +2 +4 +5 +6 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..89e00f3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,127 @@ +alkyl +RING_6 +sulfide +RING_5 +ketone +trifluoromethyl +secondary_amine +graph_fg +NO_FG +amide +sulfonyl +ether +quaternary_carbon +tertiary_carbon +imide +carboxyl +nitrile +ester +primary_amine +alkyne +fluoro +tertiary_amine +nitro +RING_7 +chloro +hydroxyl +RING_3 +alkene +secondary_aldimine +bromo +thioketone +sulfinyl +RING_4 +secondary_ketimine +RING_12 +primary_ketimine +alkene_carbon +carbamate +aldehyde +phosphoryl +trimethylsilyl +carboxylate +ketoxime +RING_23 +difluoromethyl +sulfonate_ester +RING_14 +iodo +thiocyanate +RING_8 +disulfide +carbonate_ester +RING_19 +sulfhydryl +nitroso +acetal +aldoxime +borono +RING_16 +phosphono +RING_9 +RING_15 +hydrazone +RING_11 +4_ammonium_ion +thiolester +trichloromethyl +carbodithio +azo +azide +sulfonic_acid +dichloromethyl +phosphodiester +borinate +RING_13 +RING_18 +thial +RING_21 +RING_10 +isocyanate +isonitrile +RING_22 +RING_36 +RING_20 +phosphate +amidine +dibromomethyl +RING_17 +peroxy +RING_40 +silyl_ether +thionoester +nitrate +haloformyl +hemiacetal +RING_25 +isothiocyanate +difluorochloromethyl +RING_24 +nitrosooxy +RING_32 +carbodithioic_acid +hydroperoxy +sulfino +RING_26 +tribromomethyl +RING_30 +RING_29 +diiodomethyl +phosphino +chlorobromomethyl +RING_33 +RING_38 +RING_34 +bromodifluoromethyl +carboxylic_anhydride +bromodichloromethyl +RING_27 +dichlorosilane +RING_42 +ketal +RING_28 +RING_56 +RING_31 +RING_35 +fluorochloromethyl +RING_54 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..fb3232b --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +SP3D +S +UNSPECIFIED +SP3D2 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..cad2399 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,6 @@ +3 +1 +0 +2 +6 +4 diff --git a/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..166ffe2 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/AtomType/indices_one_hot.txt @@ -0,0 +1,44 @@ +6 +16 +7 +8 +9 +17 +35 +15 +14 +53 +5 +29 +79 +38 +50 +30 +33 +34 +48 +51 +1 +26 +82 +27 +78 +80 +3 +28 +22 +56 +44 +11 +13 +46 +25 +83 +47 +60 +24 +64 +32 +49 +74 +31 diff --git a/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt new file mode 100644 index 0000000..c819d38 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE diff --git a/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..2efbda4 --- /dev/null +++ b/chebai_graph/preprocessing/bin/pcba/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,6 @@ +1 +2 +3 +4 +0 +5 From 695fe571dcf3620867b451732d115e508742da0b Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Sat, 15 Aug 2026 11:52:27 +0200 Subject: [PATCH 12/26] tox21 tokens --- .../bin/tox21/AtomCharge/indices_one_hot.txt | 6 + .../AtomFunctionalGroup/indices_one_hot.txt | 115 +++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 7 ++ .../tox21/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/tox21/AtomNumHs/indices_one_hot.txt | 6 + .../bin/tox21/AtomType/indices_one_hot.txt | 50 ++++++++ .../bin/tox21/BondLevel/indices_one_hot.txt | 4 + .../bin/tox21/BondType/indices_one_hot.txt | 4 + .../tox21/NumAtomBonds/indices_one_hot.txt | 7 ++ .../toxcast/AtomCharge/indices_one_hot.txt | 6 + .../AtomFunctionalGroup/indices_one_hot.txt | 117 ++++++++++++++++++ .../AtomHybridization/indices_one_hot.txt | 7 ++ .../toxcast/AtomNodeLevel/indices_one_hot.txt | 3 + .../bin/toxcast/AtomNumHs/indices_one_hot.txt | 5 + .../bin/toxcast/AtomType/indices_one_hot.txt | 53 ++++++++ .../bin/toxcast/BondLevel/indices_one_hot.txt | 4 + .../bin/toxcast/BondType/indices_one_hot.txt | 4 + .../toxcast/NumAtomBonds/indices_one_hot.txt | 7 ++ 18 files changed, 408 insertions(+) create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt create mode 100644 chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt diff --git a/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..a8bd8c3 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +1 +-1 +2 +3 +-2 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..5aa0016 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,115 @@ +alkyl +hemiacetal +ether +graph_fg +RING_18 +NO_FG +RING_6 +ester +tertiary_carbon +secondary_amine +ketone +carboxyl +RING_5 +amide +primary_amine +RING_4 +carboxylate +alkene +nitro +imide +4_ammonium_ion +bromo +chloro +hydroxyl +sulfonyl +fluoro +quaternary_carbon +alkene_carbon +RING_3 +alkyne +secondary_ketimine +nitrile +isocyanate +azo +tertiary_amine +trifluoromethyl +aldehyde +thiolester +sulfide +nitroso +phosphate +phosphoryl +RING_7 +iodo +acetal +carbodithio +carbonate_ester +RING_21 +difluoromethyl +disulfide +RING_25 +nitrate +carbamate +secondary_aldimine +sulfonic_acid +haloformyl +amidine +sulfhydryl +phosphono +dibromomethyl +RING_23 +trichloromethyl +sulfonate_ester +RING_40 +RING_24 +RING_15 +primary_ketimine +RING_29 +thioketone +aldoxime +RING_16 +nitrosooxy +sulfino +RING_36 +peroxy +RING_14 +ketoxime +thiocyanate +RING_8 +RING_17 +sulfinyl +dichloromethyl +primary_aldimine +tribromomethyl +RING_19 +RING_9 +silyl_ether +phosphodiester +RING_33 +azide +RING_27 +RING_26 +RING_20 +phosphino +RING_12 +trimethylsilyl +carboxylic_anhydride +orthoester +RING_10 +thionoester +isothiocyanate +borono +chlorobromomethyl +dichlorosilane +hydroperoxy +RING_35 +RING_30 +RING_28 +fluorochloromethyl +RING_13 +bromodichloromethyl +ketal +difluorochloromethyl +bromodifluoromethyl +RING_11 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..cdc6985 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP3 +SP2 +SP +S +SP3D2 +SP3D +UNSPECIFIED diff --git a/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..5a694e8 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,6 @@ +3 +2 +1 +0 +4 +6 diff --git a/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..64e481b --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/AtomType/indices_one_hot.txt @@ -0,0 +1,50 @@ +6 +8 +7 +16 +15 +35 +17 +9 +56 +30 +26 +80 +53 +28 +5 +51 +14 +47 +11 +78 +40 +79 +4 +29 +20 +34 +81 +50 +82 +23 +32 +38 +48 +46 +60 +27 +83 +64 +25 +19 +33 +22 +3 +12 +42 +66 +24 +1 +49 +70 diff --git a/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt new file mode 100644 index 0000000..c819d38 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +AROMATIC +DOUBLE +TRIPLE diff --git a/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..21b19a8 --- /dev/null +++ b/chebai_graph/preprocessing/bin/tox21/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,7 @@ +1 +2 +3 +4 +0 +5 +6 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt new file mode 100644 index 0000000..c857ab5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomCharge/indices_one_hot.txt @@ -0,0 +1,6 @@ +0 +-1 +1 +2 +3 +-2 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt new file mode 100644 index 0000000..500ebf5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomFunctionalGroup/indices_one_hot.txt @@ -0,0 +1,117 @@ +ester +RING_6 +sulfonyl +alkyl +NO_FG +4_ammonium_ion +graph_fg +sulfide +primary_amine +carboxyl +chloro +quaternary_carbon +hydroxyl +secondary_amine +fluoro +ketone +tertiary_carbon +ether +alkene +nitro +tertiary_amine +aldehyde +RING_5 +alkyne +nitrile +RING_7 +alkene_carbon +carbonate_ester +trifluoromethyl +imide +sulfonic_acid +primary_ketimine +disulfide +sulfonate_ester +amide +nitroso +iodo +RING_3 +carboxylate +RING_8 +RING_20 +acetal +bromo +carbamate +RING_12 +ketoxime +RING_18 +silyl_ether +RING_4 +dichloromethyl +sulfinyl +aldoxime +thioketone +secondary_ketimine +isothiocyanate +isocyanate +RING_14 +sulfhydryl +phosphono +carbodithioic_acid +secondary_aldimine +haloformyl +phosphoryl +azo +nitrate +RING_35 +thiocyanate +hemiacetal +thiolester +difluorochloromethyl +dibromomethyl +difluoromethyl +phosphino +RING_29 +chlorobromomethyl +RING_9 +tribromomethyl +trichloromethyl +RING_28 +RING_16 +nitrosooxy +bromodichloromethyl +carbodithio +phosphodiester +RING_23 +phosphate +carboxylic_anhydride +RING_13 +RING_24 +RING_30 +RING_11 +RING_17 +azide +RING_40 +primary_aldimine +RING_15 +peroxy +RING_33 +trimethylsilyl +sulfino +ketal +RING_10 +thionoester +borono +amidine +orthoester +RING_27 +RING_26 +RING_38 +hydroperoxy +RING_21 +RING_19 +dichlorosilane +diiodomethyl +fluorochloromethyl +bromodifluoromethyl +RING_36 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt new file mode 100644 index 0000000..5d039f5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomHybridization/indices_one_hot.txt @@ -0,0 +1,7 @@ +SP2 +SP3 +SP +S +UNSPECIFIED +SP3D2 +SP3D diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt new file mode 100644 index 0000000..2d65776 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomNodeLevel/indices_one_hot.txt @@ -0,0 +1,3 @@ +atom_node_lvl +fg_node_lvl +graph_node_level diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt new file mode 100644 index 0000000..ed1daa5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomNumHs/indices_one_hot.txt @@ -0,0 +1,5 @@ +0 +1 +3 +2 +4 diff --git a/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt new file mode 100644 index 0000000..9c59d72 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/AtomType/indices_one_hot.txt @@ -0,0 +1,53 @@ +8 +6 +7 +16 +17 +9 +50 +19 +22 +14 +11 +53 +35 +33 +49 +78 +15 +51 +12 +3 +83 +28 +26 +13 +20 +47 +29 +5 +1 +30 +38 +80 +27 +34 +79 +56 +81 +24 +23 +21 +64 +70 +60 +46 +32 +4 +82 +66 +25 +48 +63 +40 +42 diff --git a/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt new file mode 100644 index 0000000..6b48d66 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/BondLevel/indices_one_hot.txt @@ -0,0 +1,4 @@ +within_atoms_lvl +atom_fg_lvl +within_fg_lvl +to_graphNode_lvl diff --git a/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt new file mode 100644 index 0000000..f14a241 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/BondType/indices_one_hot.txt @@ -0,0 +1,4 @@ +SINGLE +DOUBLE +AROMATIC +TRIPLE diff --git a/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt b/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt new file mode 100644 index 0000000..a61fff5 --- /dev/null +++ b/chebai_graph/preprocessing/bin/toxcast/NumAtomBonds/indices_one_hot.txt @@ -0,0 +1,7 @@ +2 +1 +3 +4 +0 +6 +5 From 8f51ea7fdbc09033f2631699c752918b41a91cbf Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Sat, 15 Aug 2026 15:39:38 +0200 Subject: [PATCH 13/26] batch script for augmentation ablation --- .../aug-ablation/aug-ablation-script.sh | 208 ++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 configs/data/augmented/aug-ablation/aug-ablation-script.sh diff --git a/configs/data/augmented/aug-ablation/aug-ablation-script.sh b/configs/data/augmented/aug-ablation/aug-ablation-script.sh new file mode 100644 index 0000000..41f8506 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-script.sh @@ -0,0 +1,208 @@ +#!/bin/bash + +#SBATCH --time=48:00:00 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --threads-per-core=1 +#SBATCH --mem=256000 + +#SBATCH --partition=gpu +#SBATCH --gres=gpu:1 +#SBATCH --constraint="A100|H100.80gb" + +# ============================================================ +# Job array +# +# 9 data configurations × 3 seeds = 27 experiments +# Maximum 3 experiments running simultaneously +# ============================================================ + +#SBATCH --array=0-26%9 + +#SBATCH --job-name=aug-ablation + +# Separate output/error file for every array task +#SBATCH --output=aug-ablation_%A_%a.out +#SBATCH --error=aug-ablation_%A_%a.err + + +# ============================================================ +# Shell settings +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Seeds +# ============================================================ + +SEEDS=(0 42 12345) + + +# ============================================================ +# Data configurations +# +# Add/remove configs here. +# +# IMPORTANT: +# The number of array tasks must be: +# +# number of data configs × number of seeds +# +# ============================================================ + +DATA_CONFIGS=( + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+WGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" +) + + +# ============================================================ +# Determine data config and seed from array task ID +# ============================================================ + +# Array task ordering: +# All data configurations are run for seed 0 first, +# followed by all data configurations for seed 42, +# and finally all data configurations for seed 12345. +# This is intentionally because the data is generated in first run for each data configuration. +# Then the following runs for the same data configuration can re-use the same generated data. + +NUM_SEEDS=${#SEEDS[@]} +NUM_DATA_CONFIGS=${#DATA_CONFIGS[@]} + +SEED_INDEX=$((SLURM_ARRAY_TASK_ID / NUM_DATA_CONFIGS)) +DATA_INDEX=$((SLURM_ARRAY_TASK_ID % NUM_DATA_CONFIGS)) + +DATA_CONFIG=${DATA_CONFIGS[$DATA_INDEX]} +SEED=${SEEDS[$SEED_INDEX]} + + +# ============================================================ +# Create experiment name +# ============================================================ + +DATA_NAME=$(basename "$DATA_CONFIG" .yml) + +RUN_NAME="${DATA_NAME}_s${SEED}" + + +# ============================================================ +# Print job information +# ============================================================ + +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Job ID: $SLURM_ARRAY_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data index: $DATA_INDEX" +echo "Seed index: $SEED_INDEX" +echo "Data config: $DATA_CONFIG" +echo "Data name: $DATA_NAME" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" + +echo "GPU information:" +nvidia-smi + +echo "============================================================" + + +# ============================================================ +# Temporary directory +# ============================================================ + +export TMPDIR=/home/staff/a/akhedekar/atmp_dir/ + +export SSL_CERT_FILE=$(python -m certifi) + + +# ============================================================ +# Activate Python environment +# ============================================================ + +source /home/staff/a/akhedekar/python-chebai-graph/.venv/bin/activate + + +# ============================================================ +# Set working directory +# ============================================================ + +CHEBAI_DIR="/home/staff/a/akhedekar/python-chebai" + +cd "$CHEBAI_DIR" + + +# ============================================================ +# Check selected configuration +# ============================================================ + +if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist:" + echo "$DATA_CONFIG" + exit 1 +fi + + +# ============================================================ +# Set seed +# ============================================================ + +echo "Using seed: $SEED" + +export SEED="$SEED" + + +# ============================================================ +# Run training +# ============================================================ + +python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --model=../python-chebai-graph/configs/model/baselines/gat.yml \ + --model.train_metrics=configs/metrics/micro-macro-f1.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=1 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --data.init_args.chebi_version=252 \ + --trainer.min_epochs=200 \ + --trainer.max_epochs=200 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --model.init_args.optimizer_kwargs.lr=0.002 \ + --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ + --seed_everything="$SEED" + + +# ============================================================ +# Finished +# ============================================================ + +echo "============================================================" +echo "Training finished successfully" +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data config: $DATA_CONFIG" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" From a94c7fd748b02addda2980eab6e8abb3a146f7ca Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Sat, 15 Aug 2026 17:40:59 +0200 Subject: [PATCH 14/26] fix ssl error --- .../aug-ablation/aug-ablation-script.sh | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/configs/data/augmented/aug-ablation/aug-ablation-script.sh b/configs/data/augmented/aug-ablation/aug-ablation-script.sh index 41f8506..c21b85b 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-script.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-script.sh @@ -39,7 +39,6 @@ set -euo pipefail SEEDS=(0 42 12345) - # ============================================================ # Data configurations # @@ -64,7 +63,6 @@ DATA_CONFIGS=( "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" ) - # ============================================================ # Determine data config and seed from array task ID # ============================================================ @@ -85,16 +83,13 @@ DATA_INDEX=$((SLURM_ARRAY_TASK_ID % NUM_DATA_CONFIGS)) DATA_CONFIG=${DATA_CONFIGS[$DATA_INDEX]} SEED=${SEEDS[$SEED_INDEX]} - # ============================================================ # Create experiment name # ============================================================ DATA_NAME=$(basename "$DATA_CONFIG" .yml) - RUN_NAME="${DATA_NAME}_s${SEED}" - # ============================================================ # Print job information # ============================================================ @@ -118,31 +113,25 @@ nvidia-smi echo "============================================================" - # ============================================================ # Temporary directory # ============================================================ export TMPDIR=/home/staff/a/akhedekar/atmp_dir/ -export SSL_CERT_FILE=$(python -m certifi) - - # ============================================================ # Activate Python environment # ============================================================ source /home/staff/a/akhedekar/python-chebai-graph/.venv/bin/activate - # ============================================================ # Set working directory # ============================================================ CHEBAI_DIR="/home/staff/a/akhedekar/python-chebai" - cd "$CHEBAI_DIR" - +export SSL_CERT_FILE=$(python -m certifi) # ============================================================ # Check selected configuration @@ -154,16 +143,6 @@ if [[ ! -f "$DATA_CONFIG" ]]; then exit 1 fi - -# ============================================================ -# Set seed -# ============================================================ - -echo "Using seed: $SEED" - -export SEED="$SEED" - - # ============================================================ # Run training # ============================================================ From 1a3e3c5e5b766336004834ca38d5b4748bacdf72 Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Tue, 18 Aug 2026 15:19:51 +0200 Subject: [PATCH 15/26] add baseline to aug-ablation script too --- configs/data/augmented/aug-ablation/aug-ablation-script.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/configs/data/augmented/aug-ablation/aug-ablation-script.sh b/configs/data/augmented/aug-ablation/aug-ablation-script.sh index c21b85b..d19dd95 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-script.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-script.sh @@ -13,11 +13,11 @@ # ============================================================ # Job array # -# 9 data configurations × 3 seeds = 27 experiments -# Maximum 3 experiments running simultaneously +# 10 data configurations × 3 seeds = 30 experiments +# Maximum 10 experiments running simultaneously # ============================================================ -#SBATCH --array=0-26%9 +#SBATCH --array=0-29%10 #SBATCH --job-name=aug-ablation @@ -61,6 +61,7 @@ DATA_CONFIGS=( "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" + "../python-chebai-graph/configs/data/chebi50_baseline.yml" ) # ============================================================ From a5a2c2e57ef1390b4802b1fb533f7ff544a54e44 Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Wed, 19 Aug 2026 22:33:31 +0200 Subject: [PATCH 16/26] aug props for gnwa_wfga_wfge --- .../preprocessing/datasets/__init__.py | 18 ++++++++ chebai_graph/preprocessing/datasets/chebi.py | 46 +++++++++++++++++++ .../chebi50_all_props_except_node_lvl.yml | 0 .../chebi50_atom_fg_prop_only.yml | 0 .../chebi50_atom_graph_node_prop_only.yml | 0 .../chebi50_atom_prop_only.yml | 0 .../chebi50_fg_graph_node_prop_only.yml | 0 .../{ => FGN+E+WGN}/chebi50_fg_prop_only.yml | 0 .../chebi50_graph_node_prop_only.yml | 0 .../chebi50_node_level_prop_only.yml | 0 .../gnwa_fgwa_wfge/chebi50_all_props.yml | 24 ++++++++++ .../chebi50_all_props_except_node_lvl.yml | 24 ++++++++++ .../chebi50_atom_fg_prop_only.yml | 24 ++++++++++ .../chebi50_atom_graph_node_prop_only.yml | 24 ++++++++++ .../gnwa_fgwa_wfge/chebi50_atom_prop_only.yml | 24 ++++++++++ .../chebi50_fg_graph_node_prop_only.yml | 24 ++++++++++ .../gnwa_fgwa_wfge/chebi50_fg_prop_only.yml | 24 ++++++++++ .../chebi50_graph_node_prop_only.yml | 24 ++++++++++ .../chebi50_node_level_prop_only.yml | 24 ++++++++++ 19 files changed, 280 insertions(+) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_all_props_except_node_lvl.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_atom_fg_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_atom_graph_node_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_atom_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_fg_graph_node_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_fg_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_graph_node_prop_only.yml (100%) rename configs/data/augmented/properties/{ => FGN+E+WGN}/chebi50_node_level_prop_only.yml (100%) create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml create mode 100644 configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml diff --git a/chebai_graph/preprocessing/datasets/__init__.py b/chebai_graph/preprocessing/datasets/__init__.py index c1e0a23..b0b1df5 100644 --- a/chebai_graph/preprocessing/datasets/__init__.py +++ b/chebai_graph/preprocessing/datasets/__init__.py @@ -5,6 +5,15 @@ ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE, ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE, ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE, + ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType, + ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel, + ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly, + ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly, + ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes, ChEBI50_NFGE_NGN_GraphProp, ChEBI50_NFGE_WGN_GraphProp, ChEBI50_StaticGNI, @@ -71,4 +80,13 @@ "Tox21_WFGE_WGN_AsPerNodeType", "ToxCast_WFGE_WGN_AsPerNodeType", "PCBA_WFGE_WGN_AsPerNodeType", + "ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType", + "ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly", + "ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes", ] diff --git a/chebai_graph/preprocessing/datasets/chebi.py b/chebai_graph/preprocessing/datasets/chebi.py index c4ac4ed..7a68dc6 100644 --- a/chebai_graph/preprocessing/datasets/chebi.py +++ b/chebai_graph/preprocessing/datasets/chebi.py @@ -169,48 +169,94 @@ class ChEBI50_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomLevelOnly(GraphPropForAtomLevelOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly(GraphPropForAtomLevelOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForFGLevelOnly(GraphPropForFGLevelOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly(GraphPropForFGLevelOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForGraphNodeOnly(GraphPropForGraphNodeOnly, ChEBIOver50): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly(GraphPropForGraphNodeOnly, ChEBIOver50): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomAndFGLevelOnly( GraphPropForAtomAndFGLevelOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly( + GraphPropForAtomAndFGLevelOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAtomLevelAndGraphNodeOnly( GraphPropForAtomLevelAndGraphNodeOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly( + GraphPropForAtomLevelAndGraphNodeOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForFGLevelAndGraphNodeOnly( GraphPropForFGLevelAndGraphNodeOnly, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly( + GraphPropForFGLevelAndGraphNodeOnly, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes( GraphPropNodeLevelPropOnlyForAllNodes, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes( + GraphPropNodeLevelPropOnlyForAllNodes, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel( GraphPropAllPropsExceptNodeLevel, ChEBIOver50 ): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel( + GraphPropAllPropsExceptNodeLevel, ChEBIOver50 +): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + # ---------- Final Augmentation: Different Thresholds ------------------------------ class ChEBI100_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ChEBIOver100): READER = AtomFGReader_WithFGEdges_WithGraphNode diff --git a/configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_all_props_except_node_lvl.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_all_props_except_node_lvl.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_all_props_except_node_lvl.yml diff --git a/configs/data/augmented/properties/chebi50_atom_fg_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_fg_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_fg_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_fg_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_atom_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_atom_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_atom_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_atom_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_fg_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_fg_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_fg_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_fg_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_fg_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_graph_node_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_graph_node_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_graph_node_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_graph_node_prop_only.yml diff --git a/configs/data/augmented/properties/chebi50_node_level_prop_only.yml b/configs/data/augmented/properties/FGN+E+WGN/chebi50_node_level_prop_only.yml similarity index 100% rename from configs/data/augmented/properties/chebi50_node_level_prop_only.yml rename to configs/data/augmented/properties/FGN+E+WGN/chebi50_node_level_prop_only.yml diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml new file mode 100644 index 0000000..3ff3232 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml new file mode 100644 index 0000000..fd33150 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_all_props_except_node_lvl.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml new file mode 100644 index 0000000..d9053ae --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_fg_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml new file mode 100644 index 0000000..7ab3ecb --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelAndGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml new file mode 100644 index 0000000..50d18ba --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_atom_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForAtomLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml new file mode 100644 index 0000000..c56edff --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForFGLevelAndGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml new file mode 100644 index 0000000..9b42371 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_fg_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml new file mode 100644 index 0000000..f1921ff --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_graph_node_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType diff --git a/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml new file mode 100644 index 0000000..db61465 --- /dev/null +++ b/configs/data/augmented/properties/gnwa_fgwa_wfge/chebi50_node_level_prop_only.yml @@ -0,0 +1,24 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes +init_args: + properties: + # All Node type properties + - chebai_graph.preprocessing.properties.AtomNodeLevel + # Atom Node type properties + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + # FG Node type properties + - chebai_graph.preprocessing.properties.AtomFunctionalGroup + - chebai_graph.preprocessing.properties.IsHydrogenBondDonorFG + - chebai_graph.preprocessing.properties.IsHydrogenBondAcceptorFG + - chebai_graph.preprocessing.properties.IsFGAlkyl + # Graph Node type properties + - chebai_graph.preprocessing.properties.AugRDKit2DNormalized + # Bond properties + - chebai_graph.preprocessing.properties.BondLevel + - chebai_graph.preprocessing.properties.AugBondAromaticity + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondType From 6edc8b98acd8c05b5197fd81ce9aa0ec65c754f6 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Thu, 20 Aug 2026 15:31:47 +0200 Subject: [PATCH 17/26] valid mask label for graph collate --- chebai_graph/models/architectures/base.py | 10 ++++- chebai_graph/preprocessing/collate.py | 17 ++++++-- tests/unit/test_collate.py | 48 +++++++++++++++++++++++ 3 files changed, 71 insertions(+), 4 deletions(-) create mode 100644 tests/unit/test_collate.py diff --git a/chebai_graph/models/architectures/base.py b/chebai_graph/models/architectures/base.py index 514e287..11ac3af 100644 --- a/chebai_graph/models/architectures/base.py +++ b/chebai_graph/models/architectures/base.py @@ -26,7 +26,15 @@ def _get_prediction_and_labels( Returns: tuple[torch.Tensor, torch.Tensor]: Tuple of (predictions, labels). """ - return torch.sigmoid(output), labels.int() + valid_label_mask = data["loss_kwargs"]["valid_label_mask"] + predictions = torch.sigmoid(output) + labels = labels.int() + + if valid_label_mask is not None: + predictions = predictions[valid_label_mask] + labels = labels[valid_label_mask] + + return predictions, labels def _process_labels_in_batch(self, batch: XYData) -> torch.Tensor | None: """ diff --git a/chebai_graph/preprocessing/collate.py b/chebai_graph/preprocessing/collate.py index 53bdde5..b2bc4a0 100644 --- a/chebai_graph/preprocessing/collate.py +++ b/chebai_graph/preprocessing/collate.py @@ -15,11 +15,16 @@ def __call__(self, data): # Unpack labels and optional identifiers y, idents = zip(*((d["labels"], d.get("ident")) for d in data)) - # Replace labels with `y` inside graph features and collect them + valid_label_mask = self._get_valid_label_mask(y) + + # Keep labels in XYGraphData.y instead of graph attributes. Mixed labelled + # and unlabelled batches otherwise make PyG collate a partial `y` key. merged_data = [] for row in data: - row["features"].y = row["labels"] - merged_data.append(row["features"]) + features = row["features"] + if "y" in features: + del features.y + merged_data.append(features) # Add empty edge_attr for graphs with no edges to prevent PyG errors for mdata in merged_data: @@ -31,6 +36,11 @@ def __call__(self, data): for attr in merged_data[0].keys(): for data in merged_data: for store in data.stores: + if attr not in store: + continue + if store[attr] is None: + del store[attr] + continue # Im not sure why the following conversion is needed, but it solves this error: # packages/torch_geometric/data/collate.py", line 177, in _collate # value = torch.cat(values, dim=cat_dim or 0, out=out) @@ -69,6 +79,7 @@ def __call__(self, data): x[0].x = x[0].x.to(dtype=torch.int64) # x is a Tuple[BaseData, Mapping, Mapping] + loss_kwargs["valid_label_mask"] = valid_label_mask return XYGraphData( x, y, diff --git a/tests/unit/test_collate.py b/tests/unit/test_collate.py new file mode 100644 index 0000000..d55ad9a --- /dev/null +++ b/tests/unit/test_collate.py @@ -0,0 +1,48 @@ +import unittest + +import torch +from torch_geometric.data import Data as GeomData + +from chebai_graph.preprocessing.collate import GraphCollator + + +class TestGraphCollator(unittest.TestCase): + @staticmethod + def _graph(): + return GeomData( + x=torch.tensor([[6]]), + edge_index=torch.empty((2, 0), dtype=torch.long), + ) + + def test_mixed_missing_labels_do_not_enter_graph_collate(self): + batch = GraphCollator()( + [ + { + "features": self._graph(), + "labels": [1, None, 0, 0, 1], + "ident": "a", + }, + {"features": self._graph(), "labels": None, "ident": "b"}, + { + "features": self._graph(), + "labels": [0, 1, None, 0, 1], + "ident": "c", + }, + ] + ) + + expected_labels = torch.tensor( + [ + [True, False, False, False, True], + [False, True, False, False, True], + ] + ) + self.assertTrue(torch.equal(batch.y, expected_labels)) + self.assertEqual( + batch.additional_fields["loss_kwargs"]["non_null_labels"], [0, 2] + ) + self.assertNotIn("y", batch.x[0]) + + +if __name__ == "__main__": + unittest.main() From 905ed524ae187ffe0df46b398b53631a65f95acc Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Fri, 21 Aug 2026 00:11:02 +0200 Subject: [PATCH 18/26] set invalid label to -1 to so that ignore_index=-1 works --- chebai_graph/models/architectures/base.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chebai_graph/models/architectures/base.py b/chebai_graph/models/architectures/base.py index 11ac3af..c86baa8 100644 --- a/chebai_graph/models/architectures/base.py +++ b/chebai_graph/models/architectures/base.py @@ -31,8 +31,13 @@ def _get_prediction_and_labels( labels = labels.int() if valid_label_mask is not None: - predictions = predictions[valid_label_mask] - labels = labels[valid_label_mask] + labels[~valid_label_mask] = -1 # Mark invalid labels as -1 + # https://lightning.ai/docs/torchmetrics/stable/classification/auroc#multilabelauroc + # -1 as we torchmetrics ignores -1 labels in multilabel metrics + # metric = MultilabelAUROC( + # num_labels=labels.shape[1], + # ignore_index=-1, + # ) return predictions, labels From ec958e10176a38083daa97b58e66a3d444bcc0f6 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Mon, 24 Aug 2026 18:46:39 +0200 Subject: [PATCH 19/26] aug ablation study for tox21, toxcast --- .gitignore | 3 + .../datasets/molecule_net_classification.py | 154 +++++++++++++- .../aug-ablation/aug-ablation-local.sh | 123 ++++++++++++ .../aug-ablation/aug-ablation-script.sh | 188 ------------------ .../aug-ablation/{ => chebi}/FGN+E+WGN.yml | 0 .../aug-ablation/{ => chebi}/FGN+E.yml | 0 .../aug-ablation/{ => chebi}/FGN+WGN.yml | 0 .../aug-ablation/{ => chebi}/FGN.yml | 0 .../aug-ablation/{ => chebi}/WGN.yml | 0 .../{ => chebi}/gn_wall_fgwa_nfge.yml | 0 .../{ => chebi}/gn_wall_fgwa_wfge.yml | 0 .../{ => chebi}/gnwa_fgwa_nfge.yml | 0 .../{ => chebi}/gnwa_fgwa_wfge.yml | 0 .../aug-ablation/tox21/FGN+E+WGN.yml | 12 ++ .../augmented/aug-ablation/tox21/FGN+E.yml | 12 ++ .../augmented/aug-ablation/tox21/FGN+WGN.yml | 12 ++ .../data/augmented/aug-ablation/tox21/FGN.yml | 12 ++ .../data/augmented/aug-ablation/tox21/WGN.yml | 12 ++ .../augmented/aug-ablation/tox21/baseline.yml | 12 ++ .../aug-ablation/tox21/gn_wall_fgwa_nfge.yml | 12 ++ .../aug-ablation/tox21/gn_wall_fgwa_wfge.yml | 12 ++ .../aug-ablation/tox21/gnwa_fgwa_nfge.yml | 12 ++ .../aug-ablation/tox21/gnwa_fgwa_wfge.yml | 12 ++ .../aug-ablation/toxcast/FGN+E+WGN.yml | 12 ++ .../augmented/aug-ablation/toxcast/FGN+E.yml | 12 ++ .../aug-ablation/toxcast/FGN+WGN.yml | 12 ++ .../augmented/aug-ablation/toxcast/FGN.yml | 12 ++ .../augmented/aug-ablation/toxcast/WGN.yml | 12 ++ .../aug-ablation/toxcast/baseline.yml | 12 ++ .../toxcast/gn_wall_fgwa_nfge.yml | 12 ++ .../toxcast/gn_wall_fgwa_wfge.yml | 12 ++ .../aug-ablation/toxcast/gnwa_fgwa_nfge.yml | 12 ++ .../aug-ablation/toxcast/gnwa_fgwa_wfge.yml | 12 ++ 33 files changed, 519 insertions(+), 189 deletions(-) create mode 100644 configs/data/augmented/aug-ablation/aug-ablation-local.sh delete mode 100644 configs/data/augmented/aug-ablation/aug-ablation-script.sh rename configs/data/augmented/aug-ablation/{ => chebi}/FGN+E+WGN.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/FGN+E.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/FGN+WGN.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/FGN.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/WGN.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/gn_wall_fgwa_nfge.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/gn_wall_fgwa_wfge.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/gnwa_fgwa_nfge.yml (100%) rename configs/data/augmented/aug-ablation/{ => chebi}/gnwa_fgwa_wfge.yml (100%) create mode 100644 configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/FGN+E.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/FGN.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/WGN.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/baseline.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml create mode 100644 configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/FGN+E.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/FGN.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/WGN.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/baseline.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml create mode 100644 configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml diff --git a/.gitignore b/.gitignore index d01eecf..f57d30f 100644 --- a/.gitignore +++ b/.gitignore @@ -174,3 +174,6 @@ electra_pretrained.ckpt *.out *.sh *.ckpt + +!configs/data/augmented/aug-ablation/aug-ablation-local.sh +!configs/data/augmented/aug-ablation/aug-ablation-script.sh \ No newline at end of file diff --git a/chebai_graph/preprocessing/datasets/molecule_net_classification.py b/chebai_graph/preprocessing/datasets/molecule_net_classification.py index 9afaf71..e8d1aa4 100644 --- a/chebai_graph/preprocessing/datasets/molecule_net_classification.py +++ b/chebai_graph/preprocessing/datasets/molecule_net_classification.py @@ -13,8 +13,21 @@ from chebai_graph.preprocessing.datasets.base import ( GraphPropAsPerNodeType, ) -from chebai_graph.preprocessing.reader.augmented_reader import ( +from chebai_graph.preprocessing.reader import ( + AtomFGReader_NoFGEdges_WithGraphNode, + AtomFGReader_WithFGEdges_NoGraphNode, AtomFGReader_WithFGEdges_WithGraphNode, + AtomReader_WithGraphNodeOnly, + AtomsFGReader_NoFGEdges_NoGraphNode, + GN_WithAllNodes_FG_WithAtoms_FGE, + GN_WithAllNodes_FG_WithAtoms_NoFGE, + GN_WithAtoms_FG_WithAtoms_FGE, + GN_WithAtoms_FG_WithAtoms_NoFGE, +) + +from .augmentation_base import ( + AugGraphPropMixIn_NoGraphNode, + AugGraphPropMixIn_WithGraphNode, ) @@ -54,6 +67,145 @@ class ToxCast_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ToxCast): READER = AtomFGReader_WithFGEdges_WithGraphNode +# ---- Augmentation: Variants with graph Node connected to FG nodes only ------------- +class Tox21_WFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with with FG nodes and FG edges and graph node.""" + + READER = AtomFGReader_WithFGEdges_WithGraphNode + + +class ToxCast_WFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with with FG nodes and FG edges and graph node.""" + + READER = AtomFGReader_WithFGEdges_WithGraphNode + + +class Tox21_NFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with FG nodes but without FG edges, with graph node.""" + + READER = AtomFGReader_NoFGEdges_WithGraphNode + + +class ToxCast_NFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with FG nodes but without FG edges, with graph node.""" + + READER = AtomFGReader_NoFGEdges_WithGraphNode + + +class Tox21_WFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, Tox21): + """Tox21 with FG nodes and FG edges, no graph node.""" + + READER = AtomFGReader_WithFGEdges_NoGraphNode + + +class ToxCast_WFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, ToxCast): + """ToxCast with FG nodes and FG edges, no graph node.""" + + READER = AtomFGReader_WithFGEdges_NoGraphNode + + +class Tox21_NFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, Tox21): + """Tox21 with FG nodes but without FG edges or graph node.""" + + READER = AtomsFGReader_NoFGEdges_NoGraphNode + + +class ToxCast_NFGE_NGN_GraphProp(AugGraphPropMixIn_NoGraphNode, ToxCast): + """ToxCast with FG nodes but without FG edges or graph node.""" + + READER = AtomsFGReader_NoFGEdges_NoGraphNode + + +class Tox21_Atom_WGNOnly_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): + """Tox21 with atom-level nodes and graph node only.""" + + READER = AtomReader_WithGraphNodeOnly + + +class ToxCast_Atom_WGNOnly_GraphProp(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ToxCast with atom-level nodes and graph node only.""" + + READER = AtomReader_WithGraphNodeOnly + + +# ------- Augmentation: Variants with graph Node connected to all others nodes (FG and atoms) -------------- +class Tox21_GN_WithAllNodes_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_FGE + + +class ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE( + AugGraphPropMixIn_WithGraphNode, ToxCast +): + """ + ToxCast with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_FGE + + +class Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_NoFGE + + +class ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE( + AugGraphPropMixIn_WithGraphNode, ToxCast +): + """ + ToxCast with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all nodes (fg + atoms). + """ + + READER = GN_WithAllNodes_FG_WithAtoms_NoFGE + + +# ------- Augmentation: Variants with graph node connected to atom nodes ONLY ----------- +class Tox21_GN_WithAtoms_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +class ToxCast_GN_WithAtoms_FG_WithAtoms_FGE(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ + ToxCast with FG nodes (connected to their respective atom nodes) with functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_FGE + + +class Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, Tox21): + """ + Tox21 with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_NoFGE + + +class ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, ToxCast): + """ + ToxCast with FG nodes (connected to their respective atom nodes) without functional group + edges, and adds a graph-level node connected to all atom nodes. + """ + + READER = GN_WithAtoms_FG_WithAtoms_NoFGE + + if __name__ == "__main__": dataset = BACE_WFGE_WGN_AsPerNodeType() dataset.prepare_data() diff --git a/configs/data/augmented/aug-ablation/aug-ablation-local.sh b/configs/data/augmented/aug-ablation/aug-ablation-local.sh new file mode 100644 index 0000000..a40c3e4 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-local.sh @@ -0,0 +1,123 @@ +#!/bin/bash + +# ============================================================ +# Local single-GPU adaptation of ../aug-ablation-script.sh +# +# The original is a Slurm job-array script (10 data configs x 3 +# seeds = 30 experiments, 10 concurrent). This version runs the +# SAME experiments serially on a single local GPU, without Slurm. +# +# Changes vs. the Slurm version: +# - Removed all #SBATCH scheduling directives. +# - Fixed hardcoded /home/staff/a/akhedekar paths -> local user. +# - Replaced SLURM_ARRAY_TASK_ID array fan-out with a serial +# loop over [seeds] x [data configs]. +# +# Requires (verified on this machine): +# - local venv: /home/aditya/python-chebai-graph/.venv +# - chebai CLI: /home/aditya/python-chebai (python -m chebai) +# - chebai_graph src: /home/aditya/python-chebai-graph. +# - wandb credentials in ~/.netrc (or run with a local logger). +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Local paths +# ============================================================ +CHEBAI_DIR="/home/aditya/python-chebai" +CHEBAI_GRAPH_DIR="/home/aditya/python-chebai-graph" + + +# ============================================================ +# Seeds +# ============================================================ +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations (all resolved to absolute local paths) +# ============================================================ +DATA_CONFIGS=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+E.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+WGN.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/WGN.yml" + "$CHEBAI_GRAPH_DIR/configs/data/chebi50_baseline.yml" +) + +# ============================================================ +# Activate Python environment +# ============================================================ +source "$CHEBAI_GRAPH_DIR/.venv/bin/activate" + +# ============================================================ +# Set working directory (chebai CLI looks up configs/... from cwd) +# ============================================================ +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +echo "============================================================" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "TMPDIR: $TMPDIR" +echo "GPU:" +nvidia-smi +echo "============================================================" + +# ============================================================ +# Serial loop over all seeds and data configurations +# ============================================================ +for SEED in "${SEEDS[@]}"; do + for DATA_CONFIG in "${DATA_CONFIGS[@]}"; do + + if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist: $DATA_CONFIG" + exit 1 + fi + + DATA_NAME=$(basename "$DATA_CONFIG" .yml) + RUN_NAME="${DATA_NAME}_s${SEED}" + + echo "============================================================" + echo "Starting run: $RUN_NAME" + echo "Seed: $SEED" + echo "Config: $DATA_CONFIG" + echo "============================================================" + + python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ + --model.train_metrics=configs/metrics/micro-macro-f1.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=1 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --data.init_args.chebi_version=252 \ + --trainer.min_epochs=200 \ + --trainer.max_epochs=200 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --model.init_args.optimizer_kwargs.lr=0.002 \ + --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ + --seed_everything="$SEED" + + echo "============================================================" + echo "Finished run: $RUN_NAME" + echo "============================================================" + done +done + +echo "============================================================" +echo "All experiments finished successfully" +echo "============================================================" \ No newline at end of file diff --git a/configs/data/augmented/aug-ablation/aug-ablation-script.sh b/configs/data/augmented/aug-ablation/aug-ablation-script.sh deleted file mode 100644 index d19dd95..0000000 --- a/configs/data/augmented/aug-ablation/aug-ablation-script.sh +++ /dev/null @@ -1,188 +0,0 @@ -#!/bin/bash - -#SBATCH --time=48:00:00 -#SBATCH --ntasks=1 -#SBATCH --cpus-per-task=32 -#SBATCH --threads-per-core=1 -#SBATCH --mem=256000 - -#SBATCH --partition=gpu -#SBATCH --gres=gpu:1 -#SBATCH --constraint="A100|H100.80gb" - -# ============================================================ -# Job array -# -# 10 data configurations × 3 seeds = 30 experiments -# Maximum 10 experiments running simultaneously -# ============================================================ - -#SBATCH --array=0-29%10 - -#SBATCH --job-name=aug-ablation - -# Separate output/error file for every array task -#SBATCH --output=aug-ablation_%A_%a.out -#SBATCH --error=aug-ablation_%A_%a.err - - -# ============================================================ -# Shell settings -# ============================================================ - -set -x -set -euo pipefail - -# ============================================================ -# Seeds -# ============================================================ - -SEEDS=(0 42 12345) - -# ============================================================ -# Data configurations -# -# Add/remove configs here. -# -# IMPORTANT: -# The number of array tasks must be: -# -# number of data configs × number of seeds -# -# ============================================================ - -DATA_CONFIGS=( - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+WGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" - "../python-chebai-graph/configs/data/chebi50_baseline.yml" -) - -# ============================================================ -# Determine data config and seed from array task ID -# ============================================================ - -# Array task ordering: -# All data configurations are run for seed 0 first, -# followed by all data configurations for seed 42, -# and finally all data configurations for seed 12345. -# This is intentionally because the data is generated in first run for each data configuration. -# Then the following runs for the same data configuration can re-use the same generated data. - -NUM_SEEDS=${#SEEDS[@]} -NUM_DATA_CONFIGS=${#DATA_CONFIGS[@]} - -SEED_INDEX=$((SLURM_ARRAY_TASK_ID / NUM_DATA_CONFIGS)) -DATA_INDEX=$((SLURM_ARRAY_TASK_ID % NUM_DATA_CONFIGS)) - -DATA_CONFIG=${DATA_CONFIGS[$DATA_INDEX]} -SEED=${SEEDS[$SEED_INDEX]} - -# ============================================================ -# Create experiment name -# ============================================================ - -DATA_NAME=$(basename "$DATA_CONFIG" .yml) -RUN_NAME="${DATA_NAME}_s${SEED}" - -# ============================================================ -# Print job information -# ============================================================ - -echo "============================================================" -echo "Job ID: $SLURM_JOB_ID" -echo "Array Job ID: $SLURM_ARRAY_JOB_ID" -echo "Array Task ID: $SLURM_ARRAY_TASK_ID" -echo "Data index: $DATA_INDEX" -echo "Seed index: $SEED_INDEX" -echo "Data config: $DATA_CONFIG" -echo "Data name: $DATA_NAME" -echo "Seed: $SEED" -echo "Run name: $RUN_NAME" -echo "Node: $(hostname)" -echo "Date: $(date)" -echo "============================================================" - -echo "GPU information:" -nvidia-smi - -echo "============================================================" - -# ============================================================ -# Temporary directory -# ============================================================ - -export TMPDIR=/home/staff/a/akhedekar/atmp_dir/ - -# ============================================================ -# Activate Python environment -# ============================================================ - -source /home/staff/a/akhedekar/python-chebai-graph/.venv/bin/activate - -# ============================================================ -# Set working directory -# ============================================================ - -CHEBAI_DIR="/home/staff/a/akhedekar/python-chebai" -cd "$CHEBAI_DIR" -export SSL_CERT_FILE=$(python -m certifi) - -# ============================================================ -# Check selected configuration -# ============================================================ - -if [[ ! -f "$DATA_CONFIG" ]]; then - echo "ERROR: Data configuration does not exist:" - echo "$DATA_CONFIG" - exit 1 -fi - -# ============================================================ -# Run training -# ============================================================ - -python -m chebai fit \ - --trainer=configs/training/default_trainer.yml \ - --trainer.logger=configs/training/wandb_logger.yml \ - --model=../python-chebai-graph/configs/model/baselines/gat.yml \ - --model.train_metrics=configs/metrics/micro-macro-f1.yml \ - --model.test_metrics=configs/metrics/micro-macro-f1.yml \ - --model.val_metrics=configs/metrics/micro-macro-f1.yml \ - --data="$DATA_CONFIG" \ - --data.init_args.batch_size=64 \ - --trainer.accumulate_grad_batches=1 \ - --data.init_args.num_workers=10 \ - --model.pass_loss_kwargs=false \ - --data.init_args.chebi_version=252 \ - --trainer.min_epochs=200 \ - --trainer.max_epochs=200 \ - --model.criterion=configs/loss/bce_unweighted.yml \ - --trainer.logger.init_args.name="$RUN_NAME" \ - --model.init_args.optimizer_kwargs.lr=0.002 \ - --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ - --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ - --seed_everything="$SEED" - - -# ============================================================ -# Finished -# ============================================================ - -echo "============================================================" -echo "Training finished successfully" -echo "============================================================" -echo "Job ID: $SLURM_JOB_ID" -echo "Array Task ID: $SLURM_ARRAY_TASK_ID" -echo "Data config: $DATA_CONFIG" -echo "Seed: $SEED" -echo "Run name: $RUN_NAME" -echo "Node: $(hostname)" -echo "Date: $(date)" -echo "============================================================" diff --git a/configs/data/augmented/aug-ablation/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN+E+WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+E+WGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+E+WGN.yml diff --git a/configs/data/augmented/aug-ablation/FGN+E.yml b/configs/data/augmented/aug-ablation/chebi/FGN+E.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+E.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+E.yml diff --git a/configs/data/augmented/aug-ablation/FGN+WGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN+WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN+WGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN+WGN.yml diff --git a/configs/data/augmented/aug-ablation/FGN.yml b/configs/data/augmented/aug-ablation/chebi/FGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/FGN.yml rename to configs/data/augmented/aug-ablation/chebi/FGN.yml diff --git a/configs/data/augmented/aug-ablation/WGN.yml b/configs/data/augmented/aug-ablation/chebi/WGN.yml similarity index 100% rename from configs/data/augmented/aug-ablation/WGN.yml rename to configs/data/augmented/aug-ablation/chebi/WGN.yml diff --git a/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_nfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml rename to configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_nfge.yml diff --git a/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_wfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml rename to configs/data/augmented/aug-ablation/chebi/gn_wall_fgwa_wfge.yml diff --git a/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_nfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml rename to configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_nfge.yml diff --git a/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_wfge.yml similarity index 100% rename from configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml rename to configs/data/augmented/aug-ablation/chebi/gnwa_fgwa_wfge.yml diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml new file mode 100644 index 0000000..e8520f3 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml new file mode 100644 index 0000000..c50baac --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml new file mode 100644 index 0000000..cae7d3a --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/FGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN.yml new file mode 100644 index 0000000..44b3705 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/FGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/WGN.yml b/configs/data/augmented/aug-ablation/tox21/WGN.yml new file mode 100644 index 0000000..7b5f253 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_Atom_WGNOnly_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/baseline.yml b/configs/data/augmented/aug-ablation/tox21/baseline.yml new file mode 100644 index 0000000..ce9dfa0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +init_args: + properties: + - chebai_graph.preprocessing.properties.AtomType + - chebai_graph.preprocessing.properties.NumAtomBonds + - chebai_graph.preprocessing.properties.AtomCharge + - chebai_graph.preprocessing.properties.AtomAromaticity + - chebai_graph.preprocessing.properties.AtomHybridization + - chebai_graph.preprocessing.properties.AtomNumHs + - chebai_graph.preprocessing.properties.BondType + - chebai_graph.preprocessing.properties.BondInRing + - chebai_graph.preprocessing.properties.BondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml new file mode 100644 index 0000000..c75cbbf --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml new file mode 100644 index 0000000..4eda133 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml new file mode 100644 index 0000000..5d6ff23 --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml new file mode 100644 index 0000000..648ecfc --- /dev/null +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml new file mode 100644 index 0000000..e8520f3 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml new file mode 100644 index 0000000..c50baac --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml new file mode 100644 index 0000000..cae7d3a --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_WGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN.yml new file mode 100644 index 0000000..44b3705 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/FGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_NGN_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/WGN.yml b/configs/data/augmented/aug-ablation/toxcast/WGN.yml new file mode 100644 index 0000000..7b5f253 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/WGN.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_Atom_WGNOnly_GraphProp +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/baseline.yml b/configs/data/augmented/aug-ablation/toxcast/baseline.yml new file mode 100644 index 0000000..ce9dfa0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +init_args: + properties: + - chebai_graph.preprocessing.properties.AtomType + - chebai_graph.preprocessing.properties.NumAtomBonds + - chebai_graph.preprocessing.properties.AtomCharge + - chebai_graph.preprocessing.properties.AtomAromaticity + - chebai_graph.preprocessing.properties.AtomHybridization + - chebai_graph.preprocessing.properties.AtomNumHs + - chebai_graph.preprocessing.properties.BondType + - chebai_graph.preprocessing.properties.BondInRing + - chebai_graph.preprocessing.properties.BondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml new file mode 100644 index 0000000..c75cbbf --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml new file mode 100644 index 0000000..4eda133 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml new file mode 100644 index 0000000..5d6ff23 --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml new file mode 100644 index 0000000..648ecfc --- /dev/null +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE +init_args: + properties: + - chebai_graph.preprocessing.properties.AugAtomType + - chebai_graph.preprocessing.properties.AugNumAtomBonds + - chebai_graph.preprocessing.properties.AugAtomCharge + - chebai_graph.preprocessing.properties.AugAtomAromaticity + - chebai_graph.preprocessing.properties.AugAtomHybridization + - chebai_graph.preprocessing.properties.AugAtomNumHs + - chebai_graph.preprocessing.properties.AugBondType + - chebai_graph.preprocessing.properties.AugBondInRing + - chebai_graph.preprocessing.properties.AugBondAromaticity From 0611c493312a9c5a94901b9870fcced100f115c1 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Mon, 24 Aug 2026 20:06:07 +0200 Subject: [PATCH 20/26] add tox ablation classes to configs --- .../preprocessing/datasets/__init__.py | 62 ++++++++++++++++--- .../datasets/molecule_net_classification.py | 14 +++++ .../aug-ablation/tox21/FGN+E+WGN.yml | 2 +- .../augmented/aug-ablation/tox21/FGN+E.yml | 2 +- .../augmented/aug-ablation/tox21/FGN+WGN.yml | 2 +- .../data/augmented/aug-ablation/tox21/FGN.yml | 2 +- .../data/augmented/aug-ablation/tox21/WGN.yml | 2 +- .../augmented/aug-ablation/tox21/baseline.yml | 2 +- .../aug-ablation/tox21/gn_wall_fgwa_nfge.yml | 2 +- .../aug-ablation/tox21/gn_wall_fgwa_wfge.yml | 2 +- .../aug-ablation/tox21/gnwa_fgwa_nfge.yml | 2 +- .../aug-ablation/tox21/gnwa_fgwa_wfge.yml | 2 +- .../aug-ablation/toxcast/FGN+E+WGN.yml | 2 +- .../augmented/aug-ablation/toxcast/FGN+E.yml | 2 +- .../aug-ablation/toxcast/FGN+WGN.yml | 2 +- .../augmented/aug-ablation/toxcast/FGN.yml | 2 +- .../augmented/aug-ablation/toxcast/WGN.yml | 2 +- .../aug-ablation/toxcast/baseline.yml | 2 +- .../toxcast/gn_wall_fgwa_nfge.yml | 2 +- .../toxcast/gn_wall_fgwa_wfge.yml | 2 +- .../aug-ablation/toxcast/gnwa_fgwa_nfge.yml | 2 +- .../aug-ablation/toxcast/gnwa_fgwa_wfge.yml | 2 +- 22 files changed, 88 insertions(+), 28 deletions(-) diff --git a/chebai_graph/preprocessing/datasets/__init__.py b/chebai_graph/preprocessing/datasets/__init__.py index b0b1df5..ad2aca9 100644 --- a/chebai_graph/preprocessing/datasets/__init__.py +++ b/chebai_graph/preprocessing/datasets/__init__.py @@ -40,29 +40,45 @@ MUV_WFGE_WGN_AsPerNodeType, PCBA_WFGE_WGN_AsPerNodeType, SIDER_WFGE_WGN_AsPerNodeType, + Tox21_Atom_WGNOnly_GraphProp, + Tox21_GN_WithAllNodes_FG_WithAtoms_FGE, + Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE, + Tox21_GN_WithAtoms_FG_WithAtoms_FGE, + Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE, + Tox21_NFGE_NGN_GraphProp, + Tox21_NFGE_WGN_GraphProp, + Tox21_WFGE_NGN_GraphProp, Tox21_WFGE_WGN_AsPerNodeType, + Tox21_WFGE_WGN_GraphProp, + Tox21GraphProperties, + ToxCast_Atom_WGNOnly_GraphProp, + ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE, + ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE, + ToxCast_GN_WithAtoms_FG_WithAtoms_FGE, + ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE, + ToxCast_NFGE_NGN_GraphProp, + ToxCast_NFGE_WGN_GraphProp, + ToxCast_WFGE_NGN_GraphProp, ToxCast_WFGE_WGN_AsPerNodeType, + ToxCast_WFGE_WGN_GraphProp, + ToxCastGraphProperties, ) from .pubchem import PubChemGraphProperties __all__ = [ - "ChEBI50GraphFGAugmentorReader", - "ChEBI25GraphProperties", - "ChEBI50GraphProperties", - "ChEBI100GraphProperties", - "ChEBI50GraphData", - "PubChemGraphProperties", - "ChEBI50_Atom_WGNOnly_GraphProp", + # ---------- CHEBI Augmentation ablation classes -------- + "ChEBI50GraphProperties", # -- baseline class for chebi "ChEBI50_NFGE_NGN_GraphProp", "ChEBI50_NFGE_WGN_GraphProp", "ChEBI50_WFGE_NGN_GraphProp", "ChEBI50_WFGE_WGN_GraphProp", - "ChEBI50_StaticGNI", "ChEBI50_WFGE_WGN_AsPerNodeType", "ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE", "ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE", "ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE", "ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE", + "ChEBI50_Atom_WGNOnly_GraphProp", + # ----- CHEBI FGN+E+FGE Properties ablation classes ----- "ChEBI50_WFGE_WGN_ForAtomLevelOnly", "ChEBI50_WFGE_WGN_ForFGLevelOnly", "ChEBI50_WFGE_WGN_ForGraphNodeOnly", @@ -71,6 +87,7 @@ "ChEBI50_WFGE_WGN_ForFGLevelAndGraphNodeOnly", "ChEBI50_WFGE_WGN_ForNodeLevelPropOnlyForAllNodes", "ChEBI50_WFGE_WGN_ForAllPropsExceptNodeLevel", + # ----- MoleculeNet Dataset FGN+E+FGE Final classes ----- "BACE_WFGE_WGN_AsPerNodeType", "BBBP_WFGE_WGN_AsPerNodeType", "ClinTox_WFGE_WGN_AsPerNodeType", @@ -80,6 +97,7 @@ "Tox21_WFGE_WGN_AsPerNodeType", "ToxCast_WFGE_WGN_AsPerNodeType", "PCBA_WFGE_WGN_AsPerNodeType", + # ----- CHEBI GNWA_FGWA_WFGE Properties ablation classes ----- "ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType", "ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel", "ChEBI50_GNWA_FGWA_WFGE_ForAtomAndFGLevelOnly", @@ -89,4 +107,32 @@ "ChEBI50_GNWA_FGWA_WFGE_ForFGLevelOnly", "ChEBI50_GNWA_FGWA_WFGE_ForGraphNodeOnly", "ChEBI50_GNWA_FGWA_WFGE_ForNodeLevelPropOnlyForAllNodes", + # ----- Tox21 Augmentation Ablation classes ----- + "Tox21_Atom_WGNOnly_GraphProp", + "Tox21_GN_WithAllNodes_FG_WithAtoms_FGE", + "Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE", + "Tox21_GN_WithAtoms_FG_WithAtoms_FGE", + "Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE", + "Tox21_NFGE_NGN_GraphProp", + "Tox21_NFGE_WGN_GraphProp", + "Tox21_WFGE_NGN_GraphProp", + "Tox21_WFGE_WGN_GraphProp", + "Tox21GraphProperties", # -- baseline class for Tox21 + # ----- ToxCast Augmentation Ablation classes ----- + "ToxCast_Atom_WGNOnly_GraphProp", + "ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE", + "ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE", + "ToxCast_GN_WithAtoms_FG_WithAtoms_FGE", + "ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE", + "ToxCast_NFGE_NGN_GraphProp", + "ToxCast_NFGE_WGN_GraphProp", + "ToxCast_WFGE_NGN_GraphProp", + "ToxCast_WFGE_WGN_GraphProp", + "ToxCastGraphProperties", # -- baseline class for ToxCast + # ------ Others ----- + "ChEBI50_StaticGNI", + "ChEBI25GraphProperties", + "ChEBI100GraphProperties", + "ChEBI50GraphData", + "PubChemGraphProperties", ] diff --git a/chebai_graph/preprocessing/datasets/molecule_net_classification.py b/chebai_graph/preprocessing/datasets/molecule_net_classification.py index e8d1aa4..d015d5f 100644 --- a/chebai_graph/preprocessing/datasets/molecule_net_classification.py +++ b/chebai_graph/preprocessing/datasets/molecule_net_classification.py @@ -12,6 +12,7 @@ from chebai_graph.preprocessing.datasets.base import ( GraphPropAsPerNodeType, + GraphPropertiesMixIn, ) from chebai_graph.preprocessing.reader import ( AtomFGReader_NoFGEdges_WithGraphNode, @@ -206,6 +207,19 @@ class ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE(AugGraphPropMixIn_WithGraphNode, T READER = GN_WithAtoms_FG_WithAtoms_NoFGE +# ---------------------------Baselines classes for Tox21 and ToxCast datasets +class Tox21GraphProperties(GraphPropertiesMixIn, Tox21): + """Tox21 dataset with molecular property encodings.""" + + pass + + +class ToxCastGraphProperties(GraphPropertiesMixIn, ToxCast): + """ToxCast dataset with molecular property encodings.""" + + pass + + if __name__ == "__main__": dataset = BACE_WFGE_WGN_AsPerNodeType() dataset.prepare_data() diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml index e8520f3..9b1f918 100644 --- a/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E+WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_WGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+E.yml b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml index c50baac..193eec0 100644 --- a/configs/data/augmented/aug-ablation/tox21/FGN+E.yml +++ b/configs/data/augmented/aug-ablation/tox21/FGN+E.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_NGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_NGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml index cae7d3a..3515dfb 100644 --- a/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml +++ b/configs/data/augmented/aug-ablation/tox21/FGN+WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_WGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.Tox21_NFGE_WGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/FGN.yml b/configs/data/augmented/aug-ablation/tox21/FGN.yml index 44b3705..50feae1 100644 --- a/configs/data/augmented/aug-ablation/tox21/FGN.yml +++ b/configs/data/augmented/aug-ablation/tox21/FGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_NGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.Tox21_NFGE_NGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/WGN.yml b/configs/data/augmented/aug-ablation/tox21/WGN.yml index 7b5f253..bdb347f 100644 --- a/configs/data/augmented/aug-ablation/tox21/WGN.yml +++ b/configs/data/augmented/aug-ablation/tox21/WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_Atom_WGNOnly_GraphProp +class_path: chebai_graph.preprocessing.datasets.Tox21_Atom_WGNOnly_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/baseline.yml b/configs/data/augmented/aug-ablation/tox21/baseline.yml index ce9dfa0..c0aeeda 100644 --- a/configs/data/augmented/aug-ablation/tox21/baseline.yml +++ b/configs/data/augmented/aug-ablation/tox21/baseline.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +class_path: chebai_graph.preprocessing.datasets.Tox21GraphProperties init_args: properties: - chebai_graph.preprocessing.properties.AtomType diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml index c75cbbf..88ddd67 100644 --- a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_nfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml index 4eda133..a227629 100644 --- a/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml +++ b/configs/data/augmented/aug-ablation/tox21/gn_wall_fgwa_wfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAllNodes_FG_WithAtoms_FGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml index 5d6ff23..5102fdf 100644 --- a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_nfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml index 648ecfc..d79a0ea 100644 --- a/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml +++ b/configs/data/augmented/aug-ablation/tox21/gnwa_fgwa_wfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE +class_path: chebai_graph.preprocessing.datasets.Tox21_GN_WithAtoms_FG_WithAtoms_FGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml index e8520f3..662da11 100644 --- a/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E+WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_WGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml index c50baac..1c5b321 100644 --- a/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+E.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_NGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_NGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml index cae7d3a..875a57d 100644 --- a/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml +++ b/configs/data/augmented/aug-ablation/toxcast/FGN+WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_WGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.ToxCast_NFGE_WGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/FGN.yml b/configs/data/augmented/aug-ablation/toxcast/FGN.yml index 44b3705..d046445 100644 --- a/configs/data/augmented/aug-ablation/toxcast/FGN.yml +++ b/configs/data/augmented/aug-ablation/toxcast/FGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_NFGE_NGN_GraphProp +class_path: chebai_graph.preprocessing.datasets.ToxCast_NFGE_NGN_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/WGN.yml b/configs/data/augmented/aug-ablation/toxcast/WGN.yml index 7b5f253..1464be0 100644 --- a/configs/data/augmented/aug-ablation/toxcast/WGN.yml +++ b/configs/data/augmented/aug-ablation/toxcast/WGN.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_Atom_WGNOnly_GraphProp +class_path: chebai_graph.preprocessing.datasets.ToxCast_Atom_WGNOnly_GraphProp init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/baseline.yml b/configs/data/augmented/aug-ablation/toxcast/baseline.yml index ce9dfa0..5a7e18c 100644 --- a/configs/data/augmented/aug-ablation/toxcast/baseline.yml +++ b/configs/data/augmented/aug-ablation/toxcast/baseline.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +class_path: chebai_graph.preprocessing.datasets.ToxCastGraphProperties init_args: properties: - chebai_graph.preprocessing.properties.AtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml index c75cbbf..c38ced5 100644 --- a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_nfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_NoFGE +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml index 4eda133..8d28ad9 100644 --- a/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml +++ b/configs/data/augmented/aug-ablation/toxcast/gn_wall_fgwa_wfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAllNodes_FG_WithAtoms_FGE +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAllNodes_FG_WithAtoms_FGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml index 5d6ff23..bae368f 100644 --- a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_nfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_NoFGE +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType diff --git a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml index 648ecfc..d754e25 100644 --- a/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml +++ b/configs/data/augmented/aug-ablation/toxcast/gnwa_fgwa_wfge.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_GN_WithAtoms_FG_WithAtoms_FGE +class_path: chebai_graph.preprocessing.datasets.ToxCast_GN_WithAtoms_FG_WithAtoms_FGE init_args: properties: - chebai_graph.preprocessing.properties.AugAtomType From a43cfc84284ed9c17729e4a742256c0b9a57e778 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Sat, 5 Sep 2026 13:12:08 +0200 Subject: [PATCH 21/26] add aug ablation scripts --- .gitignore | 3 +- .../aug-ablation/aug-ablation-chebi.sh | 188 ++++++++++++++++++ ...blation-local.sh => aug-ablation-tox21.sh} | 38 ++-- .../aug-ablation/aug-ablation-toxcast.sh | 125 ++++++++++++ 4 files changed, 334 insertions(+), 20 deletions(-) create mode 100644 configs/data/augmented/aug-ablation/aug-ablation-chebi.sh rename configs/data/augmented/aug-ablation/{aug-ablation-local.sh => aug-ablation-tox21.sh} (78%) create mode 100644 configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh diff --git a/.gitignore b/.gitignore index f57d30f..95daf78 100644 --- a/.gitignore +++ b/.gitignore @@ -175,5 +175,4 @@ electra_pretrained.ckpt *.sh *.ckpt -!configs/data/augmented/aug-ablation/aug-ablation-local.sh -!configs/data/augmented/aug-ablation/aug-ablation-script.sh \ No newline at end of file +!configs/data/augmented/aug-ablation/*.sh diff --git a/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh new file mode 100644 index 0000000..d19dd95 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh @@ -0,0 +1,188 @@ +#!/bin/bash + +#SBATCH --time=48:00:00 +#SBATCH --ntasks=1 +#SBATCH --cpus-per-task=32 +#SBATCH --threads-per-core=1 +#SBATCH --mem=256000 + +#SBATCH --partition=gpu +#SBATCH --gres=gpu:1 +#SBATCH --constraint="A100|H100.80gb" + +# ============================================================ +# Job array +# +# 10 data configurations × 3 seeds = 30 experiments +# Maximum 10 experiments running simultaneously +# ============================================================ + +#SBATCH --array=0-29%10 + +#SBATCH --job-name=aug-ablation + +# Separate output/error file for every array task +#SBATCH --output=aug-ablation_%A_%a.out +#SBATCH --error=aug-ablation_%A_%a.err + + +# ============================================================ +# Shell settings +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Seeds +# ============================================================ + +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations +# +# Add/remove configs here. +# +# IMPORTANT: +# The number of array tasks must be: +# +# number of data configs × number of seeds +# +# ============================================================ + +DATA_CONFIGS=( + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+WGN.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" + "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" + "../python-chebai-graph/configs/data/chebi50_baseline.yml" +) + +# ============================================================ +# Determine data config and seed from array task ID +# ============================================================ + +# Array task ordering: +# All data configurations are run for seed 0 first, +# followed by all data configurations for seed 42, +# and finally all data configurations for seed 12345. +# This is intentionally because the data is generated in first run for each data configuration. +# Then the following runs for the same data configuration can re-use the same generated data. + +NUM_SEEDS=${#SEEDS[@]} +NUM_DATA_CONFIGS=${#DATA_CONFIGS[@]} + +SEED_INDEX=$((SLURM_ARRAY_TASK_ID / NUM_DATA_CONFIGS)) +DATA_INDEX=$((SLURM_ARRAY_TASK_ID % NUM_DATA_CONFIGS)) + +DATA_CONFIG=${DATA_CONFIGS[$DATA_INDEX]} +SEED=${SEEDS[$SEED_INDEX]} + +# ============================================================ +# Create experiment name +# ============================================================ + +DATA_NAME=$(basename "$DATA_CONFIG" .yml) +RUN_NAME="${DATA_NAME}_s${SEED}" + +# ============================================================ +# Print job information +# ============================================================ + +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Job ID: $SLURM_ARRAY_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data index: $DATA_INDEX" +echo "Seed index: $SEED_INDEX" +echo "Data config: $DATA_CONFIG" +echo "Data name: $DATA_NAME" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" + +echo "GPU information:" +nvidia-smi + +echo "============================================================" + +# ============================================================ +# Temporary directory +# ============================================================ + +export TMPDIR=/home/staff/a/akhedekar/atmp_dir/ + +# ============================================================ +# Activate Python environment +# ============================================================ + +source /home/staff/a/akhedekar/python-chebai-graph/.venv/bin/activate + +# ============================================================ +# Set working directory +# ============================================================ + +CHEBAI_DIR="/home/staff/a/akhedekar/python-chebai" +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +# ============================================================ +# Check selected configuration +# ============================================================ + +if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist:" + echo "$DATA_CONFIG" + exit 1 +fi + +# ============================================================ +# Run training +# ============================================================ + +python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --model=../python-chebai-graph/configs/model/baselines/gat.yml \ + --model.train_metrics=configs/metrics/micro-macro-f1.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=1 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --data.init_args.chebi_version=252 \ + --trainer.min_epochs=200 \ + --trainer.max_epochs=200 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --model.init_args.optimizer_kwargs.lr=0.002 \ + --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ + --seed_everything="$SEED" + + +# ============================================================ +# Finished +# ============================================================ + +echo "============================================================" +echo "Training finished successfully" +echo "============================================================" +echo "Job ID: $SLURM_JOB_ID" +echo "Array Task ID: $SLURM_ARRAY_TASK_ID" +echo "Data config: $DATA_CONFIG" +echo "Seed: $SEED" +echo "Run name: $RUN_NAME" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "============================================================" diff --git a/configs/data/augmented/aug-ablation/aug-ablation-local.sh b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh similarity index 78% rename from configs/data/augmented/aug-ablation/aug-ablation-local.sh rename to configs/data/augmented/aug-ablation/aug-ablation-tox21.sh index a40c3e4..756514c 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-local.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh @@ -38,17 +38,20 @@ SEEDS=(0 42 12345) # ============================================================ # Data configurations (all resolved to absolute local paths) # ============================================================ +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/tox21" +) DATA_CONFIGS=( - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+E.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/FGN+WGN.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" - "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/WGN.yml" - "$CHEBAI_GRAPH_DIR/configs/data/chebi50_baseline.yml" + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" ) # ============================================================ @@ -94,22 +97,21 @@ for SEED in "${SEEDS[@]}"; do --trainer=configs/training/default_trainer.yml \ --trainer.logger=configs/training/wandb_logger.yml \ --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ - --model.train_metrics=configs/metrics/micro-macro-f1.yml \ - --model.test_metrics=configs/metrics/micro-macro-f1.yml \ - --model.val_metrics=configs/metrics/micro-macro-f1.yml \ + --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ --data="$DATA_CONFIG" \ --data.init_args.batch_size=64 \ - --trainer.accumulate_grad_batches=1 \ + --trainer.accumulate_grad_batches=2 \ --data.init_args.num_workers=10 \ --model.pass_loss_kwargs=false \ - --data.init_args.chebi_version=252 \ --trainer.min_epochs=200 \ --trainer.max_epochs=200 \ --model.criterion=configs/loss/bce_unweighted.yml \ --trainer.logger.init_args.name="$RUN_NAME" \ - --model.init_args.optimizer_kwargs.lr=0.002 \ - --data.init_args.splits_file_path=data/chebi_v252/ChEBI50/processed/splits.csv \ - --trainer.logger.init_args.tags='["augmented_paper","aug-ablation"]' \ + --data.init_args.splits_file_path=data/Tox21:MNClassification/Tox21/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "tox21"]' \ + --model.config.edge_dim=10 \ --seed_everything="$SEED" echo "============================================================" diff --git a/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh new file mode 100644 index 0000000..e355623 --- /dev/null +++ b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh @@ -0,0 +1,125 @@ +#!/bin/bash + +# ============================================================ +# Local single-GPU adaptation of ../aug-ablation-script.sh +# +# The original is a Slurm job-array script (10 data configs x 3 +# seeds = 30 experiments, 10 concurrent). This version runs the +# SAME experiments serially on a single local GPU, without Slurm. +# +# Changes vs. the Slurm version: +# - Removed all #SBATCH scheduling directives. +# - Fixed hardcoded /home/staff/a/akhedekar paths -> local user. +# - Replaced SLURM_ARRAY_TASK_ID array fan-out with a serial +# loop over [seeds] x [data configs]. +# +# Requires (verified on this machine): +# - local venv: /home/aditya/python-chebai-graph/.venv +# - chebai CLI: /home/aditya/python-chebai (python -m chebai) +# - chebai_graph src: /home/aditya/python-chebai-graph. +# - wandb credentials in ~/.netrc (or run with a local logger). +# ============================================================ + +set -x +set -euo pipefail + +# ============================================================ +# Local paths +# ============================================================ +CHEBAI_DIR="/home/aditya/python-chebai" +CHEBAI_GRAPH_DIR="/home/aditya/python-chebai-graph" + + +# ============================================================ +# Seeds +# ============================================================ +SEEDS=(0 42 12345) + +# ============================================================ +# Data configurations (all resolved to absolute local paths) +# ============================================================ +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/toxcast" +) +DATA_CONFIGS=( + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" +) + +# ============================================================ +# Activate Python environment +# ============================================================ +source "$CHEBAI_GRAPH_DIR/.venv/bin/activate" + +# ============================================================ +# Set working directory (chebai CLI looks up configs/... from cwd) +# ============================================================ +cd "$CHEBAI_DIR" +export SSL_CERT_FILE=$(python -m certifi) + +echo "============================================================" +echo "Node: $(hostname)" +echo "Date: $(date)" +echo "TMPDIR: $TMPDIR" +echo "GPU:" +nvidia-smi +echo "============================================================" + +# ============================================================ +# Serial loop over all seeds and data configurations +# ============================================================ +for SEED in "${SEEDS[@]}"; do + for DATA_CONFIG in "${DATA_CONFIGS[@]}"; do + + if [[ ! -f "$DATA_CONFIG" ]]; then + echo "ERROR: Data configuration does not exist: $DATA_CONFIG" + exit 1 + fi + + DATA_NAME=$(basename "$DATA_CONFIG" .yml) + RUN_NAME="${DATA_NAME}_s${SEED}" + + echo "============================================================" + echo "Starting run: $RUN_NAME" + echo "Seed: $SEED" + echo "Config: $DATA_CONFIG" + echo "============================================================" + + python -m chebai fit \ + --trainer=configs/training/default_trainer.yml \ + --trainer.logger=configs/training/wandb_logger.yml \ + --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ + --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --model.val_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ + --data="$DATA_CONFIG" \ + --data.init_args.batch_size=64 \ + --trainer.accumulate_grad_batches=2 \ + --data.init_args.num_workers=10 \ + --model.pass_loss_kwargs=false \ + --trainer.min_epochs=200 \ + --trainer.max_epochs=200 \ + --model.criterion=configs/loss/bce_unweighted.yml \ + --trainer.logger.init_args.name="$RUN_NAME" \ + --data.init_args.splits_file_path=data/ToxCast:MNClassification/ToxCast/processed/splits.csv \ + --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "toxcast"]' \ + --model.config.edge_dim=10 \ + --seed_everything="$SEED" + + echo "============================================================" + echo "Finished run: $RUN_NAME" + echo "============================================================" + done +done + +echo "============================================================" +echo "All experiments finished successfully" +echo "============================================================" \ No newline at end of file From e1e1d77ba0b9fe0c6a72eb0ac9e91a0fbdea138a Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Sun, 6 Sep 2026 17:24:43 +0200 Subject: [PATCH 22/26] rectify script --- .../data/augmented/aug-ablation/aug-ablation-tox21.sh | 10 ++++++---- .../augmented/aug-ablation/aug-ablation-toxcast.sh | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh index 756514c..8a66149 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-tox21.sh @@ -2,6 +2,7 @@ # ============================================================ # Local single-GPU adaptation of ../aug-ablation-script.sh +# Run this script using: `bash configs/data/augmented/aug-ablation/aug-ablation-tox21.sh` # # The original is a Slurm job-array script (10 data configs x 3 # seeds = 30 experiments, 10 concurrent). This version runs the @@ -68,7 +69,6 @@ export SSL_CERT_FILE=$(python -m certifi) echo "============================================================" echo "Node: $(hostname)" echo "Date: $(date)" -echo "TMPDIR: $TMPDIR" echo "GPU:" nvidia-smi echo "============================================================" @@ -96,6 +96,7 @@ for SEED in "${SEEDS[@]}"; do python -m chebai fit \ --trainer=configs/training/default_trainer.yml \ --trainer.logger=configs/training/wandb_logger.yml \ + --trainer.callbacks=configs/training/roc-auc_callbacks.yml \ --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ @@ -105,13 +106,14 @@ for SEED in "${SEEDS[@]}"; do --trainer.accumulate_grad_batches=2 \ --data.init_args.num_workers=10 \ --model.pass_loss_kwargs=false \ - --trainer.min_epochs=200 \ - --trainer.max_epochs=200 \ + --trainer.min_epochs=100 \ + --trainer.max_epochs=100 \ --model.criterion=configs/loss/bce_unweighted.yml \ --trainer.logger.init_args.name="$RUN_NAME" \ --data.init_args.splits_file_path=data/Tox21:MNClassification/Tox21/processed/splits.csv \ --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "tox21"]' \ - --model.config.edge_dim=10 \ + --model.config.edge_dim=6 \ + --model.config.in_channels=77 \ --seed_everything="$SEED" echo "============================================================" diff --git a/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh index e355623..5ab542f 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh @@ -2,6 +2,7 @@ # ============================================================ # Local single-GPU adaptation of ../aug-ablation-script.sh +# # Run this script using: `bash configs/data/augmented/aug-ablation/aug-ablation-toxcast.sh` # # The original is a Slurm job-array script (10 data configs x 3 # seeds = 30 experiments, 10 concurrent). This version runs the @@ -68,7 +69,6 @@ export SSL_CERT_FILE=$(python -m certifi) echo "============================================================" echo "Node: $(hostname)" echo "Date: $(date)" -echo "TMPDIR: $TMPDIR" echo "GPU:" nvidia-smi echo "============================================================" @@ -96,6 +96,7 @@ for SEED in "${SEEDS[@]}"; do python -m chebai fit \ --trainer=configs/training/default_trainer.yml \ --trainer.logger=configs/training/wandb_logger.yml \ + --trainer.callbacks=configs/training/roc-auc_callbacks.yml \ --model="$CHEBAI_GRAPH_DIR/configs/model/baselines/gat.yml" \ --model.train_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ --model.test_metrics=configs/metrics/micro-macro-f1-roc-auc.yml \ @@ -105,13 +106,14 @@ for SEED in "${SEEDS[@]}"; do --trainer.accumulate_grad_batches=2 \ --data.init_args.num_workers=10 \ --model.pass_loss_kwargs=false \ - --trainer.min_epochs=200 \ - --trainer.max_epochs=200 \ + --trainer.min_epochs=100 \ + --trainer.max_epochs=100 \ --model.criterion=configs/loss/bce_unweighted.yml \ --trainer.logger.init_args.name="$RUN_NAME" \ --data.init_args.splits_file_path=data/ToxCast:MNClassification/ToxCast/processed/splits.csv \ --trainer.logger.init_args.tags='["augmented_paper","aug-ablation", "toxcast"]' \ - --model.config.edge_dim=10 \ + --model.config.edge_dim=6 \ + --model.config.in_channels=79 \ --seed_everything="$SEED" echo "============================================================" From 705000ef840a47dd3fd395082cbf1fe977d77b82 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Sun, 6 Sep 2026 20:58:18 +0200 Subject: [PATCH 23/26] update chebi aug ablation script --- .../aug-ablation/aug-ablation-chebi.sh | 23 +++++++++++-------- .../augmented/aug-ablation/chebi/baseline.yml | 12 ++++++++++ 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 configs/data/augmented/aug-ablation/chebi/baseline.yml diff --git a/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh index d19dd95..eb82031 100644 --- a/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh +++ b/configs/data/augmented/aug-ablation/aug-ablation-chebi.sh @@ -51,17 +51,20 @@ SEEDS=(0 42 12345) # # ============================================================ +DATA_CONFIG_DIR=( + "$CHEBAI_GRAPH_DIR/configs/data/augmented/aug-ablation/tox21" +) DATA_CONFIGS=( - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+E+WGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/FGN+WGN.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_nfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gn_wall_fgwa_wfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_nfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/gnwa_fgwa_wfge.yml" - "../python-chebai-graph/configs/data/augmented/aug-ablation/WGN.yml" - "../python-chebai-graph/configs/data/chebi50_baseline.yml" + "$DATA_CONFIG_DIR/FGN.yml" + "$DATA_CONFIG_DIR/FGN+E.yml" + "$DATA_CONFIG_DIR/FGN+E+WGN.yml" + "$DATA_CONFIG_DIR/FGN+WGN.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gn_wall_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_nfge.yml" + "$DATA_CONFIG_DIR/gnwa_fgwa_wfge.yml" + "$DATA_CONFIG_DIR/WGN.yml" + "$DATA_CONFIG_DIR/baseline.yml" ) # ============================================================ diff --git a/configs/data/augmented/aug-ablation/chebi/baseline.yml b/configs/data/augmented/aug-ablation/chebi/baseline.yml new file mode 100644 index 0000000..ce9dfa0 --- /dev/null +++ b/configs/data/augmented/aug-ablation/chebi/baseline.yml @@ -0,0 +1,12 @@ +class_path: chebai_graph.preprocessing.datasets.ChEBI50GraphProperties +init_args: + properties: + - chebai_graph.preprocessing.properties.AtomType + - chebai_graph.preprocessing.properties.NumAtomBonds + - chebai_graph.preprocessing.properties.AtomCharge + - chebai_graph.preprocessing.properties.AtomAromaticity + - chebai_graph.preprocessing.properties.AtomHybridization + - chebai_graph.preprocessing.properties.AtomNumHs + - chebai_graph.preprocessing.properties.BondType + - chebai_graph.preprocessing.properties.BondInRing + - chebai_graph.preprocessing.properties.BondAromaticity From 730bd70a344b7c042321c8252ca7a92b47ca9331 Mon Sep 17 00:00:00 2001 From: aditya0by0 Date: Wed, 9 Sep 2026 20:24:32 +0200 Subject: [PATCH 24/26] final aug chang to gnwa_fgwa_wfge --- configs/data/augmented/final/chebi50_final_augmented.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/data/augmented/final/chebi50_final_augmented.yml b/configs/data/augmented/final/chebi50_final_augmented.yml index 576cf75..3ff3232 100644 --- a/configs/data/augmented/final/chebi50_final_augmented.yml +++ b/configs/data/augmented/final/chebi50_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ChEBI50_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties From 5ca1a57a24234a58c35e6fb4b3a0e79199cdbfa2 Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Thu, 10 Sep 2026 16:58:49 +0200 Subject: [PATCH 25/26] update molenet final config to gnwa_fgwa_wfge config --- .../preprocessing/datasets/__init__.py | 19 ++++++++++ .../datasets/molecule_net_classification.py | 36 +++++++++++++++++++ .../augmented/final/BACE_final_augmented.yml | 2 +- .../augmented/final/BBBP_final_augmented.yml | 2 +- .../final/ClinTox_final_augmented.yml | 2 +- .../augmented/final/HIV_final_augmented.yml | 2 +- .../augmented/final/MUV_final_augmented.yml | 2 +- .../augmented/final/PCBA_final_augmented.yml | 2 +- .../augmented/final/SIDER_final_augmented.yml | 2 +- .../augmented/final/Tox21_final_augmented.yml | 2 +- .../final/ToxCast_final_augmented.yml | 2 +- 11 files changed, 64 insertions(+), 9 deletions(-) diff --git a/chebai_graph/preprocessing/datasets/__init__.py b/chebai_graph/preprocessing/datasets/__init__.py index ad2aca9..24e9648 100644 --- a/chebai_graph/preprocessing/datasets/__init__.py +++ b/chebai_graph/preprocessing/datasets/__init__.py @@ -33,18 +33,26 @@ ChEBI100GraphProperties, ) from .molecule_net_classification import ( + BACE_GNWA_FGWA_WFGE_AsPerNodeType, BACE_WFGE_WGN_AsPerNodeType, + BBBP_GNWA_FGWA_WFGE_AsPerNodeType, BBBP_WFGE_WGN_AsPerNodeType, + ClinTox_GNWA_FGWA_WFGE_AsPerNodeType, ClinTox_WFGE_WGN_AsPerNodeType, + HIV_GNWA_FGWA_WFGE_AsPerNodeType, HIV_WFGE_WGN_AsPerNodeType, + MUV_GNWA_FGWA_WFGE_AsPerNodeType, MUV_WFGE_WGN_AsPerNodeType, + PCBA_GNWA_FGWA_WFGE_AsPerNodeType, PCBA_WFGE_WGN_AsPerNodeType, + SIDER_GNWA_FGWA_WFGE_AsPerNodeType, SIDER_WFGE_WGN_AsPerNodeType, Tox21_Atom_WGNOnly_GraphProp, Tox21_GN_WithAllNodes_FG_WithAtoms_FGE, Tox21_GN_WithAllNodes_FG_WithAtoms_NoFGE, Tox21_GN_WithAtoms_FG_WithAtoms_FGE, Tox21_GN_WithAtoms_FG_WithAtoms_NoFGE, + Tox21_GNWA_FGWA_WFGE_AsPerNodeType, Tox21_NFGE_NGN_GraphProp, Tox21_NFGE_WGN_GraphProp, Tox21_WFGE_NGN_GraphProp, @@ -56,6 +64,7 @@ ToxCast_GN_WithAllNodes_FG_WithAtoms_NoFGE, ToxCast_GN_WithAtoms_FG_WithAtoms_FGE, ToxCast_GN_WithAtoms_FG_WithAtoms_NoFGE, + ToxCast_GNWA_FGWA_WFGE_AsPerNodeType, ToxCast_NFGE_NGN_GraphProp, ToxCast_NFGE_WGN_GraphProp, ToxCast_WFGE_NGN_GraphProp, @@ -97,6 +106,16 @@ "Tox21_WFGE_WGN_AsPerNodeType", "ToxCast_WFGE_WGN_AsPerNodeType", "PCBA_WFGE_WGN_AsPerNodeType", + # ----- MoleculeNet Dataset GNWA+FGWA+WFGE Final classes ----- + "Tox21_GNWA_FGWA_WFGE_AsPerNodeType", + "ToxCast_GNWA_FGWA_WFGE_AsPerNodeType", + "BACE_GNWA_FGWA_WFGE_AsPerNodeType", + "BBBP_GNWA_FGWA_WFGE_AsPerNodeType", + "ClinTox_GNWA_FGWA_WFGE_AsPerNodeType", + "HIV_GNWA_FGWA_WFGE_AsPerNodeType", + "MUV_GNWA_FGWA_WFGE_AsPerNodeType", + "PCBA_GNWA_FGWA_WFGE_AsPerNodeType", + "SIDER_GNWA_FGWA_WFGE_AsPerNodeType", # ----- CHEBI GNWA_FGWA_WFGE Properties ablation classes ----- "ChEBI50_GNWA_FGWA_WFGE_AsPerNodeType", "ChEBI50_GNWA_FGWA_WFGE_ForAllPropsExceptNodeLevel", diff --git a/chebai_graph/preprocessing/datasets/molecule_net_classification.py b/chebai_graph/preprocessing/datasets/molecule_net_classification.py index d015d5f..2132965 100644 --- a/chebai_graph/preprocessing/datasets/molecule_net_classification.py +++ b/chebai_graph/preprocessing/datasets/molecule_net_classification.py @@ -36,38 +36,74 @@ class PCBA_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, PCBA): READER = AtomFGReader_WithFGEdges_WithGraphNode +class PCBA_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, PCBA): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class BACE_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, BACE): READER = AtomFGReader_WithFGEdges_WithGraphNode +class BACE_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, BACE): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class BBBP_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, BBBP): READER = AtomFGReader_WithFGEdges_WithGraphNode +class BBBP_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, BBBP): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ClinTox_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ClinTox): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ClinTox_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ClinTox): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class HIV_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, HIV): READER = AtomFGReader_WithFGEdges_WithGraphNode +class HIV_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, HIV): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class SIDER_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, SIDER): READER = AtomFGReader_WithFGEdges_WithGraphNode +class SIDER_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, SIDER): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class MUV_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, MUV): READER = AtomFGReader_WithFGEdges_WithGraphNode +class MUV_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, MUV): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class Tox21_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, Tox21): READER = AtomFGReader_WithFGEdges_WithGraphNode +class Tox21_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, Tox21): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + class ToxCast_WFGE_WGN_AsPerNodeType(GraphPropAsPerNodeType, ToxCast): READER = AtomFGReader_WithFGEdges_WithGraphNode +class ToxCast_GNWA_FGWA_WFGE_AsPerNodeType(GraphPropAsPerNodeType, ToxCast): + READER = GN_WithAtoms_FG_WithAtoms_FGE + + # ---- Augmentation: Variants with graph Node connected to FG nodes only ------------- class Tox21_WFGE_WGN_GraphProp(AugGraphPropMixIn_WithGraphNode, Tox21): """Tox21 with with FG nodes and FG edges and graph node.""" diff --git a/configs/data/augmented/final/BACE_final_augmented.yml b/configs/data/augmented/final/BACE_final_augmented.yml index 7ea67f0..fc95a55 100644 --- a/configs/data/augmented/final/BACE_final_augmented.yml +++ b/configs/data/augmented/final/BACE_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.BACE_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.BACE_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/BBBP_final_augmented.yml b/configs/data/augmented/final/BBBP_final_augmented.yml index 9a7ee90..fdef5ca 100644 --- a/configs/data/augmented/final/BBBP_final_augmented.yml +++ b/configs/data/augmented/final/BBBP_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.BBBP_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.BBBP_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/ClinTox_final_augmented.yml b/configs/data/augmented/final/ClinTox_final_augmented.yml index a4023b3..774103a 100644 --- a/configs/data/augmented/final/ClinTox_final_augmented.yml +++ b/configs/data/augmented/final/ClinTox_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ClinTox_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ClinTox_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/HIV_final_augmented.yml b/configs/data/augmented/final/HIV_final_augmented.yml index 596fc19..126a919 100644 --- a/configs/data/augmented/final/HIV_final_augmented.yml +++ b/configs/data/augmented/final/HIV_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.HIV_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.HIV_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/MUV_final_augmented.yml b/configs/data/augmented/final/MUV_final_augmented.yml index 56a3e1e..a3ade9c 100644 --- a/configs/data/augmented/final/MUV_final_augmented.yml +++ b/configs/data/augmented/final/MUV_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.MUV_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.MUV_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/PCBA_final_augmented.yml b/configs/data/augmented/final/PCBA_final_augmented.yml index 40688f4..dbacc76 100644 --- a/configs/data/augmented/final/PCBA_final_augmented.yml +++ b/configs/data/augmented/final/PCBA_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.PCBA_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.PCBA_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/SIDER_final_augmented.yml b/configs/data/augmented/final/SIDER_final_augmented.yml index 5eef128..bcb071c 100644 --- a/configs/data/augmented/final/SIDER_final_augmented.yml +++ b/configs/data/augmented/final/SIDER_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.SIDER_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.SIDER_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/Tox21_final_augmented.yml b/configs/data/augmented/final/Tox21_final_augmented.yml index 1c88112..cebd0dc 100644 --- a/configs/data/augmented/final/Tox21_final_augmented.yml +++ b/configs/data/augmented/final/Tox21_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.Tox21_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.Tox21_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties diff --git a/configs/data/augmented/final/ToxCast_final_augmented.yml b/configs/data/augmented/final/ToxCast_final_augmented.yml index 4831ae5..88f1a17 100644 --- a/configs/data/augmented/final/ToxCast_final_augmented.yml +++ b/configs/data/augmented/final/ToxCast_final_augmented.yml @@ -1,4 +1,4 @@ -class_path: chebai_graph.preprocessing.datasets.ToxCast_WFGE_WGN_AsPerNodeType +class_path: chebai_graph.preprocessing.datasets.ToxCast_GNWA_FGWA_WFGE_AsPerNodeType init_args: properties: # All Node type properties From 1b69b71fa9f3100802397258fdee0f6e81f76c2d Mon Sep 17 00:00:00 2001 From: aditya0b0 Date: Thu, 10 Sep 2026 16:59:14 +0200 Subject: [PATCH 26/26] enable seperate learning rate for gnn and final classification layer --- chebai_graph/models/architectures/base.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/chebai_graph/models/architectures/base.py b/chebai_graph/models/architectures/base.py index c86baa8..64dca7c 100644 --- a/chebai_graph/models/architectures/base.py +++ b/chebai_graph/models/architectures/base.py @@ -196,3 +196,25 @@ def forward(self, batch: dict) -> torch.Tensor: if self.use_batch_norm: a = self.batch_norm(a) return self.lin_sequential(a) + + def configure_optimizers(self, **kwargs) -> torch.optim.Optimizer: + optimizer_kwargs = dict(self.optimizer_kwargs) + + default_lr = optimizer_kwargs.pop("lr", None) + gnn_lr = optimizer_kwargs.pop("lr_gnn", default_lr) + linear_lr = optimizer_kwargs.pop("lr_linear", default_lr) + + if gnn_lr is None or linear_lr is None: + raise ValueError("Set lr or both lr_gnn and lr_linear") + + linear_params = list(self.lin_sequential.parameters()) + if self.use_batch_norm: + linear_params.extend(self.batch_norm.parameters()) + + return torch.optim.Adamax( + [ + {"params": self.gnn.parameters(), "lr": gnn_lr}, + {"params": linear_params, "lr": linear_lr}, + ], + **optimizer_kwargs, + )