Skip to content

Multi Binary

lerax.space.MultiBinary

Bases: AbstractSpace[Bool[Array, ' n'], None]

A space of binary values.

All dimensions are independent and can take values 0 or 1.

Attributes:

Name Type Description
n tuple[int, ...]

The shape of the multi-binary space.

Parameters:

Name Type Description Default
n int | tuple[int, ...]

The shape of the multi-binary space. If an integer is provided, then the shape will be (n,).

required

n instance-attribute

n: tuple[int, ...]

shape property

shape: tuple[int, ...]

flat_size property

flat_size: int

__contains__

__contains__(x: Any) -> bool

__init__

__init__(n: int | tuple[int, ...])

canonical

canonical() -> Bool[Array, ' n']

sample

sample(*, key: Key, mask: None = None) -> Bool[Array, ' n']

contains

contains(x: Any) -> Bool[Array, '']

__eq__

__eq__(other: object) -> bool

__repr__

__repr__() -> str

__hash__

__hash__() -> int

flatten_sample

flatten_sample(
    sample: Bool[ArrayLike, " n"],
) -> Float[Array, " n"]