Open jobrachem opened 7 months ago
A log message on the default bijector being used would be nice.
@jobrachem will transfer the core benefits of the Var.transform
method to the GraphBuilder.transform
: 1) accepting a bijector instance, 2) logging the default event space bijector
@jobrachem will continue as follows:
This PR introduces a
Var.transform
method. Some notes:Replacing
GraphBuilder.transform
We currently have
GraphBuilder.transform
. The new method is in fact intended as a replacement forGraphBuilder.transform
. HavingVar.transform
as a method onVar
has the advantage that it is easier to find for users. Since the transformation is "doing something to a Var" and it does not actually require any functionality within the GraphBuilder, living as a method on a Var is a natural development for the transform method.Behavior change
The method behaves similar to
GraphBuilder.transform
, with a few notable differences:*bijector_args
or*bijector_kwargs
to be passed to the bijector. This simplifies the code for the default case. More importantly, this fixes the graph representation after transformation, see below.Using a bijector instance:
Compare to using the default event space bijector. Note that in this case, the same bijector is being used, but there are spurious edges from the nodes "v0" and "v1", the prior parameters, to the original variable "tau".
Deprecation and updated documentation
GraphBuilder.transform
as deprecated and included directions towards the new method in its documentation.01a-transform.md
and04-mcycle.md
. As it turned out, usage in these tutorials was outdated anyway.Notebook for testing
You can play around with the method in this notebook:
050-transform.ipynb.zip
Related issues