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
f967877b
Unverified
Commit
f967877b
authored
Apr 13, 2020
by
Farhad Ramezanghorbani
Committed by
GitHub
Apr 13, 2020
Browse files
Update NN in training benchmark (#453)
ANI1x NNs are updated to be consistent with what we used in the paper
parent
fec59ac3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
13 deletions
+40
-13
tools/training-benchmark.py
tools/training-benchmark.py
+40
-13
No files found.
tools/training-benchmark.py
View file @
f967877b
...
...
@@ -8,18 +8,45 @@ from torchani.units import hartree2kcalmol
synchronize
=
False
H_network
=
torch
.
nn
.
Sequential
(
torch
.
nn
.
Linear
(
384
,
160
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
160
,
128
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
128
,
96
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
96
,
1
)
)
C_network
=
torch
.
nn
.
Sequential
(
torch
.
nn
.
Linear
(
384
,
144
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
144
,
112
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
112
,
96
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
96
,
1
)
)
N_network
=
torch
.
nn
.
Sequential
(
torch
.
nn
.
Linear
(
384
,
128
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
128
,
112
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
112
,
96
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
96
,
1
)
)
def
atomic
():
model
=
torch
.
nn
.
Sequential
(
O_network
=
torch
.
nn
.
Sequential
(
torch
.
nn
.
Linear
(
384
,
128
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
128
,
12
8
),
torch
.
nn
.
Linear
(
128
,
1
1
2
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
1
28
,
64
),
torch
.
nn
.
Linear
(
1
12
,
96
),
torch
.
nn
.
CELU
(
0.1
),
torch
.
nn
.
Linear
(
64
,
1
)
)
return
model
torch
.
nn
.
Linear
(
96
,
1
)
)
def
time_func
(
key
,
func
):
...
...
@@ -71,7 +98,7 @@ if __name__ == "__main__":
num_species
=
4
aev_computer
=
torchani
.
AEVComputer
(
Rcr
,
Rca
,
EtaR
,
ShfR
,
EtaA
,
Zeta
,
ShfA
,
ShfZ
,
num_species
)
nn
=
torchani
.
ANIModel
([
atomic
()
for
_
in
range
(
4
)
])
nn
=
torchani
.
ANIModel
([
H_network
,
C_network
,
N_network
,
O_network
])
model
=
torch
.
nn
.
Sequential
(
aev_computer
,
nn
).
to
(
parser
.
device
)
optimizer
=
torch
.
optim
.
Adam
(
model
.
parameters
(),
lr
=
0.000001
)
mse
=
torch
.
nn
.
MSELoss
(
reduction
=
'none'
)
...
...
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