xnn.common.data.hub.qm9.QM9Builder#
- class xnn.common.data.hub.qm9.QM9Builder[source]#
Bases:
DatasetBuilderBuilder for QM9 (133,885 molecules, 15 properties, random benchmark splits).
- load(*, split=None, cache_dir, label='U0', units='eV', n_train=110000, n_val=10000, n_test=None, seed=0, exclude_uncharacterized=True, return_info=False, quiet=False)[source]#
Download, parse and split QM9.
- Parameters:
split (str or None) –
Nonereturns{"train": ..., "val": ..., "test": ...};"train"/"val"/"test"returns that split;"all"returns every molecule in gdb order.cache_dir (pathlib.Path) – Base cache directory; the files are stored under
cache_dir/"qm9".label (str, optional) – The property stored as the structure
energy, by default"U0"(seePROPERTIES).units (str, optional) –
"eV"(default; Hartree properties converted) or"hartree"(as published).n_train (int, optional) – Sizes of the random training and validation splits, by default 110,000 and 10,000; the rest is the test split.
n_val (int, optional) – Sizes of the random training and validation splits, by default 110,000 and 10,000; the rest is the test split.
n_test (int, optional) – Truncate the test split to its first
n_testmolecules.seed (int, optional) – Seed of the random split, by default 0.
exclude_uncharacterized (bool, optional) – Drop the 3054 molecules of
uncharacterized.txt(default).return_info (bool, optional) – Add an
infodict with the gdbindexand all 15 properties (in the chosen units) to every structure.quiet (bool, optional) – Suppress download progress output.
- Returns:
dict of {str – Structure dicts with
pos(N, 3)(Angstrom),atomic_numbers(N,)andenergy(thelabel).- Return type:
- Raises:
ValueError – For an unknown
units,labelorsplit.