torch_geometric.datasets.ZINC
- class ZINC(root: str, subset: bool = False, split: str = 'train', transform: Optional[Callable] = None, pre_transform: Optional[Callable] = None, pre_filter: Optional[Callable] = None, force_reload: bool = False)[source]
Bases:
InMemoryDataset
The ZINC dataset from the ZINC database and the “Automatic Chemical Design Using a Data-Driven Continuous Representation of Molecules” paper, containing about 250,000 molecular graphs with up to 38 heavy atoms. The task is to regress the penalized
logP
(also called constrained solubility in some works), given byy = logP - SAS - cycles
, wherelogP
is the water-octanol partition coefficient,SAS
is the synthetic accessibility score, andcycles
denotes the number of cycles with more than six atoms. PenalizedlogP
is a score commonly used for training molecular generation models, see, e.g., the “Junction Tree Variational Autoencoder for Molecular Graph Generation” and “Grammar Variational Autoencoder” papers.- Parameters:
root (str) – Root directory where the dataset should be saved.
subset (bool, optional) – If set to
True
, will only load a subset of the dataset (12,000 molecular graphs), following the “Benchmarking Graph Neural Networks” paper. (default:False
)split (str, optional) – If
"train"
, loads the training dataset. If"val"
, loads the validation dataset. If"test"
, loads the test dataset. (default:"train"
)transform (callable, optional) – A function/transform that takes in an
torch_geometric.data.Data
object and returns a transformed version. The data object will be transformed before every access. (default:None
)pre_transform (callable, optional) – A function/transform that takes in an
torch_geometric.data.Data
object and returns a transformed version. The data object will be transformed before being saved to disk. (default:None
)pre_filter (callable, optional) – A function that takes in an
torch_geometric.data.Data
object and returns a boolean value, indicating whether the data object should be included in the final dataset. (default:None
)force_reload (bool, optional) – Whether to re-process the dataset. (default:
False
)
STATS:
Name
#graphs
#nodes
#edges
#features
#classes
ZINC Full
249,456
~23.2
~49.8
1
1
ZINC Subset
12,000
~23.2
~49.8
1
1