Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
c72ebd89
Commit
c72ebd89
authored
Nov 13, 2019
by
Gao, Xiang
Committed by
Farhad Ramezanghorbani
Nov 13, 2019
Browse files
Docs about unit (#389)
parent
c41581a3
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
5 deletions
+13
-5
examples/energy_force.py
examples/energy_force.py
+2
-0
torchani/aev.py
torchani/aev.py
+3
-2
torchani/models.py
torchani/models.py
+3
-0
torchani/nn.py
torchani/nn.py
+5
-3
No files found.
examples/energy_force.py
View file @
c72ebd89
...
@@ -32,6 +32,8 @@ model = torchani.models.ANI1ccx()
...
@@ -32,6 +32,8 @@ model = torchani.models.ANI1ccx()
# preceding ``1`` in the shape is here to support batch processing like in
# 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
# training. If you have ``N`` different structures to compute, then make it
# ``N``.
# ``N``.
#
# The coordinates are in Angstrom, and the energies you get are in Hartree
coordinates
=
torch
.
tensor
([[[
0.03192167
,
0.00638559
,
0.01301679
],
coordinates
=
torch
.
tensor
([[[
0.03192167
,
0.00638559
,
0.01301679
],
[
-
0.83140486
,
0.39370209
,
-
0.26395324
],
[
-
0.83140486
,
0.39370209
,
-
0.26395324
],
[
-
0.66518241
,
-
0.84461308
,
0.20759389
],
[
-
0.66518241
,
-
0.84461308
,
0.20759389
],
...
...
torchani/aev.py
View file @
c72ebd89
...
@@ -389,10 +389,11 @@ class AEVComputer(torch.nn.Module):
...
@@ -389,10 +389,11 @@ class AEVComputer(torch.nn.Module):
and pbc is boolean vector of size 3 storing if pbc is enabled
and pbc is boolean vector of size 3 storing if pbc is enabled
for that direction.
for that direction.
The coordinates, and cell are in Angstrom.
Returns:
Returns:
NamedTuple: Species and AEVs. species are the species from the input
NamedTuple: Species and AEVs. species are the species from the input
unchanged, and AEVs is a tensor of shape
unchanged, and AEVs is a tensor of shape ``(C, A, self.aev_length())``
``(C, A, self.aev_length())``
"""
"""
species
,
coordinates
=
input_
species
,
coordinates
=
input_
...
...
torchani/models.py
View file @
c72ebd89
...
@@ -101,6 +101,9 @@ class BuiltinNet(torch.nn.Module):
...
@@ -101,6 +101,9 @@ class BuiltinNet(torch.nn.Module):
Returns:
Returns:
species_energies: energies for the given configurations
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_aevs
=
self
.
aev_computer
(
species_coordinates
,
cell
=
cell
,
pbc
=
pbc
)
species_energies
=
self
.
neural_networks
(
species_aevs
)
species_energies
=
self
.
neural_networks
(
species_aevs
)
...
...
torchani/nn.py
View file @
c72ebd89
...
@@ -9,12 +9,14 @@ class SpeciesEnergies(NamedTuple):
...
@@ -9,12 +9,14 @@ class SpeciesEnergies(NamedTuple):
class
ANIModel
(
torch
.
nn
.
Module
):
class
ANIModel
(
torch
.
nn
.
Module
):
"""ANI model that compute
prop
er
t
ies from species and AEVs.
"""ANI model that compute
en
er
g
ies from species and AEVs.
Different atom types might have different modules, when computing
Different atom types might have different modules, when computing
prop
er
t
ies, for each atom, the module for its corresponding atom type will
en
er
g
ies, 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
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:
Arguments:
modules (:class:`collections.abc.Sequence`): Modules for each atom
modules (:class:`collections.abc.Sequence`): Modules for each atom
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment