Dcg

Struct Dcg 

Source
pub struct Dcg<T> { /* private fields */ }

Implementations§

Source§

impl<T> Dcg<T>

Source

pub fn new() -> Self

Source

pub fn binary( &mut self, lhs: NodeIndex, rhs: NodeIndex, op: impl Into<BinaryOp>, ) -> NodeIndex

Source

pub fn constant(&mut self, value: T) -> NodeIndex

Source

pub fn get(&self, index: NodeIndex) -> Option<&Node<T>>

Source

pub fn include(&mut self, node: impl Into<Node<T>>) -> NodeIndex

Source

pub fn input(&mut self, param: bool, value: T) -> NodeIndex

Source

pub fn op( &mut self, inputs: impl IntoIterator<Item = NodeIndex>, op: impl Into<Op>, ) -> NodeIndex

Source

pub fn remove(&mut self, index: NodeIndex) -> Option<Node<T>>

Source

pub fn unary(&mut self, input: NodeIndex, op: impl Into<UnaryOp>) -> NodeIndex

Source

pub fn variable(&mut self, value: T) -> NodeIndex

Source

pub fn add(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn div(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn mul(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn pow(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn rem(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn sub(&mut self, lhs: NodeIndex, rhs: NodeIndex) -> NodeIndex

Source

pub fn abs(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn acos(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn acosh(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn asin(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn asinh(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn atan(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn atanh(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn ceil(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn cos(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn cosh(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn exp(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn floor(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn inv(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn ln(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn neg(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn recip(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn sin(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn sinh(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn sqr(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn sqrt(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn tan(&mut self, recv: NodeIndex) -> NodeIndex

Source

pub fn tanh(&mut self, recv: NodeIndex) -> NodeIndex

Source§

impl<T> Dcg<T>
where T: Scalar<Real = T>,

Source

pub fn backward(&self) -> Result<HashMap<NodeIndex, T>>

Source

pub fn gradient(&self, target: NodeIndex) -> Result<HashMap<NodeIndex, T>>

Trait Implementations§

Source§

impl<T> Default for Dcg<T>

Source§

fn default() -> Self

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

impl<T> Index<NodeIndex> for Dcg<T>

Source§

type Output = Node<T>

The returned type after indexing.
Source§

fn index(&self, index: NodeIndex) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<T> Freeze for Dcg<T>

§

impl<T> RefUnwindSafe for Dcg<T>
where T: RefUnwindSafe,

§

impl<T> Send for Dcg<T>
where T: Send,

§

impl<T> Sync for Dcg<T>
where T: Sync,

§

impl<T> Unpin for Dcg<T>
where T: Unpin,

§

impl<T> UnwindSafe for Dcg<T>
where T: 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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<K, Q> Id<K> for Q
where K: Identifier, Q: Borrow<K>,

Source§

type Q = Q

Source§

fn from_id(id: <Q as Id<K>>::Q) -> Q

Source§

fn get(&self) -> &<Q as Id<K>>::Q

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<S, F> IntoOp<F> for S
where F: Operator, S: Into<F>,

Source§

fn into_op(self) -> F

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.