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
NotImplementedErrorTraceback (mostrecentcalllast)
File~/upstream/pymc-extras/pymc_extras/model/marginal/marginal_model.py:561, inreplace_finite_discrete_marginal_subgraph(fgraph, rv_to_marginalize, dependent_rvs, input_rvs)
560try:
-->561dependent_rvs_dim_connections=subgraph_batch_dim_connection(
562rv_to_marginalize, dependent_rvs563 )
564except (ValueError, NotImplementedError) ase:
565# For the perspective of the user this is a NotImplementedErrorFile~/upstream/pymc-extras/pymc_extras/model/marginal/graph_analysis.py:365, insubgraph_batch_dim_connection(input_var, output_vars)
364var_dims= {input_var: tuple(range(input_var.type.ndim))}
-->365var_dims=_subgraph_batch_dim_connection(var_dims, [input_var], output_vars)
366ret= []
File~/upstream/pymc-extras/pymc_extras/model/marginal/graph_analysis.py:317, in_subgraph_batch_dim_connection(var_dims, input_vars, output_vars)
316else:
-->317raiseNotImplementedError(f"Marginalization through operation {node} not supported.")
319returnvar_dimsNotImplementedError: MarginalizationthroughoperationMinibatchRandomVariable(y, 10000) notsupported.
Theaboveexceptionwasthedirectcauseofthefollowingexception:
NotImplementedErrorTraceback (mostrecentcalllast)
CellIn[21], line21frompymc_extras.model.marginal.marginal_modelimportmarginalize---->2model2=marginalize(model, [b])
File~/upstream/pymc-extras/pymc_extras/model/marginal/marginal_model.py:244, inmarginalize(model, rvs_to_marginalize)
237other_direct_rv_ancestors= [
238rv239forrvinfind_conditional_input_rvs(dependent_rvs, all_rvs)
240ifrvisnotrv_to_marginalize241 ]
242input_rvs=_unique((*marginalized_rv_input_rvs, *other_direct_rv_ancestors))
-->244replace_finite_discrete_marginal_subgraph(fg, rv_to_marginalize, dependent_rvs, input_rvs)
246returnmodel_from_fgraph(fg, mutate_fgraph=True)
File~/upstream/pymc-extras/pymc_extras/model/marginal/marginal_model.py:566, inreplace_finite_discrete_marginal_subgraph(fgraph, rv_to_marginalize, dependent_rvs, input_rvs)
561dependent_rvs_dim_connections=subgraph_batch_dim_connection(
562rv_to_marginalize, dependent_rvs563 )
564except (ValueError, NotImplementedError) ase:
565# For the perspective of the user this is a NotImplementedError-->566raiseNotImplementedError(
567"The graph between the marginalized and dependent RVs cannot be marginalized efficiently. "568"You can try splitting the marginalized RV into separate components and marginalizing them separately."569 ) frome571output_rvs= [rv_to_marginalize, *dependent_rvs]
572rng_updates=collect_default_updates(output_rvs, inputs=input_rvs, must_be_shared=False)
NotImplementedError: ThegraphbetweenthemarginalizedanddependentRVscannotbemarginalizedefficiently. YoucantrysplittingthemarginalizedRVintoseparatecomponentsandmarginalizingthemseparately.
The text was updated successfully, but these errors were encountered:
Yeah it will need a special rule in subgraph_batch_dim_connection to understand how batch dims propagate through minibatch RVs. It should be an identity progapation, the relevant logic was already done in the real RV input to the minibatch RV
Uh oh!
There was an error while loading. Please reload this page.
When I use
Minibatch
in the follow model:I get the following error:
The text was updated successfully, but these errors were encountered: