pub struct Linear {
pub w: Array2<f32>,
pub b: Array1<f32>,
pub cache: LinearCache,
pub grads: LinearGrads,
}Fields§
§w: Array2<f32>§b: Array1<f32>§cache: LinearCache§grads: LinearGradsImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Linear
impl<'de> Deserialize<'de> for Linear
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 ToIntermediates for Linear
impl ToIntermediates for Linear
fn intermediates(&mut self) -> Vec<&mut dyn Intermediate>
fn stash_intermediates(&mut self) -> Vec<ArrayD<f32>> ⓘ
fn apply_intermediates(&mut self, intermediates_b: Vec<ArrayD<f32>>)
Source§impl ToParams for Linear
impl ToParams for Linear
fn params(&mut self) -> Vec<Param>
fn zero_grads(&mut self)
fn dump(&mut self) -> Vec<TensorData>
fn load(&mut self, params: Vec<TensorData>)
fn persist(&mut self, path: &str) -> Result<(), Box<dyn Error>>
fn restore(&mut self, path: &str) -> Result<(), Box<dyn Error>>
Auto Trait Implementations§
impl Forget for Linear
impl Freeze for Linear
impl RefUnwindSafe for Linear
impl Send for Linear
impl Sync for Linear
impl Unpin for Linear
impl UnsafeUnpin for Linear
impl UnwindSafe for Linear
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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 more