Example
extern crate acme;
use acme::{autodiff, operator};
fn main() {
let x = 5f64;
let (z, dz) = (sigmoid(x), sigmoid_prime(x));
assert_eq!(autodiff!(lex x: sigmoid_lexical()), dz);
}
#[operator(partial)]
pub fn sigmoid<T>(x: T) -> T where T: num::Float {
x.exp() / (T::one() + x.exp())
}
pub fn sigmoid_prime<T>(x: T) -> T where T: num::Float {
sigmoid(x) * (1 - sigmoid(x)
}
Try to integrate with the #[operator] macro by collecting the String created by invoking _lexical()
Example
Try to integrate with the
#[operator]macro by collecting the String created by invoking _lexical()