pub trait Dropout<F>: NN<F> {
// Required methods
fn new_dropout_config(
&self,
dropout: f32,
seed: u64,
) -> Result<Self::CDROP, Error>;
fn dropout(
&self,
x: &SharedTensor<F>,
result: &mut SharedTensor<F>,
config: &Self::CDROP,
) -> Result<(), Error>;
fn dropout_grad(
&self,
x: &SharedTensor<F>,
x_diff: &SharedTensor<F>,
result: &SharedTensor<F>,
result_diff: &mut SharedTensor<F>,
config: &Self::CDROP,
) -> Result<(), Error>;
}Expand description
Provides the functionality for a Backend to support Dropout operations.
Required Methods§
Sourcefn new_dropout_config(
&self,
dropout: f32,
seed: u64,
) -> Result<Self::CDROP, Error>
fn new_dropout_config( &self, dropout: f32, seed: u64, ) -> Result<Self::CDROP, Error>
Creates a new DropoutConfig, which needs to be passed to further dropout Operations.
Sourcefn dropout(
&self,
x: &SharedTensor<F>,
result: &mut SharedTensor<F>,
config: &Self::CDROP,
) -> Result<(), Error>
fn dropout( &self, x: &SharedTensor<F>, result: &mut SharedTensor<F>, config: &Self::CDROP, ) -> Result<(), Error>
Computes non-linear down-sampling ([max Pooling][pooling]) over the input Tensor x.
[pooling]: https://en.wikipedia.org/wiki/Convolutional_neural_network#Pooling_layer
Saves the result to result.
Sourcefn dropout_grad(
&self,
x: &SharedTensor<F>,
x_diff: &SharedTensor<F>,
result: &SharedTensor<F>,
result_diff: &mut SharedTensor<F>,
config: &Self::CDROP,
) -> Result<(), Error>
fn dropout_grad( &self, x: &SharedTensor<F>, x_diff: &SharedTensor<F>, result: &SharedTensor<F>, result_diff: &mut SharedTensor<F>, config: &Self::CDROP, ) -> Result<(), Error>
Computes non-linear down-sampling ([max Pooling][pooling]) over the input Tensor x.
[pooling]: https://en.wikipedia.org/wiki/Dropout_(neural_networks)
Saves the result to result.
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.