Ejemplo n.º 1
0
 def to_noncentered(centered_state):
     set_values = ed_transforms.make_value_setter(*centered_state)
     with ed.tape() as noncentered_tape:
         with ed.interception(ed_transforms.ncp):
             with ed.interception(set_values):
                 model(*model_args)
     return [tf.identity(v) for v in list(noncentered_tape.values())[:-1]]
Ejemplo n.º 2
0
 def to_centered(uncentered_state):
     set_values = ed_transforms.make_value_setter(*uncentered_state)
     with ed.interception(set_values):
         with ed.interception(parametrisation):
             with ed.tape() as centered_tape:
                 model(*model_args)
     return [tf.identity(v) for v in list(centered_tape.values())[:-1]]