pub struct BooleanSpace;
Expand description
The space {false, true}
.
Implementations§
Source§impl BooleanSpace
impl BooleanSpace
Trait Implementations§
Source§impl Clone for BooleanSpace
impl Clone for BooleanSpace
Source§fn clone(&self) -> BooleanSpace
fn clone(&self) -> BooleanSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BooleanSpace
impl Debug for BooleanSpace
Source§impl Default for BooleanSpace
impl Default for BooleanSpace
Source§fn default() -> BooleanSpace
fn default() -> BooleanSpace
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BooleanSpace
impl<'de> Deserialize<'de> for BooleanSpace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for BooleanSpace
impl Display for BooleanSpace
Source§impl Distribution<<BooleanSpace as Space>::Element> for BooleanSpace
impl Distribution<<BooleanSpace as Space>::Element> for BooleanSpace
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> <Self as Space>::Element
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> <Self as Space>::Element
Generate a random value of
T
, using rng
as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
Create an iterator that generates random values of
T
, using rng
as
the source of randomness. Read moreSource§impl FeatureSpace for BooleanSpace
Features are [0.0]
for false
and [1.0]
for true
impl FeatureSpace for BooleanSpace
Features are [0.0]
for false
and [1.0]
for true
Source§fn num_features(&self) -> usize
fn num_features(&self) -> usize
Length of the encoded feature vectors.
Source§fn features_out<'a, F: Float>(
&self,
element: &Self::Element,
out: &'a mut [F],
_zeroed: bool,
) -> &'a mut [F]
fn features_out<'a, F: Float>( &self, element: &Self::Element, out: &'a mut [F], _zeroed: bool, ) -> &'a mut [F]
Encode the feature vector of an element into a mutable slice. Read more
Source§fn features<T>(&self, element: &Self::Element) -> T
fn features<T>(&self, element: &Self::Element) -> T
Encode the feature vector of an element into an array.
Source§fn batch_features_out<'a, I, A>(
&self,
elements: I,
out: &mut ArrayBase<A, Ix2>,
zeroed: bool,
)
fn batch_features_out<'a, I, A>( &self, elements: I, out: &mut ArrayBase<A, Ix2>, zeroed: bool, )
Encode the feature vectors of multiple elements into rows of a two-dimensional array. Read more
Source§fn batch_features<'a, I, T>(&self, elements: I) -> Twhere
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
T: BuildFromArray2D,
<T::Array as NumArray2D>::Elem: Float,
fn batch_features<'a, I, T>(&self, elements: I) -> Twhere
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
T: BuildFromArray2D,
<T::Array as NumArray2D>::Elem: Float,
Encode the feature vectors of multiple elements as rows of a two-dimensional array.
Source§impl FiniteSpace for BooleanSpace
impl FiniteSpace for BooleanSpace
Source§impl Hash for BooleanSpace
impl Hash for BooleanSpace
Source§impl LogElementSpace for BooleanSpace
impl LogElementSpace for BooleanSpace
Source§impl NonEmptySpace for BooleanSpace
impl NonEmptySpace for BooleanSpace
Source§fn some_element(&self) -> Self::Element
fn some_element(&self) -> Self::Element
An arbitrary deterministic element from the space.
Source§impl ParameterizedDistributionSpace<Tensor> for BooleanSpace
impl ParameterizedDistributionSpace<Tensor> for BooleanSpace
Source§type Distribution = Bernoulli
type Distribution = Bernoulli
Batched distribution type. Read more
Source§fn num_distribution_params(&self) -> usize
fn num_distribution_params(&self) -> usize
Size of the parameter vector for which elements are sampled.
Source§fn sample_element(&self, params: &Tensor) -> Self::Element
fn sample_element(&self, params: &Tensor) -> Self::Element
Sample a single element given a parameter vector. Read more
Source§fn distribution(&self, params: &Tensor) -> Self::Distribution
fn distribution(&self, params: &Tensor) -> Self::Distribution
The distribution parameterized by the given parameter vector. Read more
Source§impl PartialEq for BooleanSpace
impl PartialEq for BooleanSpace
Source§impl ReprSpace<Tensor> for BooleanSpace
Represent elements as a Boolean valued tensor.
impl ReprSpace<Tensor> for BooleanSpace
Represent elements as a Boolean valued tensor.
Source§fn batch_repr<'a, I>(&self, elements: I) -> Tensorwhere
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator + Clone,
Self::Element: 'a,
fn batch_repr<'a, I>(&self, elements: I) -> Tensorwhere
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator + Clone,
Self::Element: 'a,
Represent a batch of elements as an array.
Source§impl Serialize for BooleanSpace
impl Serialize for BooleanSpace
Source§impl Space for BooleanSpace
impl Space for BooleanSpace
Source§impl SubsetOrd for BooleanSpace
impl SubsetOrd for BooleanSpace
Source§fn subset_cmp(&self, _other: &Self) -> Option<Ordering>
fn subset_cmp(&self, _other: &Self) -> Option<Ordering>
Compare using the subset relationship. This is a partial order.
Source§fn strict_subset_of(&self, other: &Self) -> bool
fn strict_subset_of(&self, other: &Self) -> bool
Check if this is a strict subset of
other
.Source§fn subset_of(&self, other: &Self) -> bool
fn subset_of(&self, other: &Self) -> bool
Check if this is a subset (strict or equal) of
other
.Source§fn strict_superset_of(&self, other: &Self) -> bool
fn strict_superset_of(&self, other: &Self) -> bool
Check if this is a strict superset of
other
.Source§fn superset_of(&self, other: &Self) -> bool
fn superset_of(&self, other: &Self) -> bool
Check if this is a superset (strict or equal) of
other
.impl Copy for BooleanSpace
impl Eq for BooleanSpace
impl StructuralPartialEq for BooleanSpace
Auto Trait Implementations§
impl Freeze for BooleanSpace
impl RefUnwindSafe for BooleanSpace
impl Send for BooleanSpace
impl Sync for BooleanSpace
impl Unpin for BooleanSpace
impl UnwindSafe for BooleanSpace
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more