Trait collenchyma_nn::SigmoidPointwise [] [src]

pub trait SigmoidPointwise<F>: NN<F> {
    fn sigmoid_pointwise(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
    fn sigmoid_pointwise_plain(&self, x: &mut SharedTensor<F>) -> Result<(), Error>;
    fn sigmoid_pointwise_grad(&self, x: &mut SharedTensor<F>, x_diff: &mut SharedTensor<F>) -> Result<(), Error>;
    fn sigmoid_pointwise_grad_plain(&self, x: &SharedTensor<F>, x_diff: &mut SharedTensor<F>) -> Result<(), Error>;
}

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

Required Methods

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

Computes the Sigmoid function over the input Tensor x with complete memory management.

Saves the result back to x.

For a no-memory managed version see sigmoid_pointwise_plain.

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

Computes the Sigmoid function over the input Tensor x without any memory management.

Saves the result back to x.

Attention:
For a correct computation result, you need to manage the memory allocation and synchronization yourself.
For a memory managed version see sigmoid_pointwise.

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

Computes the gradient of a Sigmoid function over the input Tensor x with complete memory management.

Saves the result back to x_diff.

For a no-memory managed version see sigmoid_pointwise_grad_plain.

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

Computes the gradient of a Sigmoid function over the input Tensor x without any memory management.

Saves the result back to x_diff.

Attention:
For a correct computation result, you need to manage the memory allocation and synchronization yourself.
For a memory managed version see sigmoid_pointwise_grad.

Implementors