Struct concision_linear::prelude::Linear

source ·
pub struct Linear<T = f64, D = Ix2>
where D: RemoveAxis,
{ /* private fields */ }
Expand description

Linear model

Implementations§

source§

impl<T, D> Linear<T, D>
where D: RemoveAxis,

source

pub fn with_params<D2>(self, params: LinearParams<T, D2>) -> Linear<T, D2>
where D2: RemoveAxis,

source

pub fn config(&self) -> &Config

source

pub fn bias(&self) -> Option<&Array<T, D::Smaller>>

source

pub fn bias_mut(&mut self) -> Option<&mut Array<T, D::Smaller>>

source

pub fn weights(&self) -> &Array<T, D>

source

pub fn weights_mut(&mut self) -> &mut Array<T, D>

source

pub fn params(&self) -> &LinearParams<T, D>

source

pub fn params_mut(&mut self) -> &mut LinearParams<T, D>

source

pub fn is_biased(&self) -> bool

source

pub fn activate<X, Y, F>(&self, args: &X, func: F) -> Result<Y>
where F: for<'a> Fn(&'a Y) -> Y, Self: Predict<X, Output = Y>,

source§

impl<T, D> Linear<T, D>

source

pub fn uniform(self) -> Self

source§

impl<T> Linear<T>

source

pub fn std(config: Config) -> Self
where T: Clone + Default,

Trait Implementations§

source§

impl<T, D> Borrow<Config> for Linear<T, D>
where D: RemoveAxis,

source§

fn borrow(&self) -> &Config

Immutably borrows from an owned value. Read more
source§

impl<T, D> Borrow<LinearParamsBase<OwnedRepr<T>, D>> for Linear<T, D>
where D: RemoveAxis,

source§

fn borrow(&self) -> &LinearParams<T, D>

Immutably borrows from an owned value. Read more
source§

impl<T, D> BorrowMut<LinearParamsBase<OwnedRepr<T>, D>> for Linear<T, D>
where D: RemoveAxis,

source§

fn borrow_mut(&mut self) -> &mut LinearParams<T, D>

Mutably borrows from an owned value. Read more
source§

impl<T, D> Module for Linear<T, D>
where D: RemoveAxis,

§

type Config = Config

§

type Params = LinearParamsBase<OwnedRepr<T>, D>

source§

fn config(&self) -> &Self::Config

source§

fn params(&self) -> &Self::Params

source§

fn params_mut(&mut self) -> &mut Self::Params

source§

impl<X, Y, A, D> Predict<X> for Linear<A, D>
where D: RemoveAxis, LinearParams<A, D>: Predict<X, Output = Y>,

§

type Output = Y

source§

fn predict(&self, input: &X) -> Result<Self::Output, PredictError>

Auto Trait Implementations§

§

impl<T, D> Freeze for Linear<T, D>
where D: Freeze, <D as Dimension>::Smaller: Freeze,

§

impl<T, D> RefUnwindSafe for Linear<T, D>

§

impl<T, D> Send for Linear<T, D>
where T: Send,

§

impl<T, D> Sync for Linear<T, D>
where T: Sync,

§

impl<T, D> Unpin for Linear<T, D>
where D: Unpin, <D as Dimension>::Smaller: Unpin,

§

impl<T, D> UnwindSafe for Linear<T, D>

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more