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
5eb73cd8
Unverified
Commit
5eb73cd8
authored
Apr 16, 2020
by
Farhad Ramezanghorbani
Committed by
GitHub
Apr 15, 2020
Browse files
fix order of SAEs (#456)
parent
f967877b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
torchani/data/__init__.py
torchani/data/__init__.py
+5
-2
No files found.
torchani/data/__init__.py
View file @
5eb73cd8
...
...
@@ -104,7 +104,7 @@ class Transformations:
"""Convert one reenterable iterable to another reenterable iterable"""
@
staticmethod
def
species_to_indices
(
reenterable_iterable
,
species_order
=
(
'H'
,
'C'
,
'N'
,
'O'
,
'F'
,
'
Cl
'
,
'
S
'
)):
def
species_to_indices
(
reenterable_iterable
,
species_order
=
(
'H'
,
'C'
,
'N'
,
'O'
,
'F'
,
'
S
'
,
'
Cl
'
)):
if
species_order
==
'periodic_table'
:
species_order
=
utils
.
PERIODIC_TABLE
idx
=
{
k
:
i
for
i
,
k
in
enumerate
(
species_order
)}
...
...
@@ -141,7 +141,10 @@ class Transformations:
if
len
(
counts
[
s
])
!=
n
+
1
:
counts
[
s
].
append
(
0
)
Y
.
append
(
d
[
'energies'
])
species
=
sorted
(
list
(
counts
.
keys
()))
# sort based on the order in periodic table
species
=
sorted
(
list
(
counts
.
keys
()),
key
=
lambda
x
:
utils
.
PERIODIC_TABLE
.
index
(
x
))
X
=
[
counts
[
s
]
for
s
in
species
]
if
shifter
.
fit_intercept
:
X
.
append
([
1
]
*
n
)
...
...
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