Sequential

Struct Sequential 

Source
pub struct Sequential<A> { /* private fields */ }
Expand description

wrapper for applying ai modules sequentially

Implementations§

Source§

impl<M: AI<M::Output, M::Output> + Op> Sequential<Vec<M>>

Source

pub fn with_next<A: Into<M>>(self, m: A) -> Self

appends the module to the sequence, then returns the sequence

Source§

impl<A> Sequential<A>

Source

pub fn inner(&self) -> &A

references the inner value

Source

pub fn inner_mut(&mut self) -> &mut A

references the inner value

Source

pub fn into_inner(self) -> A

returns the inner value

Source

pub fn new(inner: A) -> Self

Trait Implementations§

Source§

impl<A: AI<R, S> + Op<Output = S>, B: AI<S, T> + Op<Output = T>, C: AI<T, U> + Op<Output = U>, D: AI<U, V> + Op<Output = V>, E: AI<V, W> + Op<Output = W>, F: AI<W, X> + Op<Output = X>, G: AI<X, Y> + Op<Output = Y>, H: AI<Y, Z>, R, S, T, U, V, W, X, Y, Z> AI<R, Z> for Sequential<(A, B, C, D, E, F, G, H)>

Source§

fn forward(&self, input: R) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: R) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<S, T> + Op<Output = T>, B: AI<T, U> + Op<Output = U>, C: AI<U, V> + Op<Output = V>, D: AI<V, W> + Op<Output = W>, E: AI<W, X> + Op<Output = X>, F: AI<X, Y> + Op<Output = Y>, G: AI<Y, Z>, S, T, U, V, W, X, Y, Z> AI<S, Z> for Sequential<(A, B, C, D, E, F, G)>

Source§

fn forward(&self, input: S) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: S) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<T, U> + Op<Output = U>, B: AI<U, V> + Op<Output = V>, C: AI<V, W> + Op<Output = W>, D: AI<W, X> + Op<Output = X>, E: AI<X, Y> + Op<Output = Y>, F: AI<Y, Z>, T, U, V, W, X, Y, Z> AI<T, Z> for Sequential<(A, B, C, D, E, F)>

Source§

fn forward(&self, input: T) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: T) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<U, V> + Op<Output = V>, B: AI<V, W> + Op<Output = W>, C: AI<W, X> + Op<Output = X>, D: AI<X, Y> + Op<Output = Y>, E: AI<Y, Z>, U, V, W, X, Y, Z> AI<U, Z> for Sequential<(A, B, C, D, E)>

Source§

fn forward(&self, input: U) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: U) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<V, W> + Op<Output = W>, B: AI<W, X> + Op<Output = X>, C: AI<X, Y> + Op<Output = Y>, D: AI<Y, Z>, V, W, X, Y, Z> AI<V, Z> for Sequential<(A, B, C, D)>

Source§

fn forward(&self, input: V) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: V) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<W, X> + Op<Output = X>, B: AI<X, Y> + Op<Output = Y>, C: AI<Y, Z>, W, X, Y, Z> AI<W, Z> for Sequential<(A, B, C)>

Source§

fn forward(&self, input: W) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: W) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: AI<X, X>, X> AI<X, X> for Sequential<&[A]>

Source§

fn forward(&self, input: X) -> X

applies to the input
Source§

fn forward_mut(&mut self, input: X) -> Y

applies to the input, possibly updating internal caches
Source§

impl<A: AI<X, X>, X> AI<X, X> for Sequential<&mut [A]>

Source§

fn forward(&self, input: X) -> X

applies to the input
Source§

fn forward_mut(&mut self, input: X) -> X

applies to the input, possibly updating internal caches
Source§

impl<A: AI<X, X>, X> AI<X, X> for Sequential<Vec<A>>

Source§

fn forward(&self, input: X) -> X

applies to the input
Source§

fn forward_mut(&mut self, input: X) -> X

applies to the input, possibly updating internal caches
Source§

impl<A: AI<X, Y> + Op<Output = Y>, B: AI<Y, Z>, X, Y, Z> AI<X, Z> for Sequential<(A, B)>

Source§

fn forward(&self, input: X) -> Z

applies to the input
Source§

fn forward_mut(&mut self, input: X) -> Z

applies to the input, possibly updating internal caches
Source§

impl<A: Clone> Clone for Sequential<A>

Source§

fn clone(&self) -> Sequential<A>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<A: Debug> Debug for Sequential<A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<A: Decompose> Decompose for Sequential<A>

Source§

type Decomposition = <A as Decompose>::Decomposition

