Closed zoj613 closed 1 year ago
This appears to be due to the position
term in https://github.com/aesara-devs/aehmc/blob/main/aehmc/integrators.py#L68 no longer being present in the potential_energy
term.
Here's a graph for those two terms:
>>> aesara.dprint([position, potential_energy])
Elemwise{add,no_inplace} [id A]
|<TensorType(float64, (2,))> [id B]
|Elemwise{add,no_inplace} [id C]
|Elemwise{mul,no_inplace} [id D]
| |TensorConstant{(1,) of 0.5} [id E]
| |TensorConstant{(1,) of 1.0} [id F]
| |Elemwise{sub,no_inplace} [id G]
| | |<TensorType(float64, (2,))> [id H]
| | |Elemwise{mul,no_inplace} [id I]
| | |TensorConstant{(1,) of 0.5} [id E]
| | |<TensorType(float64, (2,))> [id J]
| |TensorConstant{[1. 2.]} [id K]
|Elemwise{mul,no_inplace} [id L]
|TensorConstant{(1,) of 0.5} [id E]
|TensorConstant{(1,) of 1.0} [id F]
|TensorConstant{[1. 2.]} [id K]
|Elemwise{sub,no_inplace} [id G]
Elemwise{neg,no_inplace} [id M]
|Sum{acc_dtype=float64} [id N]
|Check{0 < diag(Sigma)} [id O]
|Elemwise{sub,no_inplace} [id P]
| |Elemwise{sub,no_inplace} [id Q]
| | |Elemwise{mul,no_inplace} [id R]
| | | |Elemwise{mul,no_inplace} [id S]
| | | | |TensorConstant{-0.5} [id T]
| | | | |Subtensor{int64} [id U]
| | | | |TensorConstant{(1,) of 2} [id V]
| | | | |ScalarConstant{-1} [id W]
| | | |Elemwise{log,no_inplace} [id X]
| | | |TensorConstant{6.283185307179586} [id Y]
| | |Elemwise{mul,no_inplace} [id Z]
| | |TensorConstant{0.5} [id BA]
| | |Sum{axis=[0], acc_dtype=float64} [id BB]
| | |Elemwise{pow,no_inplace} [id BC]
| | |InplaceDimShuffle{0} [id BD]
| | | |SolveTriangular{lower=True, trans=0, unit_diagonal=False, check_finite=True} [id BE]
| | | |Elemwise{switch,no_inplace} [id BF]
| | | | |InplaceDimShuffle{x,x} [id BG]
| | | | | |All [id BH]
| | | | | |Elemwise{gt,no_inplace} [id BI]
| | | | | |ExtractDiag{offset=0, axis1=0, axis2=1, view=False} [id BJ]
| | | | | | |Cholesky{lower=True, destructive=False, on_error='nan'} [id BK]
| | | | | | |TensorConstant{[[1. 1.]
[1. 4.]]} [id BL]
| | | | | |InplaceDimShuffle{x} [id BM]
| | | | | |TensorConstant{0} [id BN]
| | | | |Cholesky{lower=True, destructive=False, on_error='nan'} [id BK]
| | | | |InplaceDimShuffle{x,x} [id BO]
| | | | |TensorConstant{1} [id BP]
| | | |InplaceDimShuffle{0} [id BQ]
| | | |Elemwise{sub,no_inplace} [id BR]
| | | |Elemwise{add,no_inplace} [id BS]
| | | | |<TensorType(float64, (2,))> [id B]
| | | | |Elemwise{mul,no_inplace} [id BT]
| | | | | |TensorConstant{(1,) of 0.5} [id E]
| | | | | |Elemwise{sub,no_inplace} [id G]
| | | | | |TensorConstant{[1. 2.]} [id K]
| | | | |Elemwise{mul,no_inplace} [id BU]
| | | | |TensorConstant{(1,) of 0.5} [id E]
| | | | |TensorConstant{[1. 2.]} [id K]
| | | | |Elemwise{sub,no_inplace} [id G]
| | | |TensorConstant{[0. 3.]} [id BV]
| | |InplaceDimShuffle{x} [id BW]
| | |TensorConstant{2} [id BX]
| |Sum{acc_dtype=float64} [id BY]
| |Elemwise{log,no_inplace} [id BZ]
| |ExtractDiag{offset=0, axis1=0, axis2=1, view=False} [id BJ]
|All [id BH]
The graph for position
isn't present in potential_energy
(e.g. id A
isn't a node in the graph for potential_energy
starting at id M
), which explains the error. It looks like the subgraph starting at the node with id BS
in the potential_energy
graph is a copy/clone of position
. We need that subgraph to be identical to position
in order for position
to be considered an "input" of potential_energy
.
It looks like AePPL is doing some unnecessary cloning somewhere.
This was fixed in https://github.com/aesara-devs/aeppl/pull/248 and will be available soon in release v0.1.4.
Description of your problem or feature request
CI tests are failing due to the tests for
test_hmc_mcse
raising aaesara.gradient.DisconnectedInputError
exception.Please provide a minimal, self-contained, and reproducible example.
Please provide the full traceback of any errors.
Versions and main components
python -c "import aesara; print(aesara.config)"
)