Skip to content

Commit

Permalink
Docs about unit (#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
zasdfgbnm authored and farhadrgh committed Nov 13, 2019
1 parent c41581a commit c72ebd8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions examples/energy_force.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
# preceding ``1`` in the shape is here to support batch processing like in
# training. If you have ``N`` different structures to compute, then make it
# ``N``.
#
# The coordinates are in Angstrom, and the energies you get are in Hartree
coordinates = torch.tensor([[[0.03192167, 0.00638559, 0.01301679],
[-0.83140486, 0.39370209, -0.26395324],
[-0.66518241, -0.84461308, 0.20759389],
Expand Down
5 changes: 3 additions & 2 deletions torchani/aev.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,10 +389,11 @@ def forward(self, input_: Tuple[Tensor, Tensor],
and pbc is boolean vector of size 3 storing if pbc is enabled
for that direction.
The coordinates, and cell are in Angstrom.
Returns:
NamedTuple: Species and AEVs. species are the species from the input
unchanged, and AEVs is a tensor of shape
``(C, A, self.aev_length())``
unchanged, and AEVs is a tensor of shape ``(C, A, self.aev_length())``
"""
species, coordinates = input_

Expand Down
3 changes: 3 additions & 0 deletions torchani/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def forward(self, species_coordinates: Tuple[Tensor, Tensor],
Returns:
species_energies: energies for the given configurations
.. note:: The coordinates, and cell are in Angstrom, and the energies
will be in Hartree.
"""
species_aevs = self.aev_computer(species_coordinates, cell=cell, pbc=pbc)
species_energies = self.neural_networks(species_aevs)
Expand Down
8 changes: 5 additions & 3 deletions torchani/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ class SpeciesEnergies(NamedTuple):


class ANIModel(torch.nn.Module):
"""ANI model that compute properties from species and AEVs.
"""ANI model that compute energies from species and AEVs.
Different atom types might have different modules, when computing
properties, for each atom, the module for its corresponding atom type will
energies, for each atom, the module for its corresponding atom type will
be applied to its AEV, after that, outputs of modules will be reduced along
different atoms to obtain molecular properties.
different atoms to obtain molecular energies.
The resulting energies are in Hartree.
Arguments:
modules (:class:`collections.abc.Sequence`): Modules for each atom
Expand Down

0 comments on commit c72ebd8

Please sign in to comment.