MCPcopy Index your code
hub / github.com/daniel-e/rustml / Functions

Interface Functions

src/ops.rs:46–59  ·  view source on GitHub ↗

Trait for common mathematical functions for scalars, vectors and matrices.

Source from the content-addressed store, hash-verified

44
45/// Trait for common mathematical functions for scalars, vectors and matrices.
46pub trait Functions {
47
48 /// Computes the sigmoid function (i.e. 1/(1+exp(-x))) for a scalar or each
49 /// element in a vector or matrix.
50 fn sigmoid(&self) -> Self;
51
52 /// Computes the derivative of the sigmoid function (i.e. sigmoid(x) * (1 - sigmoid(x)))
53 /// for a scalar or each element in a vector or matrix.
54 fn sigmoid_derivative(&self) -> Self;
55
56 /// Computes the reciprocal (inverse) of each element of the matrix
57 /// and returns the result in a new matrix.
58 fn recip(&self) -> Self;
59}
60
61macro_rules! impl_functions {
62 ( $( $x:ty )+ ) => ($(

Callers

nothing calls this directly

Implementers 1

ops.rssrc/ops.rs

Calls

no outgoing calls

Tested by

no test coverage detected