Struct L1Regularization

Source
pub struct L1Regularization<RHS, LHS>
where RHS: Node, LHS: Node,
{ pub rhs: RefCell<RHS>, pub lhs: RefCell<LHS>, pub output: RefCell<Value<NDArray<f64>>>, pub gradient: RefCell<Value<NDArray<f64>>>, pub learning_rate: f64, }

Fields§

§rhs: RefCell<RHS>§lhs: RefCell<LHS>§output: RefCell<Value<NDArray<f64>>>§gradient: RefCell<Value<NDArray<f64>>>§learning_rate: f64

Implementations§

Source§

impl<RHS, LHS> L1Regularization<RHS, LHS>
where RHS: Node, LHS: Node,

Source

pub fn new(rhs: RHS, lhs: LHS, learning_rate: f64) -> Self

Create new instance of L1 regularization operation

Source

pub fn rhs(&self) -> RefMut<'_, dyn Node>

Get right hand side value of L1 regularization operation

Source

pub fn lhs(&self) -> RefMut<'_, dyn Node>

Get left hand side value of L1 regularization operation

Trait Implementations§

Source§

impl<LHS, RHS> Node for L1Regularization<RHS, LHS>
where RHS: Node, LHS: Node,

Source§

fn forward(&mut self)

Perform forward pass on L1 regularization

Source§

fn backward(&mut self, upstream_gradient: NDArray<f64>)

Perform backward pass on L1 regularization

Source§

fn value(&self) -> NDArray<f64>

Get output value of L1 regularization

Source§

fn grad(&self) -> NDArray<f64>

Get gradient of L1 regularization

Source§

fn set_grad(&mut self, upstream_gradient: NDArray<f64>)

Set gradient of L1 regularization

Auto Trait Implementations§

§

impl<RHS, LHS> !Freeze for L1Regularization<RHS, LHS>

§

impl<RHS, LHS> !RefUnwindSafe for L1Regularization<RHS, LHS>

§

impl<RHS, LHS> !Send for L1Regularization<RHS, LHS>

§

impl<RHS, LHS> !Sync for L1Regularization<RHS, LHS>

§

impl<RHS, LHS> Unpin for L1Regularization<RHS, LHS>
where RHS: Unpin, LHS: Unpin,

§

impl<RHS, LHS> !UnwindSafe for L1Regularization<RHS, LHS>

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