beta#
- ivy.beta(a, b, /, *, shape=None, device=None, dtype=None, seed=None, out=None)[source]#
Return an array filled with random values sampled from a beta distribution.
- Parameters:
a (
Union
[float
,NativeArray
,Array
]) – Alpha parameter of the beta distribution.b (
Union
[float
,NativeArray
,Array
]) – Beta parameter of the beta distribution.shape (
Optional
[Union
[Shape
,NativeShape
]], default:None
) – If the given shape is, e.g(m, n, k)
, thenm * n * k
samples are drawn Can only be specified whenmean
andstd
are numeric values, else exception will be raised. Default isNone
, where a single value is returned.device (
Optional
[Union
[Device
,NativeDevice
]], default:None
) – device on which to create the array. ‘cuda:0’, ‘cuda:1’, ‘cpu’ etc. (Default value = None).dtype (
Optional
[Union
[Dtype
,NativeDtype
]], default:None
) – output array data type. Ifdtype
isNone
, the output array data type will be the default floating point data type. DefaultNone
seed (
Optional
[int
], default:None
) – A python integer. Used to create a random seed distributionout (
Optional
[Array
], default:None
) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.
- Return type:
- Returns:
ret – Returns an array with the given shape filled with random values sampled from a beta distribution.
- Array.beta(self, beta, /, *, shape=None, device=None, dtype=None, seed=None, out=None)[source]#
ivy.Array instance method variant of ivy.beta. This method simply wraps the function, and so the docstring for ivy.beta also applies to this method with minimal changes.
- Parameters:
self (
Array
) – Input Array.alpha – The first parameter of the beta distribution.
beta (
Union
[int
,Array
,NativeArray
]) – The second parameter of the beta distribution.device (
Optional
[Union
[Device
,NativeDevice
]], default:None
) – device on which to create the array.dtype (
Optional
[Union
[Dtype
,NativeDtype
]], default:None
) – output array data type. Ifdtype
isNone
, the output array data type will be the default data type. DefaultNone
seed (
Optional
[int
], default:None
) – A python integer. Used to create a random seed distributionout (
Optional
[Array
], default:None
) – optional output array, for writing the result to. It must have a shape that the inputs broadcast to.
- Return type:
Array
- Returns:
ret – Drawn samples from the parameterized beta distribution with the shape of the array.
- Container.beta(self, beta, /, *, shape=None, key_chains=None, to_apply=True, prune_unapplied=False, map_sequences=False, device=None, dtype=None, seed=None, out=None)[source]#
ivy.Container instance method variant of ivy.beta. This method simply wraps the function, and so the docstring for ivy.beta also applies to this method with minimal changes.
- Parameters:
self (
Container
) – Input container. Should have a numeric data type.alpha – The alpha parameter of the distribution.
beta (
Union
[int
,float
,Container
,Array
,NativeArray
]) – The beta parameter of the distribution.shape (
Optional
[Union
[Shape
,NativeShape
,Container
]], default:None
) – The shape of the output array. Default isNone
.key_chains (
Optional
[Union
[List
[str
],Dict
[str
,str
],Container
]], default:None
) – The key-chains to apply or not apply the method to. Default isNone
.to_apply (
Union
[bool
,Container
], default:True
) – If True, the method will be applied to key_chains, otherwise key_chains will be skipped. Default isTrue
.prune_unapplied (
Union
[bool
,Container
], default:False
) – Whether to prune key_chains for which the function was not applied. Default isFalse
.map_sequences (
Union
[bool
,Container
], default:False
) – Whether to also map method to sequences (lists, tuples). Default isFalse
.device (
Optional
[Union
[str
,Container
]], default:None
) – The device to place the output array on. Default isNone
.dtype (
Optional
[Union
[str
,Container
]], default:None
) – The data type of the output array. Default isNone
.seed (
Optional
[Union
[int
,Container
]], default:None
) – A python integer. Used to create a random seed distributionout (
Optional
[Container
], default:None
) – optional output container, for writing the result to. It must have a shape that the inputs broadcast to.
- Return type:
Container
- Returns:
ret – A container object, with values drawn from the beta distribution.