logspace#
- class brainunit.math.logspace(start, stop, num=50, endpoint=True, base=10.0, dtype=None)#
Return numbers spaced evenly on a log scale.
In linear space, the sequence starts at
base ** startand ends withbase ** stopinnumsteps.- Parameters:
start (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) –base ** startis the starting value of the sequence.stop (saiunit.Quantity |
Array|ndarray|bool|number|bool|int|float|complex) –base ** stopis the final value of the sequence (unlessendpointisFalse). Must share the same unit asstartwhen either is aQuantity.num (
int|None) – Number of samples to generate. Default is 50.endpoint (
bool|None) – IfTrue,stopis the last sample. Otherwise, it is not included. Default isTrue.base (
float|None) – The base of the log space. Default is 10.0.dtype (
str|type[Any] |dtype|SupportsDType|None) – The type of the output array.
- Returns:
samples –
numsamples, equally spaced on a log scale.- Return type:
Quantity or jax.Array
- Raises:
UnitMismatchError – If
startandstopdo not share the same unit.
Examples
>>> import saiunit as u >>> u.math.logspace(0, 2, 4) Array([ 1. , 4.6415887, 21.544348 , 100. ], dtype=float32)