Action Spaces
Contains action space definitions
Classes:
|
Abstract ActionSpace class. |
|
Action space that takes floating point inputs. |
|
Action space that takes integer inputs. |
- class holoocean.spaces.ActionSpace(shape, buffer_shape=None)
Abstract ActionSpace class.
- Parameters:
shape (
listofint): The shape of data that should be input to step or tick. buffer_shape (listofint, optional): The shape of the data that will bewritten to the shared memory.
Only use this when it is different from shape.
Methods:
get_high()The maximum value(s) for the action space.
get_low()The minimum value(s) for the action space.
sample()Sample from the action space.
Attributes:
Get the shape of the action space.
- get_high()
The maximum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s maximum value(s)
- get_low()
The minimum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s minimum value(s)
- sample()
Sample from the action space.
- Returns:
(
np.ndarray): A valid command to be input to step or tick.
- property shape
Get the shape of the action space.
- Returns:
(
listofint): The shape of the action space.
- class holoocean.spaces.ContinuousActionSpace(shape, low=None, high=None, sample_fn=None, buffer_shape=None)
Action space that takes floating point inputs.
- Parameters:
shape (
listofint): The shape of data that should be input to step or tick. sample_fn (function, optional): A function that takes a shape parameter and outputs asampled command.
low (
listoffloatorfloat): the low value(s) for the action space. Can be a scalar or an array high (listoffloatorfloat): the high value(s) for the action space. Cand be a scalar or an arrayIf this is not given, it will default to sampling from a unit gaussian.
- buffer_shape (
listofint, optional): The shape of the data that will be written to the shared memory.
Only use this when it is different from
shape.
- buffer_shape (
Methods:
get_high()The maximum value(s) for the action space.
get_low()The minimum value(s) for the action space.
sample()Sample from the action space.
- get_high()
The maximum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s maximum value(s)
- get_low()
The minimum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s minimum value(s)
- sample()
Sample from the action space.
- Returns:
(
np.ndarray): A valid command to be input to step or tick.
- class holoocean.spaces.DiscreteActionSpace(shape, low, high, buffer_shape=None)
Action space that takes integer inputs.
- Args:
shape (
listofint): The shape of data that should be input to step or tick. low (int): The lowest value to sample. high (int): The highest value to sample. buffer_shape (listofint, optional): The shape of the data that will bewritten to the shared memory.
Only use this when it is different from shape.
Methods:
get_high()The maximum value(s) for the action space.
get_low()The minimum value(s) for the action space.
sample()Sample from the action space.
- get_high()
The maximum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s maximum value(s)
- get_low()
The minimum value(s) for the action space.
- Returns:
(
listoffloatorfloat): the action space’s minimum value(s)
- sample()
Sample from the action space.
- Returns:
(
np.ndarray): A valid command to be input to step or tick.