Struct relearn::spaces::OptionSpace [−][src]
pub struct OptionSpace<S> {
pub inner: S,
}
Expand description
A space whose elements are either None
or Some(inner_elem)
.
The feature vectors are
1, 0, ..., 0
forNone
0, inner_feature_vector(x)
forSome(x)
.
Fields
inner: S
Implementations
Trait Implementations
Length of the feature vectors in which which elements are encoded.
impl<S, T2> BatchFeatureSpace<T2> for OptionSpace<S> where
S: BaseFeatureSpace,
Self: PhantomBatchFeatureSpace<T2>,
impl<S, T2> BatchFeatureSpace<T2> for OptionSpace<S> where
S: BaseFeatureSpace,
Self: PhantomBatchFeatureSpace<T2>,
Feature vectors are:
1, 0, ..., 0
forNone
0, feature_vector(x)
forSome(x)
.
fn batch_features<'a, I>(&self, elements: I) -> T2 where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
fn batch_features<'a, I>(&self, elements: I) -> T2 where
I: IntoIterator<Item = &'a Self::Element>,
I::IntoIter: ExactSizeIterator,
Self::Element: 'a,
Construct a matrix of feature vectors for a set of elements. Read more
impl<S, T2> BatchFeatureSpaceOut<T2> for OptionSpace<S> where
S: BaseFeatureSpace,
Self: PhantomBatchFeatureSpaceOut<T2>,
impl<S, T2> BatchFeatureSpaceOut<T2> for OptionSpace<S> where
S: BaseFeatureSpace,
Self: PhantomBatchFeatureSpaceOut<T2>,
fn batch_features_out<'a, I>(&self, elements: I, out: &mut T2, zeroed: bool) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
fn batch_features_out<'a, I>(&self, elements: I, out: &mut T2, zeroed: bool) where
I: IntoIterator<Item = &'a Self::Element>,
Self::Element: 'a,
Construct a matrix of feature vectors for a set of elements. Read more
Returns the “default value” for a type. Read more
impl<S> Distribution<<OptionSpace<S> as Space>::Element> for OptionSpace<S> where
S: Space + Distribution<S::Element>,
impl<S> Distribution<<OptionSpace<S> as Space>::Element> for OptionSpace<S> where
S: Space + Distribution<S::Element>,
Generate a random value of T
, using rng
as the source of randomness.
Create an iterator that generates random values of T
, using rng
as
the source of randomness. Read more
Create a value of type T
from an element reference.
impl<S, T> FeatureSpace<ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>> for OptionSpace<S> where
S: for<'a> FeatureSpaceOut<ArrayViewMut<'a, T, Ix1>>,
T: Clone + Zero + One,
impl<S, T> FeatureSpace<ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>> for OptionSpace<S> where
S: for<'a> FeatureSpaceOut<ArrayViewMut<'a, T, Ix1>>,
T: Clone + Zero + One,
impl<S, T> FeatureSpaceOut<ArrayBase<T, Dim<[usize; 1]>>> for OptionSpace<S> where
S: for<'a> FeatureSpaceOut<ArrayViewMut<'a, T::Elem, Ix1>>,
T: DataMut,
T::Elem: Clone + Zero + One,
impl<S, T> FeatureSpaceOut<ArrayBase<T, Dim<[usize; 1]>>> for OptionSpace<S> where
S: for<'a> FeatureSpaceOut<ArrayViewMut<'a, T::Elem, Ix1>>,
T: DataMut,
T::Elem: Clone + Zero + One,
Try to convert an index to an element. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for OptionSpace<S> where
S: RefUnwindSafe,
impl<S> Send for OptionSpace<S> where
S: Send,
impl<S> Sync for OptionSpace<S> where
S: Sync,
impl<S> Unpin for OptionSpace<S> where
S: Unpin,
impl<S> UnwindSafe for OptionSpace<S> where
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.