Repository navigation
Shape conventions for all DensityEstimators - #1066
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shape conventions for the
DensityEstimatorAll density estimators now have a unified format of their input and output shapes.
inputmust have shape(sample_dim: int, batch_dim: int, *event_shape: Tuple[int])conditionmust have shape(batch_dim: int, *event_shape: Tuple[int])batch_dimofinputandconditionmust be the same forlog_prob.API
density_estimator.log_prob(input, condition)density_estimator.sample(sample_shape, condition)Examples
density_estimator.log_prob(input, condition)density_estimator.sample(shape, condition)Issues to be opened
MixedDensityEstimatorcannot haveembedding_net.build_categoricalmassestimatorshould have z-score option and perform z-scoring by itself.DensityEstimatorshould be carryingcondition_shape.posteriorandinferenceshould not carry these attributes.log_prob_iidof MNLE not workingLimitations
Not all
DensityEstimators can...batch_shapes(but onlybatch_dims, i.e. scalar values)log_probwithout adapting thebatch_dimof the datapointlog_probon data withoutiid_dim_input. I.e.log_prob((50,3), (50,4))might fail, butlog_prob((1,50,3), (50,4))will workDoes this close any currently open issues?
Fixes #1041
Additional (but orthogonal) contributions
MixedDensityEstimatorindependent of having to estimate the likelihood (it can, in principle, be used to estimate mixed posteriors)Checklist
guidelines
with
pytest.mark.slow.guidelines
main(or there are no conflicts withmain)