Dropout

Trait Dropout 

Source
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§

Source

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.

Source

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.

Source

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.

Implementations on Foreign Types§

Source§

impl<T> Dropout<T> for Backend<Cuda>
where T: Float + Default + DataTypeInfo,

Source§

fn new_dropout_config( &self, probability: f32, seed: u64, ) -> Result<Self::CDROP, Error>

Source§

fn dropout( &self, x: &SharedTensor<T>, result: &mut SharedTensor<T>, config: &Self::CDROP, ) -> Result<(), Error>

Source§

fn dropout_grad( &self, x: &SharedTensor<T>, x_diff: &SharedTensor<T>, result: &SharedTensor<T>, result_diff: &mut SharedTensor<T>, config: &Self::CDROP, ) -> Result<(), Error>

Source§

impl<T> Dropout<T> for Backend<Native>
where T: Float + Add<T, Output = T> + Mul<T, Output = T> + Default + Copy + PartialOrd + Bounded,

Source§

fn new_dropout_config( &self, probability: f32, seed: u64, ) -> Result<Self::CDROP, Error>

Source§

fn dropout( &self, x: &SharedTensor<T>, result: &mut SharedTensor<T>, config: &Self::CDROP, ) -> Result<(), Error>

Source§

fn dropout_grad( &self, x: &SharedTensor<T>, x_diff: &SharedTensor<T>, result: &SharedTensor<T>, result_diff: &mut SharedTensor<T>, config: &Self::CDROP, ) -> Result<(), Error>

Implementors§