Warning

This page was created from a pull request.

jax.random.rademacherΒΆ

jax.random.rademacher(key, shape, dtype=<class 'numpy.int64'>)[source]ΒΆ

Sample from a Rademacher distribution.

Parameters
  • key – a PRNGKey key.

  • shape – The shape of the returned samples.

  • dtype – The type used for samples.

Returns

A jnp.array of samples, of shape shape. Each element in the output has a 50% change of being 1 or -1.