Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
9abbe9f
chebi aug variant with all props except node level
aditya0by0 Aug 8, 2026
05462da
allow adding new tokens through augmented class for atom specific props
aditya0by0 Aug 10, 2026
d26b9b9
BACE dataset tokens
aditya0by0 Aug 10, 2026
1ce48ef
check len of base_df after merge, to avoid memory blow due to duplica…
aditya0by0 Aug 11, 2026
f590aeb
BBBP tokens
aditya0by0 Aug 12, 2026
f4cb1ac
hiv tokens
aditya0by0 Aug 12, 2026
d2b439d
clintox tokens
aditya0by0 Aug 12, 2026
3a8b8ed
sider tokens
aditya0by0 Aug 12, 2026
13234d1
HIV tokens
aditya0by0 Aug 12, 2026
185b78d
muv tokens
aditya0by0 Aug 13, 2026
b276f43
Merge branch 'feature/molenet_dataset' of https://github.com/ChEB-AI/…
aditya0by0 Aug 13, 2026
b6bc71d
pcba tokens
aditya0by0 Aug 14, 2026
38373ee
Merge branch 'feature/molenet_dataset' of https://github.com/ChEB-AI/…
aditya0by0 Aug 14, 2026
695fe57
tox21 tokens
aditya0by0 Aug 15, 2026
a46578a
Merge branch 'feature/molenet_dataset' of https://github.com/ChEB-AI/…
aditya0by0 Aug 15, 2026
8f51ea7
batch script for augmentation ablation
aditya0by0 Aug 15, 2026
e5df9b3
Merge branch 'feature/molenet_dataset' of https://github.com/ChEB-AI/…
aditya0by0 Aug 15, 2026
a94c7fd
fix ssl error
aditya0by0 Aug 15, 2026
1a3e3c5
add baseline to aug-ablation script too
aditya0by0 Aug 18, 2026
a5a2c2e
aug props for gnwa_wfga_wfge
aditya0by0 Aug 19, 2026
6edc8b9
valid mask label for graph collate
aditya0by0 Aug 20, 2026
84d1892
Merge branch 'feature/molenet_dataset' of https://github.com/ChEB-AI/…
aditya0by0 Aug 20, 2026
905ed52
set invalid label to -1 to so that ignore_index=-1 works
aditya0by0 Aug 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion chebai_graph/models/architectures/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,20 @@ 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:
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

def _process_labels_in_batch(self, batch: XYData) -> torch.Tensor | None:
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0
1
-1
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SP2
SP3
SP
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
atom_node_lvl
fg_node_lvl
graph_node_level
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0
1
3
2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
6
7
8
9
17
16
35
53
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
within_atoms_lvl
atom_fg_lvl
within_fg_lvl
to_graphNode_lvl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SINGLE
AROMATIC
TRIPLE
DOUBLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3
2
4
1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0
1
-1
2
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SP3
SP2
S
SP
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
atom_node_lvl
fg_node_lvl
graph_node_level
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
2
0
1
3
13 changes: 13 additions & 0 deletions chebai_graph/preprocessing/bin/bbbp/AtomType/indices_one_hot.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
6
17
8
7
16
11
53
35
9
1
15
5
20
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
within_atoms_lvl
atom_fg_lvl
within_fg_lvl
to_graphNode_lvl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
DOUBLE
SINGLE
AROMATIC
TRIPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
2
4
1
3
0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
0
-1
1
3
2
-2
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SP3
SP2
SP
S
SP3D2
UNSPECIFIED
SP3D
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
atom_node_lvl
fg_node_lvl
graph_node_level
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
3
0
2
1
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
within_atoms_lvl
atom_fg_lvl
within_fg_lvl
to_graphNode_lvl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SINGLE
AROMATIC
DOUBLE
TRIPLE
DATIVE
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
1
3
2
4
0
6
Loading
Loading