Skip to content

Commit

Permalink
nn.dataset.GaussianMixture: minor fix to the docstring and standard d…
Browse files Browse the repository at this point in the history
…eviation parameter name
  • Loading branch information
bamos committed Oct 23, 2023
1 parent a42add0 commit 026e4bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/ott/problems/nn/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ class GaussianMixture:
batch_size: batch size of the samples
init_rng: initial PRNG key
scale: scale of the individual Gaussian samples
variance: the variance of the individual Gaussian samples
scale: scale of the Gaussian means
std: the standard deviation of the individual Gaussian samples
"""
name: Name_t
batch_size: int
init_rng: jax.random.PRNGKeyArray
scale: float = 5.0
variance: float = 0.5
std: float = 0.5

def __post_init__(self):
gaussian_centers = {
Expand Down Expand Up @@ -101,7 +101,7 @@ def _create_sample_generators(self) -> Iterator[jnp.array]:
rng1, rng2, rng = jax.random.split(rng, 3)
means = jax.random.choice(rng1, self.centers, (self.batch_size,))
normal_samples = jax.random.normal(rng2, (self.batch_size, 2))
samples = self.scale * means + self.variance ** 2 * normal_samples
samples = self.scale * means + (self.std ** 2) * normal_samples
yield samples


Expand Down

0 comments on commit 026e4bd

Please sign in to comment.