resolve (pmrf.resolve)
- pmrf.resolve(tree)
Returns a copy of a tree with its ties applied and its parameters left intact.
Resolution is structural: every tie made by
tie()is discharged, and everything else the tree holds is left as it stands. This is the counterpart ofpmrf.unwrap(), which is evaluation: unwrapping replaces every parameter with its physical value, so nothing rebuilt from its result is parameterised. Use resolve to read a tied tree back, and unwrap only to evaluate one.A tie’s target resolves to a plain value either way, since it is derived and has no prior of its own. Every other parameter survives as a parameter, and a joint prior (
pmrf.modules.Probabilistic) is kept, since it is not a tie and does not change what its parameters are.- Parameters:
tree (PyTree) – A model, or any collection of models and parameters.
- Returns:
The tree in its own shape: a dict of components resolves to a dict, a list to a list, and a
pmrf.Modelto a model whose RF methods work. A tree with no ties comes back unchanged.- Return type:
PyTree
See also
tieDerive one part of a tree from another.
Examples
parts = {'a': Resistor(prf.Random(...), name='a'), 'b': Resistor(50.0, name='b')} tied = prf.tie(parts, 'b.R', 'a.R') resolved = prf.resolve(tied) resolved['b'].R # the tied value prf.is_param(resolved['a'].R) # True: untied parameters survive