Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Better arviz support in base inference #1269

Closed
wants to merge 10 commits into from
Closed

Conversation

zaxtax
Copy link
Contributor

@zaxtax zaxtax commented Dec 14, 2021

Motivation

When I was doing bug fixing I noticed my arviz changes were lost in the shuffle. These commits add the functionality while keeping the APIs unchanged as much as possible.

Changes proposed

Changes the

Test Plan

Please provide clear instructions on how the changes were verified. Attach screenshots if applicable.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • The title of my pull request is a short description of the requested changes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Dec 14, 2021
@horizon-blue
Copy link
Contributor

:D Ah, this is a nice feature to have for our next release. Thanks for working on this, Rob! I'm going to import the PR now just so that we can see the test results. I'll have to review this a bit later, though, since there're a few other pre-launch items that we have to focus on at the moment.

In the mean time, there's a get_chain method that returns another MonteCarloSamples that people sometimes use to retrieve the data for a particular chain. Could you check if that's still working as expected with your change?

@facebook-github-bot
Copy link
Contributor

@horizon-blue has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@zaxtax
Copy link
Contributor Author

zaxtax commented Dec 14, 2021

I think get_chain should still work like it did before, but I should pass likelihoods to the MonteCarloSamples object returned by that method.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

17 similar comments
@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

11 similar comments
@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@horizon-blue
Copy link
Contributor

@zaxtax Was facebook-github-bot acting crazy? Or did you actually update this PR 42 times this afternoon? 🤣

@zaxtax
Copy link
Contributor Author

zaxtax commented Dec 15, 2021 via email

@horizon-blue
Copy link
Contributor

Haha don't worry, this is actually hilarious. I'm going to report this bug to our internal support team :)

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@horizon-blue has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

new_mcs = MonteCarloSamples(
chain_results=samples,
num_adaptive_samples=self.num_adaptive_samples,
logll_results=logll,
Copy link
Contributor

Choose a reason for hiding this comment

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

Our internal linter (Pyre) is complaining about the following typing issue:

Incompatible parameter type [6]: Expected Optional[List[Dict[RVIdentifier, torch.Tensor]]] for 3rd parameter logll_results to call MonteCarloSamples.__init__ but got Optional[Dict[typing.Any, typing.Any]].

Speaking of which, do you mind adding a call to get_chain to the unit test as well? Thanks :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That should fix the linter error.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@zaxtax has updated the pull request. You must reimport the pull request before landing.

@facebook-github-bot
Copy link
Contributor

@horizon-blue has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@horizon-blue
Copy link
Contributor

I thought we still have a type error on this diff but seems like I was wrong :). Our internal tool does warn us that this PR is a bit old, so I'm going to rebase and rerun the internal tests. If the signal is still green then we are good to go. Thanks again for working on this, Rob!

@horizon-blue horizon-blue deleted the ot-better-arviz-support branch February 3, 2022 04:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants