gxm.spaces.Box#
- class Box(low, high, shape)#
Bases:
SpaceA bounded box in \(\mathbb{R}^n\).
- __init__(low, high, shape)#
Methods
__init__(low, high, shape)contains(x)Check whether specific object is within space.
sample(key[, shape])Sample uniformly from the box.
Attributes
Lower bound of the box.
Upper bound of the box.
Shape of the box.
- contains(x)#
Check whether specific object is within space.
- Parameters:
x (
Any) – Object to be checked.- Return type:
Array- Returns:
Whether the object is within the space.
-
high:
Array# Upper bound of the box.
-
low:
Array# Lower bound of the box.
- property n: int#
- sample(key, shape=())#
Sample uniformly from the box.
- Parameters:
key (
Array) – JAX random key.shape (
Tuple[int,...]) – Shape of the sample to be drawn.
- Return type:
Any- Returns:
Sample drawn from the box.
-
shape:
Tuple[int,...]# Shape of the box.