Comments (7)
Also why not renaming initialize_state
to initialize_sampling_state
(also add additional state
parameter) to remove redundant code in build_logp_and_deterministic_functions
with all the state/observed checks?
from pymc4.
Those sound like reasonable changes and requests, happy to review PRs!
from pymc4.
Working on it, guess there are some related issues to fix first.
from pymc4.
@rrkarim are you making progress on this? i may try to tackle it today. I want to be able to just
data = pm.sample(model())
and have data
be the arviz object. This will require:
- Update import paths to get
sample
at the top level - Wrap the return value of
sample
into thearviz
object - Add the untransformed values into the trace (probably as Deterministics? this looks at least a little tricky)
I think the first two will be easy, and I will tackle those first.
from pymc4.
@ColCarroll, yes, the third one is, indeed, looks little tricky with my knowledge of the current design requirements. So yeah, change what you need to.
from pymc4.
I wouldn't add them as Deterministics
. The executors are used in different contexts for different purposes. The transformed executor is used in sample
and in sample_posterior_predictive
, and the latter relies on distributions being in untransformed, transformed or observed values in the sampling state, but never in deterministics. I can tackle this issue later this week but I would do the following:
- The deterministic values are collected with a callback that does a forward pass through the model, so it also collects the untransformed distribution values. I would simply change this callback to also return the relevant subset of untransformed variables that should be included into the trace.
- To know the list of distributions that should be stored, we could either rely on the test forward pass that we do in build logp function, or we could add an attribute to the sampling state, that stores the names of the autotransformed distributions.
from pymc4.
Thanks, @lucianopaz and @rrkarim!
I think I got to the same place as you are suggesting with 1. I am just finding it hard to figure out where to add that collection logic! 😁
I am relying on the nice pymc4.utils.NameParts.is_transformed
to decide if a distribution should be stored.
from pymc4.
Related Issues (20)
- No transformations for Bounded Distributions
- Class level dimension and parameter information HOT 1
- Backport support for coords from pymc3
- Add log likelihood to arviz trace objects
- `sample_prior_predictive` and `sample_posterior_predictive` issues with `use_auto_batching=False` HOT 2
- Write a notebook on manual model vectorization HOT 1
- Mass matrix adaptation sampling code in notebooks fails HOT 1
- Error in transformed variables with manual model vectorization HOT 4
- Make pm.sample work with AR distribution HOT 6
- Changes in PR #271 don't work with BatchStacker HOT 2
- PyMC3 vs PyMC4 for a new project? HOT 2
- [Question] Is there a timeline or roadmap for PyMC4? HOT 2
- Numerical instabilities with tf.float32 for cholesky decomposition HOT 3
- ValueError: Cannot create a tensor proto whose content is larger than 2GB. HOT 2
- Connecting pymc4 and diffeqpy for differential equations HOT 1
- Sampling fails when `num_chains=1` HOT 5
- PYMC4.Bound not found HOT 3
- Add support for LocalLinearTrend and Seasonal HOT 1
- calculation with tensor run errors HOT 2
- ERROR (aesara.graph.opt): Optimization failure due to: constant_folding HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymc4.