pub trait ActivationOps<T, S: Shape = (), D: Device = Self>: Device {
// Required methods
fn sigmoid(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn sigmoid_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn tanh(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn tanh_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn relu(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn relu_mut(&self, x: &mut Matrix<'_, T, D, S>);
fn relu_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>;
fn relu_grad_mut(&self, x: &mut Matrix<'_, T, D, S>);
}Required Methods§
fn sigmoid(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
fn sigmoid_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
fn tanh(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
fn tanh_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
fn relu(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
fn relu_grad(&self, x: &Matrix<'_, T, D, S>) -> Matrix<'_, T, Self, S>
Sourcefn relu_grad_mut(&self, x: &mut Matrix<'_, T, D, S>)
fn relu_grad_mut(&self, x: &mut Matrix<'_, T, D, S>)
inplace
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§
impl<T: Float, D: MainMemory, S: Shape> ActivationOps<T, S, D> for CPU
Available on crate feature
cpu only.impl<T: CDatatype + Float> ActivationOps<T> for OpenCL
Available on crate feature
opencl only.