Struct relearn::spaces::BooleanSpace
source · [−]pub struct BooleanSpace;
Expand description
The space {false, true}
.
Implementations
sourceimpl BooleanSpace
impl BooleanSpace
Trait Implementations
sourceimpl Clone for BooleanSpace
impl Clone for BooleanSpace
sourcefn clone(&self) -> BooleanSpace
fn clone(&self) -> BooleanSpace
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for BooleanSpace
impl Debug for BooleanSpace
sourceimpl Default for BooleanSpace
impl Default for BooleanSpace
sourcefn default() -> BooleanSpace
fn default() -> BooleanSpace
Returns the “default value” for a type. Read more
sourceimpl<'de> Deserialize<'de> for BooleanSpace
impl<'de> Deserialize<'de> for BooleanSpace
sourcefn 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
sourceimpl Display for BooleanSpace
impl Display for BooleanSpace
sourceimpl Distribution<<BooleanSpace as Space>::Element> for BooleanSpace
impl Distribution<<BooleanSpace as Space>::Element> for BooleanSpace
sourcefn 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.
sourcefn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T> where
R: Rng,
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
sourceimpl FeatureSpace for BooleanSpace
impl FeatureSpace for BooleanSpace
Features are [0.0]
for false
and [1.0]
for true
sourcefn num_features(&self) -> usize
fn num_features(&self) -> usize
Length of the encoded feature vectors.
sourcefn features_out<'a, F: Float>(
&self,
element: &Self::Element,
out: &'a mut [F],
_zeroed: bool
) -> &'a mut [F]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
fn features_out<'a, F: Float>(
&self,
element: &Self::Element,
out: &'a mut [F],
_zeroed: bool
) -> &'a mut [F]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Encode the feature vector of an element into a mutable slice. Read more
sourcefn features<T>(&self, element: &Self::Element) -> T where
T: BuildFromArray1D,
<T::Array as NumArray1D>::Elem: Float,
fn features<T>(&self, element: &Self::Element) -> T where
T: BuildFromArray1D,
<T::Array as NumArray1D>::Elem: Float,
Encode the feature vector of an element into an array.
sourcefn batch_features_out<'a, I, A>(
&self,
elements: I,
out: &mut ArrayBase<A, Ix2>,
zeroed: bool
) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
A: DataMut,
A::Elem: Float,
fn batch_features_out<'a, I, A>(
&self,
elements: I,
out: &mut ArrayBase<A, Ix2>,
zeroed: bool
) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
A: DataMut,
A::Elem: Float,
Encode the feature vectors of multiple elements into rows of a two-dimensional array. Read more
sourcefn batch_features<'a, I, T>(&self, elements: I) -> T where
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) -> T where
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.
sourceimpl FiniteSpace for BooleanSpace
impl FiniteSpace for BooleanSpace
sourceimpl Hash for BooleanSpace
impl Hash for BooleanSpace
sourceimpl LogElementSpace for BooleanSpace
impl LogElementSpace for BooleanSpace
sourcefn log_element<L: StatsLogger + ?Sized>(
&self,
name: &'static str,
element: &Self::Element,
logger: &mut L
) -> Result<(), LogError>
fn log_element<L: StatsLogger + ?Sized>(
&self,
name: &'static str,
element: &Self::Element,
logger: &mut L
) -> Result<(), LogError>
Log an element of the space
sourceimpl NonEmptySpace for BooleanSpace
impl NonEmptySpace for BooleanSpace
sourcefn some_element(&self) -> Self::Element
fn some_element(&self) -> Self::Element
An arbitrary deterministic element from the space.
sourceimpl ParameterizedDistributionSpace<Tensor, Tensor> for BooleanSpace
impl ParameterizedDistributionSpace<Tensor, Tensor> for BooleanSpace
type Distribution = Bernoulli
type Distribution = Bernoulli
Batched distribution type. Read more
sourcefn num_distribution_params(&self) -> usize
fn num_distribution_params(&self) -> usize
Size of the parameter vector for which elements are sampled.
sourcefn 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
sourcefn distribution(&self, params: &Tensor) -> Self::Distribution
fn distribution(&self, params: &Tensor) -> Self::Distribution
The distribution parameterized by the given parameter vector. Read more
sourceimpl PartialEq<BooleanSpace> for BooleanSpace
impl PartialEq<BooleanSpace> for BooleanSpace
sourceimpl ReprSpace<Tensor, Tensor> for BooleanSpace
impl ReprSpace<Tensor, Tensor> for BooleanSpace
Represent elements as a Boolean valued tensor.
sourcefn batch_repr<'a, I>(&self, elements: I) -> Tensor where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator + Clone,
Self::Element: 'a,
fn batch_repr<'a, I>(&self, elements: I) -> Tensor where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator + Clone,
Self::Element: 'a,
Represent a batch of elements as an array.
sourceimpl Serialize for BooleanSpace
impl Serialize for BooleanSpace
sourceimpl Space for BooleanSpace
impl Space for BooleanSpace
sourceimpl SubsetOrd for BooleanSpace
impl SubsetOrd for BooleanSpace
sourcefn 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.
sourcefn strict_subset_of(&self, other: &Self) -> bool
fn strict_subset_of(&self, other: &Self) -> bool
Check if this is a strict subset of other
.
sourcefn subset_of(&self, other: &Self) -> bool
fn subset_of(&self, other: &Self) -> bool
Check if this is a subset (strict or equal) of other
.
sourcefn strict_superset_of(&self, other: &Self) -> bool
fn strict_superset_of(&self, other: &Self) -> bool
Check if this is a strict superset of other
.
sourcefn 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 StructuralEq for BooleanSpace
impl StructuralPartialEq for BooleanSpace
Auto Trait Implementations
impl RefUnwindSafe for BooleanSpace
impl Send for BooleanSpace
impl Sync for BooleanSpace
impl Unpin for BooleanSpace
impl UnwindSafe for BooleanSpace
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.