Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanch committed Jun 8, 2023
1 parent 13b157c commit b8e88de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sgdml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__version__ = '1.0.0'
__version__ = '1.0.1'

MAX_PRINT_WIDTH = 100
LOG_LEVELNAME_WIDTH = 7 # do not modify
Expand Down
4 changes: 2 additions & 2 deletions sgdml/torchtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# MIT License
#
# Copyright (c) 2019-2022 Stefan Chmiela, Jan Hermann
# Copyright (c) 2019-2023 Stefan Chmiela, Jan Hermann
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -1032,7 +1032,7 @@ def _forward(self, Rs_or_train_idxs, return_E=True):
# exp_xs_1_x_dists: N, n_perms*N
# Fs_x: N, d

Fs = torch.einsum('ji,...ik,...i->...jk', self.agg_mat, Jxs, Fs_x)
Fs = torch.einsum('ji,...ik,...i->...jk', self.agg_mat.double(), Jxs, Fs_x)

if not is_train_pred: # TODO: set std to zero in training mode?
Fs *= self._std
Expand Down
2 changes: 1 addition & 1 deletion sgdml/utils/desc.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def __init__(self, n_atoms, max_processes=None):
self.tril_indices = np.tril_indices(n_atoms, k=-1)

# Precompute indices for nonzero entries in desriptor derivatives.
self.d_desc_mask = np.zeros((n_atoms, n_atoms - 1), dtype=np.int)
self.d_desc_mask = np.zeros((n_atoms, n_atoms - 1), dtype=int)
for a in range(n_atoms): # for each partial derivative
rows, cols = self.tril_indices
self.d_desc_mask[a, :] = np.concatenate(
Expand Down

0 comments on commit b8e88de

Please sign in to comment.