the decomposed type
Source§

fn compose(decomposition: Self::Decomposition) -> Self

recreates from the decomposition
Source§

fn decompose(self) -> Self::Decomposition

owned decomposition
Source§

fn decompose_cloned(&self) -> Self::Decomposition

decomposition that copies data
Source§

impl<A: Default> Default for Sequential<A>

Source§

fn default() -> Sequential<A>

Returns the “default value” for a type. Read more
Source§

impl<'de, A> Deserialize<'de> for Sequential<A>
where A: Deserialize<'de>,

Source§

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<A: IntoSequence<M>, M: AI<M::Output, M::Output> + Op> IntoSequence<M> for Sequential<Vec<A>>

Source§

fn into_sequence(self) -> Sequential<Vec<M>>

converts into a sequential module list
Source§

impl<A: AI<X, X> + Op<Output = X>, X> Op for Sequential<&[A]>

Source§

type Output = X

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: AI<X, X> + Op<Output = X>, X> Op for Sequential<&mut [A]>

Source§

type Output = X

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = Y>, B: AI<Y, Z> + Op<Output = Z>, Y, Z> Op for Sequential<(A, B)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = X>, B: AI<Y, Z> + Op<Output = Y>, C: AI<Y, Z> + Op<Output = Z>, X, Y, Z> Op for Sequential<(A, B, C)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = W>, B: AI<W, X> + Op<Output = X>, C: AI<Y, Z> + Op<Output = Y>, D: AI<Y, Z> + Op<Output = Z>, W, X, Y, Z> Op for Sequential<(A, B, C, D)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = V>, B: AI<V, W> + Op<Output = W>, C: AI<W, X> + Op<Output = X>, D: AI<Y, Z> + Op<Output = Y>, E: AI<Y, Z> + Op<Output = Z>, V, W, X, Y, Z> Op for Sequential<(A, B, C, D, E)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = U>, B: AI<U, V> + Op<Output = V>, C: AI<V, W> + Op<Output = W>, D: AI<W, X> + Op<Output = X>, E: AI<Y, Z> + Op<Output = Y>, F: AI<Y, Z> + Op<Output = Z>, U, V, W, X, Y, Z> Op for Sequential<(A, B, C, D, E, F)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = T>, B: AI<T, U> + Op<Output = U>, C: AI<U, V> + Op<Output = V>, D: AI<V, W> + Op<Output = W>, E: AI<W, X> + Op<Output = X>, F: AI<Y, Z> + Op<Output = Y>, G: AI<Y, Z> + Op<Output = Z>, T, U, V, W, X, Y, Z> Op for Sequential<(A, B, C, D, E, F, G)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: Op<Output = S>, B: AI<S, T> + Op<Output = T>, C: AI<T, U> + Op<Output = U>, D: AI<U, V> + Op<Output = V>, E: AI<V, W> + Op<Output = W>, F: AI<W, X> + Op<Output = X>, G: AI<Y, Z> + Op<Output = Y>, H: AI<Y, Z> + Op<Output = Z>, S, T, U, V, W, X, Y, Z> Op for Sequential<(A, B, C, D, E, F, G, H)>

Source§

type Output = Z

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A: AI<X, X> + Op<Output = X>, X> Op for Sequential<Vec<A>>

Source§

type Output = X

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>
where Self: Sized, AbnormalSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn abs(self) -> Abs<Self>
where Self: Sized, Abs<Self>: Op,

wraps with an absolute value operation
Source§

fn acc_q(self, gamma: f32) -> AccQ<Self>
where AccQ<Self>: Op, Self: Sized,

wraps with a accq operation
Source§

fn cat(self, dim: i32) -> Cat<Self>
where Cat<Self>: Op, Self: Sized,

wraps with a cat operation
Source§

fn chain<B>(self, b: B) -> Sequential<(Self, B)>
where Self: Sized, Sequential<(Self, B)>: Op,

sequences with another ai operation
Source§

fn cross_entropy(self, temperature: f32) -> CrossEntropy<Self>
where CrossEntropy<Self>: Op, Self: Sized,

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 duplicate(self) -> Duplicate<Self>
where Duplicate<Self>: Op, Self: Sized,

wraps with a duplicate operation
Source§

fn fix_type<Z>(self) -> SetType<Self, Z, Z>
where Self: AI<Z, Z> + Sized,

set type but with the same input and output
Source§

fn flatten<R: Clone>(self, args: R) -> Flatten<Self, R>
where Flatten<Self, R>: Op, Self: Sized,

wraps with a flatten layer
Source§

