-
Notifications
You must be signed in to change notification settings - Fork 152
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
add method for iid-batched conditioning. #1331
base: main
Are you sure you want to change the base?
Conversation
- deprecate MNLE-based potential (can be nle-based) - adapt tests for conditioned mnle.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1331 +/- ##
===========================================
- Coverage 89.39% 78.30% -11.09%
===========================================
Files 118 118
Lines 8709 8736 +27
===========================================
- Hits 7785 6841 -944
- Misses 924 1895 +971
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I fully understand tbh.
IIUC, then there are four different dimensions across which we could vectorize:
- Across the x batch-dimension, in case we want to amortize.
- Across the x iid-dimension, in case we have iid samples.
- Across a batch of theta conditions which act as different experimental conditions
- Across thetas, in case we want to run multi-chain.
Which one of these does this PR solve? And which ones does it not yet solve?
Can we maybe somewhere define names for each of these four dimensions above and specify which ones are handled by which function (or which ones are currently assumed to be the same dimension and therefore do not have a cartesian product applied to them)?
Args: | ||
x: Batch of iid data of shape `(iid_dim, *event_shape)`. | ||
theta_without_condition: Batch of parameters `(batch_dim, *event_shape)` | ||
condition: Batch of conditions of shape `(iid_dim, *condition_shape)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition is in theta space, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
iid_dim is the same as for x, right?
|
||
Args: | ||
x: Batch of iid data of shape `(iid_dim, *event_shape)`. | ||
theta_without_condition: Batch of parameters `(batch_dim, *event_shape)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be useful to define event_shape
more explicitly here.
likelihoods. | ||
|
||
Args: | ||
x: Batch of iid data of shape `(iid_dim, *event_shape)`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename event_shape
to x_event_shape
.
|
||
Returns: | ||
log_likelihood_trial_sum: log likelihood for each parameter, summed over all | ||
batch entries (iid trials) in `x`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please specify shape.
x_o. | ||
|
||
Args: | ||
condition: The condition to fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the condition be the full theta
or only the ones that are not part of dims_to_sample
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence above implies that it is only "a part of theta"
"""Returns a potential conditioned on a subset of theta dimensions. | ||
|
||
The condition is a part of theta, but is assumed to correspond to a batch of iid | ||
x_o. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the batch_shape of condition
must match the batch_shape of x
later on?
condition.repeat_interleave(num_theta, dim=0), # repeat AABB | ||
], | ||
dim=-1, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nasty, but I also don't think that there is another way to do this.
As discussed in the call, the plan is to
|
condition_on
method for likelihood-estimator-based potential to condition on a batch of theta values (experimental conditions) that match the current batch of iidx_o
.