Trait coaster_nn::TanhPointwise
source · pub trait TanhPointwise<F>: NN<F> {
// Required methods
fn tanh_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
fn tanh_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 tanh_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>
fn tanh_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>
Computes the [hyperbolic Tangent][tanh] over the input Tensor x
.
[tanh]: https://en.wikipedia.org/wiki/Hyperbolic_function
Saves the result back to x
.
sourcefn tanh_pointwise_grad(
&self,
x: &SharedTensor<F>,
x_diff: &mut SharedTensor<F>
) -> Result<(), Error>
fn tanh_pointwise_grad( &self, x: &SharedTensor<F>, x_diff: &mut SharedTensor<F> ) -> Result<(), Error>
Computes the gradient of [tanh][tanh] over the input Tensor x
.
[tanh]: https://en.wikipedia.org/wiki/Hyperbolic_function
Saves the result back to x_diff
.
Object Safety§
This trait is not object safe.