fn forward_fixed<Z>(&self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_fixed_mut<Z>(&mut self, input: Z) -> Z
where Self: AI<Z, Z> + Sized,

applies to the input
Source§

fn forward_typed<W, Z>(&self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input
Source§

fn forward_typed_mut<W, Z>(&mut self, input: W) -> Z
where Self: AI<W, Z> + Sized,

applies to the input, possibly updating internal caches
Source§

fn infer_autoregressive<X, Y>(self, input: X) -> Autoregression<Self, Y>
where Self: AI<X, Y> + AI<Y, Y> + Sized, Y: Clone,

creates an autoregressive inference
Source§

fn log_softmax(self, temperature: f32) -> LogSoftmax<Self>
where Self: Sized, LogSoftmax<Self>: Op,

wraps with a softmax operation
Source§

fn map<B>(self, b: B) -> Map<Sequential<(Self, B)>>
where Map<Sequential<(Self, B)>>: Op, Self: Sized, Sequential<(Self, B)>: Op,

applies the operation to every output
Source§

fn mean(self) -> Mean<Self>
where Mean<Self>: Op, Self: Sized,

wraps with a mean operation
Source§

fn optional(self) -> Option<Self>
where Self: Sized,

creates an optional operation
Source§

fn reshape<R: Clone>(self, args: R) -> Reshape<Self, R>
where Reshape<Self, R>: Op, Self: Sized,

wraps with a reshape layer
Source§

fn residual(self) -> Residual<Self>
where Residual<Self>: Op, Self: Sized,

wraps in a residual layer
Source§

fn set_type<W, Z>(self) -> SetType<Self, W, Z>
where Self: AI<W, Z> + Sized,

sets the input output types
Source§

fn soft_choose(self, temperature: f32) -> Choose<Self>
where Self: Sized, Choose<Self>: Op,

wraps with a choose operation
Source§

fn softmax(self, temperature: f32) -> Softmax<Self>
where Self: Sized, Softmax<Self>: Op,

wraps with a softmax operation
Source§

fn squared_error(self) -> SquaredError<Self>
where SquaredError<Self>: Op, Self: Sized,

wraps with a mse operation
Source§

fn squeeze(self, dim: i32) -> Squeeze<Self>
where Squeeze<Self>: Op, Self: Sized,

wraps with a squeeze operation
Source§

fn stack(self, dim: i32) -> Stack<Self>
where Stack<Self>: Op, Self: Sized,

wraps with a stack operation
Source§

fn to_each(self) -> Map<Self>
where Map<Self>: Op, Self: Sized,

wraps with a map operation
Source§

fn unsqueeze(self, dim: i32) -> Unsqueeze<Self>
where Unsqueeze<Self>: Op, Self: Sized,

wraps with a unsqueeze operation
Source§

fn sum(self) -> Sum<Self>
where Sum<Self>: Op, Self: Sized,

wraps with a sum operation
Source§

fn wrap_inner(self) -> Inner<Self>
where Self: Sized,

wraps the inner value so it can be unwrapped with unwrap inner
Source§

fn zip<B>(self, b: B) -> Zip<(Self, B)>
where Self: Sized, Zip<(Self, B)>: Op,

zips with another ai operation
Source§

impl<A> Serialize for Sequential<A>
where A: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<W: Wrappable> Wrappable for Sequential<W>

Source§

type B = <W as Wrappable>::B

Source§

type With<C: Backend> = Sequential<<W as Wrappable>::With<C>>

Source§

impl<A: Copy> Copy for Sequential<A>

Auto Trait Implementations§

§

impl<A> Freeze for Sequential<A>
where A: Freeze,

§

impl<A> RefUnwindSafe for Sequential<A>
where A: RefUnwindSafe,

§

impl<A> Send for Sequential<A>
where A: Send,

§

impl<A> Sync for Sequential<A>
where A: Sync,

§

impl<A> Unpin for Sequential<A>
where A: Unpin,

§

impl<A> UnwindSafe for Sequential<A>
where A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Adaptor<()> for T

Source§

fn adapt(&self)

Adapt the type to be passed to a metric.
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Shortcuts for T
where T: Op + ?Sized,

Source§

fn classification(self) -> Classification<Self>
where Classification<Self>: Op, Self: Sized,

wraps in a classification wrapper
Source§

fn regression(self) -> Regression<Self>
where Regression<Self>: Op, Self: Sized,

wraps in a regression wrapper
Source§

fn wrap(self) -> Wrapped<Self>
where Self: Wrappable,

wraps in a burn wrapper
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,