pub trait Softmax<F>: NN<F> {
// Required methods
fn softmax(
&self,
x: &SharedTensor<F>,
result: &mut SharedTensor<F>,
) -> Result<(), Error>;
fn softmax_grad(
&self,
x: &SharedTensor<F>,
x_diff: &SharedTensor<F>,
result_diff: &mut SharedTensor<F>,
) -> Result<(), Error>;
}Expand description
Provides the functionality for a Backend to support Softmax operations.
Required Methods§
Sourcefn softmax(
&self,
x: &SharedTensor<F>,
result: &mut SharedTensor<F>,
) -> Result<(), Error>
fn softmax( &self, x: &SharedTensor<F>, result: &mut SharedTensor<F>, ) -> Result<(), Error>
Computes a [Softmax][softmax] over the input Tensor x.
[softmax]: https://en.wikipedia.org/wiki/Softmax_function
Saves the result to result.
Sourcefn softmax_grad(
&self,
x: &SharedTensor<F>,
x_diff: &SharedTensor<F>,
result_diff: &mut SharedTensor<F>,
) -> Result<(), Error>
fn softmax_grad( &self, x: &SharedTensor<F>, x_diff: &SharedTensor<F>, result_diff: &mut SharedTensor<F>, ) -> Result<(), Error>
Computes the gradient of a [Softmax][softmax] over the input Tensor x.
[softmax]: https://en.wikipedia.org/wiki/Softmax_function
Saves the result to result_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.