tfp.experimental.bijectors.build_trainable_highway_flow
Stay organized with collections
Save and categorize content based on your preferences.
Builds a HighwayFlow parameterized by trainable variables.
tfp.experimental.bijectors.build_trainable_highway_flow(
width,
residual_fraction_initial_value=0.5,
activation_fn=None,
gate_first_n=None,
seed=None,
validate_args=False
)
The variables are transformed to enforce the following parameter constraints:
residual_fraction
is bounded between 0 and 1.
upper_diagonal_weights_matrix
is a randomly initialized (lower) diagonal
matrix with positive diagonal of size width x width
.
lower_diagonal_weights_matrix
is a randomly initialized lower diagonal
matrix with ones on the diagonal of size width x width
;
bias
is a randomly initialized vector of size width
.
Args |
width
|
Input dimension of the bijector.
|
residual_fraction_initial_value
|
Initial value for gating parameter, must be
between 0 and 1.
|
activation_fn
|
Callable invertible activation function
(e.g., tf.nn.softplus ), or None .
|
gate_first_n
|
Decides which part of the input should be gated (useful for
example when using auxiliary variables).
|
seed
|
Seed for random initialization of the weights.
|
validate_args
|
Python bool . Whether to validate input with runtime
assertions.
Default value: False .
|
Returns |
trainable_highway_flow
|
The initialized bijector.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[null,null,["Last updated 2023-11-21 UTC."],[],[],null,["# tfp.experimental.bijectors.build_trainable_highway_flow\n\n\u003cbr /\u003e\n\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/python/experimental/bijectors/highway_flow.py#L42-L121) |\n\nBuilds a HighwayFlow parameterized by trainable variables. \n\n tfp.experimental.bijectors.build_trainable_highway_flow(\n width,\n residual_fraction_initial_value=0.5,\n activation_fn=None,\n gate_first_n=None,\n seed=None,\n validate_args=False\n )\n\nThe variables are transformed to enforce the following parameter constraints:\n\n- `residual_fraction` is bounded between 0 and 1.\n- `upper_diagonal_weights_matrix` is a randomly initialized (lower) diagonal matrix with positive diagonal of size `width x width`.\n- `lower_diagonal_weights_matrix` is a randomly initialized lower diagonal matrix with ones on the diagonal of size `width x width`;\n- `bias` is a randomly initialized vector of size `width`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------|\n| `width` | Input dimension of the bijector. |\n| `residual_fraction_initial_value` | Initial value for gating parameter, must be between 0 and 1. |\n| `activation_fn` | Callable invertible activation function (e.g., [`tf.nn.softplus`](https://www.tensorflow.org/api_docs/python/tf/math/softplus)), or `None`. |\n| `gate_first_n` | Decides which part of the input should be gated (useful for example when using auxiliary variables). |\n| `seed` | Seed for random initialization of the weights. |\n| `validate_args` | Python `bool`. Whether to validate input with runtime assertions. Default value: `False`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|--------------------------|---------------------------|\n| `trainable_highway_flow` | The initialized bijector. |\n\n\u003cbr /\u003e"]]