pub struct Apply<F: Fn(X) -> Y, X, Y> { /* private fields */ }Expand description
applies a closure to the input// TODO more closure layers maybe
Trait Implementations§
Source§impl<'de, F, X, Y> Deserialize<'de> for Apply<F, X, Y>where
F: Deserialize<'de> + Fn(X) -> Y,
impl<'de, F, X, Y> Deserialize<'de> for Apply<F, X, Y>where
F: Deserialize<'de> + Fn(X) -> Y,
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<F: Fn(X) -> Y, M: AI<M::Output, M::Output> + Op, X, Y> IntoSequence<M> for Apply<F, X, Y>where
Self: Into<M>,
impl<F: Fn(X) -> Y, M: AI<M::Output, M::Output> + Op, X, Y> IntoSequence<M> for Apply<F, X, Y>where
Self: Into<M>,
Source§fn into_sequence(self) -> Sequential<Vec<M>>
fn into_sequence(self) -> Sequential<Vec<M>>
converts into a sequential module list
Source§impl<F: Fn(X) -> Y, X, Y> Op for Apply<F, X, Y>
impl<F: Fn(X) -> Y, X, Y> Op for Apply<F, X, Y>
Source§type Output = Y
type Output = Y
suggested output type to help with composition coherence. Ideally, Self should implement AI<X,Self::Output> for some X
Source§fn abnormal_softmax(self, temperature: f32) -> AbnormalSoftmax<Self>
fn abnormal_softmax(self, temperature: f32) -> AbnormalSoftmax<Self>
wraps with a softmax operation
Source§fn chain<B>(self, b: B) -> Sequential<(Self, B)>
fn chain<B>(self, b: B) -> Sequential<(Self, B)>
sequences with another ai operation
Source§fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
wraps with a cross entropy operation. If temperature is a number it will be used to apply softmax to the logits before computing entropy with the target. if the input will already be a probability distribution instead of logits, put NaN temperature
Source§fn forward_fixed<Z>(&self, input: Z) -> Z
fn forward_fixed<Z>(&self, input: Z) -> Z
applies to the input
Source§fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
applies to the input
Source§fn forward_typed<W, Z>(&self, input: W) -> Z
fn forward_typed<W, Z>(&self, input: W) -> Z
applies to the input
Source§fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
applies to the input, possibly updating internal caches
Source§fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y> ⓘ
fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y> ⓘ
creates an autoregressive inference
Source§fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
wraps with a softmax operation
Source§fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
applies the operation to every output
Source§fn soft_choose(self, temperature: f32) -> Choose<Self>
fn soft_choose(self, temperature: f32) -> Choose<Self>
wraps with a choose operation
Source§fn squared_error(self) -> SquaredError<Self>
fn squared_error(self) -> SquaredError<Self>
wraps with a mse operation
Source§fn wrap_inner(self) -> Inner<Self>where
Self: Sized,
fn wrap_inner(self) -> Inner<Self>where
Self: Sized,
wraps the inner value so it can be unwrapped with unwrap inner
impl<F: Copy + Fn(X) -> Y, X: Copy, Y: Copy> Copy for Apply<F, X, Y>
Auto Trait Implementations§
impl<F, X, Y> Freeze for Apply<F, X, Y>where
F: Freeze,
impl<F, X, Y> RefUnwindSafe for Apply<F, X, Y>where
F: RefUnwindSafe,
impl<F, X, Y> Send for Apply<F, X, Y>where
F: Send,
impl<F, X, Y> Sync for Apply<F, X, Y>where
F: Sync,
impl<F, X, Y> Unpin for Apply<F, X, Y>where
F: Unpin,
impl<F, X, Y> UnwindSafe for Apply<F, X, Y>where
F: UnwindSafe,
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Shortcuts for T
impl<T> Shortcuts for T
Source§fn classification(self) -> Classification<Self>
fn classification(self) -> Classification<Self>
wraps in a classification wrapper
Source§fn regression(self) -> Regression<Self>
fn regression(self) -> Regression<Self>
wraps in a regression wrapper