ReluPointwise

Trait ReluPointwise 

Source
pub trait ReluPointwise<F>: NN<F> {
    // Required methods
    fn relu_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
    fn relu_pointwise_grad(
        &self,
        x: &SharedTensor<F>,
        x_diff: &mut SharedTensor<F>,
    ) -> Result<(), Error>;
}
Expand description

Provides the functionality for pointwise ReLU operations (overwrites the input with the result of the operation).

Required Methods§

Source

fn relu_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>

Computes the [Rectified linear units][relu] over the input Tensor x. [relu]: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)

Saves the result back to x.

Source

fn relu_pointwise_grad( &self, x: &SharedTensor<F>, x_diff: &mut SharedTensor<F>, ) -> Result<(), Error>

Computes the gradient of [ReLU][relu] over the input Tensor x. [relu]: https://en.wikipedia.org/wiki/Rectifier_(neural_networks)

Saves the result back to x_diff.

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.

Implementations on Foreign Types§

Source§

impl ReluPointwise<f32> for Backend<Native>

Source§

impl ReluPointwise<f64> for Backend<Native>

Source§

impl<T> ReluPointwise<T> for Backend<Cuda>
where T: Float + Default + DataTypeInfo,

Source§

fn relu_pointwise(&self, x: &mut SharedTensor<T>) -> Result<(), Error>

Source§

fn relu_pointwise_grad( &self, x: &SharedTensor<T>, x_diff: &mut SharedTensor<T>, ) -> Result<(), Error>

Implementors§