Bijector constructed from custom callables. Example Use: ```python exp = Inline( forward_fn=tf.exp, inverse_fn=tf.math.log, inverse_log_det_jacobian_fn=( lambda y: -tf.reduce_sum(tf.math.log(y), axis=-1)), name="exp") ``` The above example is equivalent to the `Bij
| 28 | |
| 29 | |
| 30 | class Inline(bijector.Bijector): |
| 31 | """Bijector constructed from custom callables. |
| 32 | |
| 33 | Example Use: |
| 34 | |
| 35 | ```python |
| 36 | exp = Inline( |
| 37 | forward_fn=tf.exp, |
| 38 | inverse_fn=tf.math.log, |
| 39 | inverse_log_det_jacobian_fn=( |
| 40 | lambda y: -tf.reduce_sum(tf.math.log(y), axis=-1)), |
| 41 | name="exp") |
| 42 | ``` |
| 43 | |
| 44 | The above example is equivalent to the `Bijector` `Exp()`. |
| 45 | """ |
| 46 | |
| 47 | @deprecation.deprecated( |
| 48 | "2018-10-01", |
| 49 | "The TensorFlow Distributions library has moved to " |
| 50 | "TensorFlow Probability " |
| 51 | "(https://github.com/tensorflow/probability). You " |
| 52 | "should update all references to use `tfp.distributions` " |
| 53 | "instead of `tf.contrib.distributions`.", |
| 54 | warn_once=True) |
| 55 | def __init__(self, |
| 56 | forward_fn=None, |
| 57 | inverse_fn=None, |
| 58 | inverse_log_det_jacobian_fn=None, |
| 59 | forward_log_det_jacobian_fn=None, |
| 60 | forward_event_shape_fn=None, |
| 61 | forward_event_shape_tensor_fn=None, |
| 62 | inverse_event_shape_fn=None, |
| 63 | inverse_event_shape_tensor_fn=None, |
| 64 | is_constant_jacobian=False, |
| 65 | validate_args=False, |
| 66 | forward_min_event_ndims=None, |
| 67 | inverse_min_event_ndims=None, |
| 68 | name="inline"): |
| 69 | """Creates a `Bijector` from callables. |
| 70 | |
| 71 | Args: |
| 72 | forward_fn: Python callable implementing the forward transformation. |
| 73 | inverse_fn: Python callable implementing the inverse transformation. |
| 74 | inverse_log_det_jacobian_fn: Python callable implementing the |
| 75 | log o det o jacobian of the inverse transformation. |
| 76 | forward_log_det_jacobian_fn: Python callable implementing the |
| 77 | log o det o jacobian of the forward transformation. |
| 78 | forward_event_shape_fn: Python callable implementing non-identical |
| 79 | static event shape changes. Default: shape is assumed unchanged. |
| 80 | forward_event_shape_tensor_fn: Python callable implementing non-identical |
| 81 | event shape changes. Default: shape is assumed unchanged. |
| 82 | inverse_event_shape_fn: Python callable implementing non-identical |
| 83 | static event shape changes. Default: shape is assumed unchanged. |
| 84 | inverse_event_shape_tensor_fn: Python callable implementing non-identical |
| 85 | event shape changes. Default: shape is assumed unchanged. |
| 86 | is_constant_jacobian: Python `bool` indicating that the Jacobian is |
| 87 | constant for all input arguments. |
no outgoing calls