Unverified Commit b8c2aa92 authored by Farhad Ramezanghorbani's avatar Farhad Ramezanghorbani Committed by GitHub
Browse files

Fix bug in discarding outlier energy conformers (#334)

parent 10c723b1
......@@ -310,13 +310,12 @@ def load_ani_dataset(path, species_tensor_converter, batch_size, shuffle=True,
atomic_properties_, properties_ = t(atomic_properties_, properties_)
if rm_outlier:
# This is how NeuroChem discard the outliers
transformed_energies = properties_['energies']
num_atoms = (atomic_properties_['species'] >= 0).to(transformed_energies.dtype).sum(dim=1)
scaled_diff = transformed_energies / num_atoms.sqrt()
mean = scaled_diff[torch.abs(scaled_diff) < 15.0].mean()
std = torch.abs(scaled_diff[torch.abs(scaled_diff) < 15.0]).std()
std = scaled_diff[torch.abs(scaled_diff) < 15.0].std()
# -15 * std + mean < scaled_diff < +11 * std + mean
tol = 13.0 * std + mean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment