Last updated: 2023-03-16.
tf_quant_finance.math.qmc.random_scrambling_vectors#
Returns a Tensor drawn from a uniform distribution.
tf_quant_finance.math.qmc.random_scrambling_vectors(
dim, seed, validate_args=False, dtype=None, name=None
)
The returned Tensor can be can be added to the specified
generating_vectors in order to randomize it.
Examples#
import tf_quant_finance as tff
# Example: Creating random vectors which can scramble 2D generating vectors.
dim = 2
seed = (2, 3)
tff.math.qmc.random_scrambling_vectors(dim, seed=seed)
# ==> tf.Tensor([0.17481351, 0.9780868], shape=(2,), dtype=float32)
Args:#
dim: Positive scalarTensorof integers with rank 0. The event size of points which can be sampled from the generating vectors to scramble.seed: Positive scalarTensorwith shape [2] and dtypeint32used as seed for the random generator.validate_args: Pythonboolindicating whether to validate arguments. Default value:False.dtype: Optionaldtype. Thedtypeof the outputTensor(eitherfloat32orfloat64). Default value:Nonewhich maps totf.float32.name: Pythonstrname prefixed to ops created by this function. Default value:Nonewhich maps torandom_scrambling_vectors.
Returns:#
A Tensor of real values between 0 (incl.) and 1 (excl.) with shape
(dim,).