Skip to content

Commit

Permalink
Merge pull request #2132 from nd-02110114/fix-issue
Browse files Browse the repository at this point in the history
Fix weighted_linear_sum
  • Loading branch information
Bharath Ramsundar committed Sep 1, 2020
2 parents 9c55f5b + 30a2772 commit d33cc47
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions deepchem/dock/pose_scoring.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ def weighted_linear_sum(w: np.ndarray, x: np.ndarray) -> np.ndarray:
w: np.ndarray
A numpy array of shape `(N,)`
x: np.ndarray
A numpy array of shape `(N,)`
A numpy array of shape `(N, M, L)`
Returns
-------
np.ndarray
A scalar value
A numpy array of shape `(M, L)`
"""
return np.sum(np.dot(w, x))
return np.tensordot(w, x, axes=1)


def vina_energy_term(coords1: np.ndarray, coords2: np.ndarray,
Expand All @@ -211,7 +211,9 @@ def vina_energy_term(coords1: np.ndarray, coords2: np.ndarray,
coords2: np.ndarray
Molecular coordinates of shape `(M, 3)`
weights: np.ndarray
A numpy array of shape `(5,)`
A numpy array of shape `(5,)`. The 5 values are weights for repulsion interaction term,
hydrophobic interaction term, hydrogen bond interaction term,
first Gaussian interaction term and second Gaussian interaction term.
wrot: float
The scaling factor for nonlinearity
Nrot: int
Expand Down

0 comments on commit d33cc47

Please sign in to comment.