Struct treez::autograd::Context [−][src]
pub struct Context { /* fields omitted */ }
implementation of reverse automatic differentiation
Methods
impl Context
[src]
impl Context
pub fn get_var(&mut self, id: usize) -> Option<&Link>
[src]
pub fn get_var(&mut self, id: usize) -> Option<&Link>
pub fn init(&mut self) -> Link
[src]
pub fn init(&mut self) -> Link
pub fn init_var(&mut self, v: &[f64]) -> Link
[src]
pub fn init_var(&mut self, v: &[f64]) -> Link
pub fn init_op(&mut self, op: OpType, args: &mut [&mut Link]) -> Link
[src]
pub fn init_op(&mut self, op: OpType, args: &mut [&mut Link]) -> Link
pub fn compute_grad(
&mut self,
y: usize,
x: usize
) -> Result<Vec<f64>, &'static str>
[src]
pub fn compute_grad(
&mut self,
y: usize,
x: usize
) -> Result<Vec<f64>, &'static str>
computes dy/dx and other variables as well back propagating from y
pub fn fwd_pass(&mut self, link: Vec<Link>) -> Result<Vec<usize>, &'static str>
[src]
pub fn fwd_pass(&mut self, link: Vec<Link>) -> Result<Vec<usize>, &'static str>
checker for link validity, computes forward values, saves eval order for backward pass in context, and returns ids for input links