Trait coaster_nn::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§
sourcefn relu_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>
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
.
sourcefn relu_pointwise_grad(
&self,
x: &SharedTensor<F>,
x_diff: &mut SharedTensor<F>
) -> Result<(), Error>
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
.
Object Safety§
This trait is not object safe.