Trait coaster_nn::SigmoidPointwise
source · pub trait SigmoidPointwise<F>: NN<F> {
// Required methods
fn sigmoid_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
fn sigmoid_pointwise_grad(
&self,
x: &SharedTensor<F>,
x_diff: &mut SharedTensor<F>
) -> Result<(), Error>;
}
Expand description
Provides the functionality for pointwise Sigmoid operations (overwrites the input with the result of the operation).
Required Methods§
sourcefn sigmoid_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>
fn sigmoid_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>
Computes the [Sigmoid function][sigmoid] over the input Tensor x
.
[sigmoid]: https://en.wikipedia.org/wiki/Sigmoid_function
Saves the result back to x
.
For a no-memory managed version see sigmoid_pointwise_plain
.
sourcefn sigmoid_pointwise_grad(
&self,
x: &SharedTensor<F>,
x_diff: &mut SharedTensor<F>
) -> Result<(), Error>
fn sigmoid_pointwise_grad( &self, x: &SharedTensor<F>, x_diff: &mut SharedTensor<F> ) -> Result<(), Error>
Computes the gradient of a [Sigmoid function][sigmoid] over the input Tensor x
.
[sigmoid]: https://en.wikipedia.org/wiki/Sigmoid_function
Saves the result back to x_diff
.
Object Safety§
This trait is not object safe.