Skip to content

Commit

Permalink
Merge pull request #23 from cheny36/master
Browse files Browse the repository at this point in the history
outer and shape functions
  • Loading branch information
gtca authored Apr 9, 2024
2 parents 0934428 + b23d642 commit 1581c5c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mofapy2/core/BayesNet.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def calculate_variance_explained(self, total=False):
# Variance explained per factor
else:
for k in range(self.dim["K"]):
Ypred = s.outer(Z[gg, k], W[m][:, k])
Ypred = np.outer(Z[gg, k], W[m][:, k])
Ypred[mask[gg, :]] = 0.0
Res = np.sum((Y[m][gg, :] - Ypred) ** 2.0)
r2[g][m, k] = 1.0 - Res / SS
Expand Down
4 changes: 2 additions & 2 deletions mofapy2/core/distributions/basic_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def getExpectations(self):

def CheckDimensionalities(self):
"""General method to do a sanity check on the dimensionalities"""
# p_dim = set(map(s.shape, self.params.values()))
e_dim = set(map(s.shape, self.expectations.values()))
# p_dim = set(map(np.shape, self.params.values()))
e_dim = set(map(np.shape, self.expectations.values()))
# assert len(p_dim) == 1, "Parameters have different dimensionalities"
assert len(e_dim) == 1, "Expectations have different dimensionalities"
# assert e_dim == p_dim, "Parameters and Expectations have different dimensionality"
Expand Down

0 comments on commit 1581c5c

Please sign in to comment.