Trait rustml::ops::Functions
[−]
[src]
pub trait Functions { fn sigmoid(&self) -> Self; fn sigmoid_derivative(&self) -> Self; fn recip(&self) -> Self; }
Trait for common mathematical functions for scalars, vectors and matrices.
Required Methods
fn sigmoid(&self) -> Self
Computes the sigmoid function (i.e. 1/(1+exp(-x))) for a scalar or each element in a vector or matrix.
fn sigmoid_derivative(&self) -> Self
Computes the derivative of the sigmoid function (i.e. sigmoid(x) * (1 - sigmoid(x))) for a scalar or each element in a vector or matrix.
fn recip(&self) -> Self
Computes the reciprocal (inverse) of each element of the matrix and returns the result in a new matrix.