Differentiable

Trait Differentiable 

Source
pub trait Differentiable<R: Value>: Operation<R> {
    type Diff: Operation<R>;

    // Required methods
    fn auto_diff_for<R1: Clone>(
        &self,
        var: Variable<R1>,
        var_trace: &mut HashMap<String, Vec<String>>,
    ) -> Self::Diff;
    fn contains_var<R1: Clone>(&self, var: Variable<R1>) -> bool;
}

Required Associated Types§

Required Methods§

Source

fn auto_diff_for<R1: Clone>( &self, var: Variable<R1>, var_trace: &mut HashMap<String, Vec<String>>, ) -> Self::Diff

Source

fn contains_var<R1: Clone>(&self, var: Variable<R1>) -> bool

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Differentiable<Void> for Noop

Source§

impl<C: Computable> Differentiable<C> for C

Source§

type Diff = C

Source§

impl<R1: Value, R2: Value, A: Differentiable<R1>, B: Differentiable<R2>> Differentiable<R1> for InstructionList<R1, R2, A, B>

Source§

type Diff = InstructionList<R1, R2, Either<<A as Differentiable<R1>>::Diff, A>, Either<<B as Differentiable<R2>>::Diff, B>>

Source§

impl<R: Calculatable, LEFT: Differentiable<R>, RIGHT: Differentiable<R>> Differentiable<R> for Add<R, LEFT, RIGHT>

Source§

type Diff = OperationWrapper<R, Add<R, <LEFT as Differentiable<R>>::Diff, <RIGHT as Differentiable<R>>::Diff>>

Source§

impl<R: Calculatable, LEFT: Differentiable<R>, RIGHT: Differentiable<R>> Differentiable<R> for Divide<R, LEFT, RIGHT>

Source§

type Diff = OperationWrapper<R, Divide<R, OperationWrapper<R, Subtract<R, OperationWrapper<R, Multiply<R, <LEFT as Differentiable<R>>::Diff, RIGHT>>, OperationWrapper<R, Multiply<R, LEFT, <RIGHT as Differentiable<R>>::Diff>>>>, OperationWrapper<R, Multiply<R, RIGHT, RIGHT>>>>

Source§

impl<R: Calculatable, LEFT: Differentiable<R>, RIGHT: Differentiable<R>> Differentiable<R> for Multiply<R, LEFT, RIGHT>

Source§

type Diff = OperationWrapper<R, Add<R, OperationWrapper<R, Multiply<R, LEFT, <RIGHT as Differentiable<R>>::Diff>>, OperationWrapper<R, Multiply<R, <LEFT as Differentiable<R>>::Diff, RIGHT>>>>

Source§

impl<R: Calculatable, LEFT: Differentiable<R>, RIGHT: Differentiable<R>> Differentiable<R> for Subtract<R, LEFT, RIGHT>

Source§

type Diff = OperationWrapper<R, Subtract<R, <LEFT as Differentiable<R>>::Diff, <RIGHT as Differentiable<R>>::Diff>>

Source§

impl<R: Computable> Differentiable<R> for Get<R>

Source§

impl<R: Computable> Differentiable<R> for Variable<R>

Source§

impl<R: Computable, G: GetAndSetable<R>, O: Differentiable<R>> Differentiable<Void> for Set<R, G, O>

Source§

impl<R: Computable, INPUTS: FunctionInputs, CALLINPUTS: CallInputs + CallMatchFunctionInputs<INPUTS> + DiffableFunctionInputs<R, INPUTS>, A: Differentiable<R>> Differentiable<R> for Call<R, INPUTS, CALLINPUTS, A>

Source§

type Diff = Either<<CALLINPUTS as DiffableFunctionInputs<R, INPUTS>>::Diff<A>, Call<R, INPUTS, CALLINPUTS, A>>

Source§

impl<R: Computable, ITERABLE: Iterable<R>, A: Differentiable<Void>, B: Differentiable<Void>> Differentiable<Void> for ForEach<R, ITERABLE, A, B>

Source§

type Diff = ForEach<R, ITERABLE, Either<<A as Differentiable<Void>>::Diff, A>, Either<<B as Differentiable<Void>>::Diff, B>>

Source§

impl<R: Computable, O: Differentiable<R>> Differentiable<Void> for Assign<R, O>

Source§

impl<R: Computable, T: IndexAble, O: Differentiable<u32>> Differentiable<R> for Index<R, T, O>

Source§

type Diff = R

Source§

impl<R: Value, CONDITION: Operation<bool>, A: Differentiable<R>, B: Differentiable<Void>, C: Differentiable<R>, D: Differentiable<Void>> Differentiable<R> for IfElse<R, CONDITION, A, B, C, D>

Source§

type Diff = IfElse<R, CONDITION, Either<<A as Differentiable<R>>::Diff, A>, Either<<B as Differentiable<Void>>::Diff, B>, Either<<C as Differentiable<R>>::Diff, C>, Either<<D as Differentiable<Void>>::Diff, D>>

Source§

impl<R: Value, INPUTS: FunctionInputs, A: Differentiable<R>> Differentiable<R> for Function<R, INPUTS, A>

Source§

type Diff = Function<R, INPUTS, <A as Differentiable<R>>::Diff>

Source§

impl<R: Value, O: Differentiable<R>> Differentiable<R> for Returns<R, O>

Source§

type Diff = Returns<R, <O as Differentiable<R>>::Diff>

Source§

impl<R: Value, O: Differentiable<R>> Differentiable<R> for OperationWrapper<R, O>

Source§

type Diff = <O as Differentiable<R>>::Diff

Source§

impl<R: Value, R2: Value, A: Differentiable<R>, B: Differentiable<R2>> Differentiable<R> for Scope<R, R, R2, A, B>

Source§

type Diff = Scope<R, R, R2, Either<<A as Differentiable<R>>::Diff, A>, Either<<B as Differentiable<R2>>::Diff, B>>