Warning
This page was created from a pull request.
jax.random.truncated_normalΒΆ
-
jax.random.truncated_normal(key, lower, upper, shape=None, dtype=<class 'numpy.float64'>)[source]ΒΆ Sample truncated standard normal random values with given shape and dtype.
- Parameters
key (
ndarray) β a PRNGKey used as the random key.lower (
Union[float,ndarray]) β a float or array of floats representing the lower bound for truncation. Must be broadcast-compatible withupper.upper (
Union[float,ndarray]) β a float or array of floats representing the upper bound for truncation. Must be broadcast-compatible withlower.shape (
Optional[Sequence[int]]) β optional, a tuple of nonnegative integers specifying the result shape. Must be broadcast-compatible withlowerandupper. The default (None) produces a result shape by broadcastinglowerandupper.dtype (
dtype) β optional, a float dtype for the returned values (default float64 if jax_enable_x64 is true, otherwise float32).
- Return type
ndarray- Returns
A random array with the specified dtype and shape given by
shapeifshapeis not None, or else by broadcastinglowerandupper. Returns values in the open interval(lower, upper).