Last updated: 2023-03-16.
tf_quant_finance.math.qmc.utils.tent_transform#
Returns the tent transform of a given Tensor.
tf_quant_finance.math.qmc.utils.tent_transform(
value
)
Examples#
import tensorflow as tf
import tf_quant_finance as tff
# Example: Commputing the tent transform of a given vector.
tff.math.qmc.utils.tent_transform(tf.constant([0, .2, .4, .6, .8, 1]))
# ==> tf.Tensor([0, .4, .8, .8, .4, 0.], shape=(4,), dtype=float32)
Args:#
value: ScalarTensorof real values in the[0, 1)range.
Returns:#
Tensor with the same shape as value equal to 2 ** value if value
is less than 0.5 or 2 * (1 - value) otherwise.