Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix initial points sampling #156

Closed
wants to merge 11 commits into from

Conversation

thomasckng
Copy link
Collaborator

Fix bug in jim.sample() and use the same code for HeterodynedTransientLikelihoodFD.maximize_likelihood().

@thomasckng thomasckng requested a review from kazewong September 16, 2024 04:22
@thomasckng
Copy link
Collaborator Author

Replace #153


key, subkey = jax.random.split(key)
guess = self.prior.sample(subkey, self.sampler.n_chains)
guess = self.prior.sample(subkey, non_finite_index.sum())
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The guesses are not guaranteed to be finite, hence the original implementation. Please change it back

@@ -558,14 +558,14 @@ def maximize_likelihood(
):
parameter_names = prior.parameter_names
for transform in sample_transforms:
parameter_names = transform.propagate_name(parameter_names)
parameter_names = jax.vmap(transform.propagate_name)(parameter_names)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One does not need vmap for propagating the names

@thomasckng
Copy link
Collaborator Author

Close this for a moment

@thomasckng thomasckng closed this Sep 17, 2024
@thomasckng thomasckng deleted the initial-sample-fix branch September 17, 2024 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants