aad::variable

Struct Variable

Source
pub struct Variable<'a> { /* private fields */ }

Implementations§

Source§

impl Variable<'_>

Source

pub fn ln(self) -> Self

Source

pub fn log(self, base: f64) -> Self

Source

pub fn powf(self, power: f64) -> Self

Source

pub fn powi(self, power: i32) -> Self

Source

pub fn exp(self) -> Self

Source

pub fn sqrt(self) -> Self

Source

pub fn cbrt(self) -> Self

Source

pub fn recip(self) -> Self

Source

pub fn exp2(self) -> Self

Source

pub fn log2(self) -> Self

Source

pub fn log10(self) -> Self

Source

pub fn hypot(self, other: Self) -> Self

Source

pub fn abs(self) -> Self

Source§

impl Variable<'_>

Source

pub fn sin(self) -> Self

Source

pub fn cos(self) -> Self

Source

pub fn tan(self) -> Self

Source

pub fn sinh(self) -> Self

Source

pub fn cosh(self) -> Self

Source

pub fn tanh(self) -> Self

Source

pub fn asin(self) -> Self

Source

pub fn acos(self) -> Self

Source

pub fn atan(self) -> Self

Source

pub fn asinh(self) -> Self

Source

pub fn acosh(self) -> Self

Source

pub fn atanh(self) -> Self

Source§

impl Variable<'_>

Source

pub const fn value(&self) -> f64

Source

pub fn compute_gradients(&self) -> Gradients

Source

pub fn apply_unary_function( self, f: fn(_: f64) -> f64, df: fn(_: f64) -> f64, ) -> Self

Source

pub fn apply_scalar_function<T: Copy>( self, f: fn(_: f64, _: T) -> f64, df: fn(_: f64, _: T) -> f64, scalar: T, ) -> Self

Source

pub fn apply_binary_function( self, other: Self, f: fn(_: f64, _: T) -> f64, dfdx: fn(_: f64, _: f64) -> (f64, f64), ) -> Self

Trait Implementations§

Source§

impl<'a> Add<Variable<'a>> for f64

Source§

type Output = Variable<'a>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self::Output) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl AddAssign<f64> for Variable<'_>

Source§

fn add_assign(&mut self, rhs: f64)

Performs the += operation. Read more
Source§

impl AddAssign for Variable<'_>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<'a> Clone for Variable<'a>

Source§

fn clone(&self) -> Variable<'a>

Returns a copy 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<'a> Debug for Variable<'a>

Source§

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

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

impl<'a> Div<Variable<'a>> for f64

Source§

type Output = Variable<'a>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self::Output) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f64> for Variable<'_>

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl DivAssign for Variable<'_>

Source§

fn div_assign(&mut self, rhs: Self)

Performs the /= operation. Read more
Source§

impl<'a> Mul<Variable<'a>> for f64

Source§

type Output = Variable<'a>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self::Output) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl MulAssign<f64> for Variable<'_>

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for Variable<'_>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl Neg for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl ScalarLike for Variable<'_>

Source§

fn sin(self) -> Self

Source§

fn cos(self) -> Self

Source§

fn tan(self) -> Self

Source§

fn sinh(self) -> Self

Source§

fn cosh(self) -> Self

Source§

fn tanh(self) -> Self

Source§

fn ln(self) -> Self

Source§

fn log(self, param: f64) -> Self

Source§

fn log2(self) -> Self

Source§

fn log10(self) -> Self

Source§

fn exp(self) -> Self

Source§

fn exp2(self) -> Self

Source§

fn powi(self, param: i32) -> Self

Source§

fn powf(self, param: f64) -> Self

Source§

fn sqrt(self) -> Self

Source§

fn cbrt(self) -> Self

Source§

fn recip(self) -> Self

Source§

fn abs(self) -> Self

Source§

fn asin(self) -> Self

Source§

fn acos(self) -> Self

Source§

fn atan(self) -> Self

Source§

fn asinh(self) -> Self

Source§

fn acosh(self) -> Self

Source§

fn atanh(self) -> Self

Source§

fn hypot(self, param: Self) -> Self

Source§

impl<'a> Sub<Variable<'a>> for f64

Source§

type Output = Variable<'a>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self::Output) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub for Variable<'_>

Source§

type Output = Variable<'_>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl SubAssign<f64> for Variable<'_>

Source§

fn sub_assign(&mut self, rhs: f64)

Performs the -= operation. Read more
Source§

impl SubAssign for Variable<'_>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<'a> Copy for Variable<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Variable<'a>

§

impl<'a> !RefUnwindSafe for Variable<'a>

§

impl<'a> !Send for Variable<'a>

§

impl<'a> !Sync for Variable<'a>

§

impl<'a> Unpin for Variable<'a>

§

impl<'a> !UnwindSafe for Variable<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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.