Skip to content

Commit

Permalink
Format code with black
Browse files Browse the repository at this point in the history
  • Loading branch information
jameschapman19 authored and github-actions[bot] committed Oct 19, 2023
1 parent 2cf540a commit c13977a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions cca_zoo/probabilistic/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from ._cca import ProbabilisticCCA
from ._plsregression import ProbabilisticPLSRegression
from ._rcca import ProbabilisticRCCA

# from ._pls import ProbabilisticPLS

__all__ = [
Expand Down
2 changes: 1 addition & 1 deletion cca_zoo/probabilistic/_cca.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _guide(self, views):
n = X1.shape[0] if X1 is not None else X2.shape[0]

with numpyro.plate("n", n):
z=numpyro.sample(
z = numpyro.sample(
"representations",
dist.MultivariateNormal(
jnp.zeros(self.latent_dimensions), jnp.eye(self.latent_dimensions)
Expand Down
6 changes: 2 additions & 4 deletions cca_zoo/probabilistic/_rcca.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,15 @@ def _model(self, views):
"X1",
dist.MultivariateNormal(
z @ W1.T + mu1,
covariance_matrix=psi1
+ self.c[0] * jnp.eye(self.n_features_[0]),
covariance_matrix=psi1 + self.c[0] * jnp.eye(self.n_features_[0]),
),
obs=X1,
)
numpyro.sample(
"X2",
dist.MultivariateNormal(
z @ W2.T + mu2,
covariance_matrix=psi2
+ self.c[1] * jnp.eye(self.n_features_[1]),
covariance_matrix=psi2 + self.c[1] * jnp.eye(self.n_features_[1]),
),
obs=X2,
)
Expand Down
2 changes: 1 addition & 1 deletion test/test_probabilistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ def test_cca_vs_probabilisticCCA(setup_data):

assert (
correlation > 0.9
), f"Expected correlation greater than 0.95, got {correlation}"
), f"Expected correlation greater than 0.95, got {correlation}"

0 comments on commit c13977a

Please sign in to comment.