Struct InputData

Source
pub struct InputData<Data, Algebra>
where Data: HasDims,
{ /* private fields */ }
Expand description

A network that takes a single user data as input and returns it (after a dimension check).

Implementations§

Source§

impl<Data, Algebra> InputData<Data, Algebra>
where Data: HasDims,

Source

pub fn new(dims: Data::Dims) -> Self

Trait Implementations§

Source§

impl<Data, Algebra: Clone> Clone for InputData<Data, Algebra>
where Data: HasDims + Clone, Data::Dims: Clone,

Source§

fn clone(&self) -> InputData<Data, Algebra>

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<Data, Algebra: Debug> Debug for InputData<Data, Algebra>
where Data: HasDims + Debug, Data::Dims: Debug,

Source§

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

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

impl<Data, Value, Dims, Algebra> Net<Algebra> for InputData<Data, Algebra>
where Algebra: HasGradientReader + CoreAlgebra<Data, Value = Value>, Data: HasDims<Dims = Dims>, Dims: Clone + PartialEq + Debug,

Source§

type Input = Data

Input of the network.
Source§

type Output = Value

Output of the network.
Source§

type Weights = ()

External representation for the weights of the network.
Source§

type GradientInfo = ()

How to read the gradients of the weights after a backward pass.
Source§

fn eval_with_gradient_info( &self, graph: &mut Algebra, input: Self::Input, ) -> Result<(Self::Output, Self::GradientInfo)>

Source§

fn get_weights(&self) -> Self::Weights

Source§

fn set_weights(&mut self, _weights: Self::Weights) -> Result<()>

Source§

fn update_weights(&mut self, _delta: Self::Weights) -> Result<()>

Source§

fn read_weight_gradients( &self, _info: Self::GradientInfo, _reader: &Algebra::GradientReader, ) -> Result<Self::Weights>

Source§

fn eval(&self, graph: &mut Algebra, input: Self::Input) -> Result<Self::Output>

Source§

fn map<F, O>(self, f: F) -> Map<Self, F>
where Self: Sized, F: Fn(&mut Algebra, Self::Output) -> Result<O>,

Source§

fn using<N>(self, net: N) -> Using<Self, N>
where Self: Sized, N: Net<Algebra, Input = ()>,

Source§

fn then<N>(self, net: N) -> Then<Self, N>
where Self: Sized, N: Net<Algebra, Input = Self::Output>,

Source§

fn and<N>(self, net: N) -> (Self, N)
where Self: Sized, N: Net<Algebra>,

Auto Trait Implementations§

§

impl<Data, Algebra> Freeze for InputData<Data, Algebra>
where <Data as HasDims>::Dims: Freeze,

§

impl<Data, Algebra> RefUnwindSafe for InputData<Data, Algebra>
where <Data as HasDims>::Dims: RefUnwindSafe, Data: RefUnwindSafe, Algebra: RefUnwindSafe,

§

impl<Data, Algebra> Send for InputData<Data, Algebra>
where <Data as HasDims>::Dims: Send, Data: Send, Algebra: Send,

§

impl<Data, Algebra> Sync for InputData<Data, Algebra>
where <Data as HasDims>::Dims: Sync, Data: Sync, Algebra: Sync,

§

impl<Data, Algebra> Unpin for InputData<Data, Algebra>
where <Data as HasDims>::Dims: Unpin, Data: Unpin, Algebra: Unpin,

§

impl<Data, Algebra> UnwindSafe for InputData<Data, Algebra>
where <Data as HasDims>::Dims: UnwindSafe, Data: UnwindSafe, Algebra: UnwindSafe,

Blanket Implementations§

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<N> CheckNet for N
where N: Net<Check>,

Source§

fn check(&self, input: Self::Input) -> Result<Self::Output>

Run a forward pass that only checks dimensions.
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<N> EvalNet for N
where N: Net<Eval>,

Source§

fn evaluate(&self, input: Self::Input) -> Result<Self::Output>

Run a forward pass to evaluate the network on the given input.
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<Data, Algebra, N> SingleOutputNet<Data, Algebra> for N
where N: Net<Algebra>, Algebra: HasGradientReader + CoreAlgebra<Data, Value = <N as Net<Algebra>>::Output>,

Source§

fn add_square_loss(self) -> SquareLoss<Self, Data>
where Self: Sized,

A network that takes an additional input and returns the L2-distance with the output of the initial network.
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.