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
Monte Carlo methods for discrete RVs with replacement should not waste computation on duplicate samples if the output dynamic is deterministic. We could automatically join these samples in this way:
On Plate, register what sample outcomes are duplicates
At every deterministic call, index each duplicate only once during unwrapping
During unwrapping, split them again according to the indexing
As deterministic calls are/should be deterministic, we can guarantee this doesn't provide incorrect behaviour. Downside: If indexing is slower than the function performance, this could actually be much slower if a lot of deterministic calls happen...
Another option is to have the user select whenever this joining should happen, using eg a context wrapper.
The text was updated successfully, but these errors were encountered:
Other issues: If there are more plates, the amount of unique samples can vary, meaning we get empty tensors that are still in use. Taken as a single tensor, if there is a single element in the plate for which there are no duplicates, then we still compute it for the whole sample performance.
Therefore, to make proper use out of it, this would require looping over the function for individual dimensions, otherwise you still do the full computation... Not sure if it's worth it.
Monte Carlo methods for discrete RVs with replacement should not waste computation on duplicate samples if the output dynamic is deterministic. We could automatically join these samples in this way:
Plate
, register what sample outcomes are duplicatesdeterministic call
, index each duplicate only once during unwrappingAs deterministic calls are/should be deterministic, we can guarantee this doesn't provide incorrect behaviour. Downside: If indexing is slower than the function performance, this could actually be much slower if a lot of deterministic calls happen...
Another option is to have the user select whenever this joining should happen, using eg a context wrapper.
The text was updated successfully, but these errors were encountered: