xnn.common.data.hub.ani1x.ANI1xBuilder#
- class xnn.common.data.hub.ani1x.ANI1xBuilder[source]#
Bases:
DatasetBuilderBuilder for the ANI-1x data set (active-learning DFT energies & forces).
See the module docstring for the dataset description and citation. The one ~5.6 GB
ani1x-release.h5file is downloaded once; its molecule groups are then parsed into xnn structure dicts, keeping only the conformations for which the requestedlevelhas non-NaN values.- load(*, split=None, cache_dir, level='wb97x_dz', forces=True, units='eV', max_molecules=None, max_conformations=None, seed=1234, quiet=False)[source]#
Download and preprocess the ANI-1x data set.
- Parameters:
split (str or None) –
Nonereturns{"all": ...};"train"/"val"/"test"returns a per-conformation 80/10/10 partition (fixedseed, disjoint splits).cache_dir (pathlib.Path) – Base cache directory; files live under
cache_dir/"ani1x".level (str, optional) – Level of theory:
"wb97x_dz"(default, the level the ANI-1x model was trained on),"wb97x_tz", or"ccsd(t)_cbs"(energy-only).forces (bool, optional) – Include forces (default
True). Ignored for energy-only levels like"ccsd(t)_cbs"; raises if forces are requested for a level that has none.units (str, optional) –
"eV"(default) converts energies to eV and forces to eV/A;"hartree"keeps the raw upstream values.max_molecules (int, optional) – Cap the number of molecule groups read (useful for demos).
max_conformations (int, optional) – Cap the number of (non-NaN) conformations kept per molecule.
seed (int, optional) – Seed for the reproducible 80/10/10 split. Defaults to
1234.quiet (bool, optional) – Suppress progress output. Defaults to
False.
- Returns:
dict of {str – Structure dicts with keys
pos(N, 3),atomic_numbers(N,),energy(scalar) and, when available and requested,forces(N, 3). ANI-1x is molecular, so nocell/pbc.- Return type:
- Raises:
ValueError – If
units,split, orlevelis unrecognized, or forces are requested for an energy-only level.ImportError – If
h5pyis not installed.