Axis for systematic logarithmic grid sampling over parameter bounds.
Generates logarithmically spaced values between low and high bounds using deterministic grid sampling. Useful for parameters that span multiple orders of magnitude (e.g., learning rates, regularization coefficients).
Array of logarithmically spaced values from low to high. If shape is specified, values are broadcast to shape (n,) + shape with identical values across additional dimensions.
Source Code
# spaces.LogGridAxis { #tvboptim.spaces.LogGridAxis }```pythonspaces.LogGridAxis(low, high, n, shape=None)```Axis for systematic logarithmic grid sampling over parameter bounds.Generates logarithmically spaced values between low and high bounds usingdeterministic grid sampling. Useful for parameters that span multiple ordersof magnitude (e.g., learning rates, regularization coefficients).## Parameters {.doc-section .doc-section-parameters}| Name | Type | Description | Default ||--------|------------------|----------------------------------------------|------------|| low |[float](`float`)| Lower bound for sampling (must be positive). | _required_ || high |[float](`float`)| Upper bound for sampling (must be positive). | _required_ || n |[int](`int`)| Number of grid points to generate. | _required_ |## Raises {.doc-section .doc-section-raises}| Name | Type | Description ||--------|----------------------------|-------------------------------------------------------------|||[ValueError](`ValueError`)| If n <= 0, low >= high, or if low or high are not positive. |## Examples {.doc-section .doc-section-examples}```python>>> log_grid = LogGridAxis(0.001, 1.0, 5)>>> values = log_grid.generate_values()>>>print(values) # [0.001, 0.00562, 0.0316, 0.178, 1.0] (approximately)```## Attributes| Name | Description || ---| ---||[size](#tvboptim.spaces.LogGridAxis.size)| Number of grid points. |## Methods| Name | Description || ---| ---||[generate_values](#tvboptim.spaces.LogGridAxis.generate_values)| Generate logarithmically spaced grid values. |### generate_values { #tvboptim.spaces.LogGridAxis.generate_values }```pythonspaces.LogGridAxis.generate_values(key=None)```Generate logarithmically spaced grid values.#### Parameters {.doc-section .doc-section-parameters}| Name | Type | Description | Default ||--------|---------------------------------------------------------------------|------------------------------------------------------|-----------|| key |[jax](`jax`).[random](`jax.random`).[PRNGKey](`jax.random.PRNGKey`)| Random key. Ignored for deterministic grid sampling. |`None`|#### Returns {.doc-section .doc-section-returns}| Name | Type | Description ||--------|---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|||[jnp](`jax.numpy`).[ndarray](`jax.numpy.ndarray`)| Array of logarithmically spaced values from low to high. If shape is specified, values are broadcast to shape (n,) + shape with identical values across additional dimensions. |