You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> Are we guaranteed to always be able to later rewrite this safely into something that is a proper logprob?
There are two types of logps that are relevant here. 1) An RV that is broadcasted directly and 2) an RV where we are doing advanced indexing (i.e. mixture)
For the former, we would need to perform symbolic unbroadcasting of the value variable, and then evaluate the base RV at that value
For the second, we would need to somehow only evaluate the logp at the unique indexes. Something like
deflogp_mixture_advanced_integer_indexing(value, base_rvs, indexes):
unique_indexes= [pt.unique(index) forindexinindexes]
# And either ignore or assert the value should be the same for repeated indexesreturnlogp_basic_mixture_rv(value[unique_indexes], base_rvs, unique_indexes)
This requires some thought to implement, which is why this PR does not attempt to do so.
We could at least implement the logp for the cases where indexes are unique (either because the user promised us so, or we added an assert)
ricardoV94
changed the title
Implement logprob derivation for some forms of AdvancedIndexing
Implement logprob derivation for some forms of AdvancedIndexing mixtures
Dec 14, 2022
There are two types of logps that are relevant here. 1) An RV that is broadcasted directly and 2) an RV where we are doing advanced indexing (i.e. mixture)
For the former, we would need to perform symbolic unbroadcasting of the value variable, and then evaluate the base RV at that value
I am not sure what the
unbroadcast
function would look like, but it should do the following (in pseudo-code), when valid, and raise otherwise.For the second, we would need to somehow only evaluate the logp at the unique indexes. Something like
This requires some thought to implement, which is why this PR does not attempt to do so.
We could at least implement the logp for the cases where indexes are unique (either because the user promised us so, or we added an assert)
Originally posted by @ricardoV94 in #6369 (comment)
The text was updated successfully, but these errors were encountered: