Transforms a program to one with new inputs and outputs.
oryx.core.ppl.graph_replace(
f: oryx.core.ppl.LogProbFunction
,
input_names: Union[List[str], str],
output_names: Union[List[str], str]
) -> oryx.core.ppl.LogProbFunction
graph_replace
enables redefining the inputs and outputs of a probabilistic
program that samples latent random variables. It takes a program, along
with a list of input names and output names, and returns a function from
the random variables corresponding to the input names to the ones
corresponding to the output names.
Args |
f
|
A probabilistic program.
|
input_names
|
A string or list of strings that correspond to random
variables.
|
output_names
|
A string or list of strings that correspond to random
variables.
|
Returns |
A probabilistic program that maps the random variables corresponding to the
input names to those of the output names.
|