Dropout

Dropout#

MIOpen: Dropout

Enumerations

enum  miopenRNGType_t { MIOPEN_RNG_PSEUDO_XORWOW = 0 }
 

Functions

miopenStatus_t miopenCreateDropoutDescriptor (miopenDropoutDescriptor_t *dropoutDesc)
 Creates the dropout descriptor object. More...
 
miopenStatus_t miopenDestroyDropoutDescriptor (miopenDropoutDescriptor_t dropoutDesc)
 Destroys the dropout descriptor object. More...
 
miopenStatus_t miopenDropoutGetReserveSpaceSize (const miopenTensorDescriptor_t xDesc, size_t *reserveSpaceSizeInBytes)
 Query the amount of memory required to run dropout. More...
 
miopenStatus_t miopenDropoutGetStatesSize (miopenHandle_t handle, size_t *stateSizeInBytes)
 Query the amount of memory required to store the states of the random number generators. More...
 
miopenStatus_t miopenGetDropoutDescriptor (miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float *dropout, void **states, unsigned long long *seed, bool *use_mask, bool *state_evo, miopenRNGType_t *rng_mode)
 Get the details of the dropout descriptor. More...
 
miopenStatus_t miopenRestoreDropoutDescriptor (miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float dropout, void *states, size_t stateSizeInBytes, unsigned long long seed, bool use_mask, bool state_evo, miopenRNGType_t rng_mode)
 Restore the dropout descriptor to a saved state. More...
 
miopenStatus_t miopenSetDropoutDescriptor (miopenDropoutDescriptor_t dropoutDesc, miopenHandle_t handle, float dropout, void *states, size_t stateSizeInBytes, unsigned long long seed, bool use_mask, bool state_evo, miopenRNGType_t rng_mode)
 Initialize the dropout descriptor. More...
 
miopenStatus_t miopenDropoutForward (miopenHandle_t handle, const miopenDropoutDescriptor_t dropoutDesc, const miopenTensorDescriptor_t noise_shape, const miopenTensorDescriptor_t xDesc, const void *x, const miopenTensorDescriptor_t yDesc, void *y, void *reserveSpace, size_t reserveSpaceSizeInBytes)
 Execute forward dropout operation. More...
 
miopenStatus_t miopenDropoutBackward (miopenHandle_t handle, const miopenDropoutDescriptor_t dropoutDesc, const miopenTensorDescriptor_t noise_shape, const miopenTensorDescriptor_t dyDesc, const void *dy, const miopenTensorDescriptor_t dxDesc, void *dx, void *reserveSpace, size_t reserveSpaceSizeInBytes)
 Execute backward dropout operation. More...
 

Detailed Description

Enumeration Type Documentation

◆ miopenRNGType_t

random number generator type

Enumerator
MIOPEN_RNG_PSEUDO_XORWOW 

XORWOW pseudorandom generator

Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

Function Documentation

◆ miopenCreateDropoutDescriptor()

miopenStatus_t miopenCreateDropoutDescriptor ( miopenDropoutDescriptor_t *  dropoutDesc)

Creates the dropout descriptor object.

Parameters
dropoutDescPointer to a dropout descriptor type
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenDestroyDropoutDescriptor()

miopenStatus_t miopenDestroyDropoutDescriptor ( miopenDropoutDescriptor_t  dropoutDesc)

Destroys the dropout descriptor object.

Parameters
dropoutDescDropout descriptor type (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenDropoutBackward()

miopenStatus_t miopenDropoutBackward ( miopenHandle_t  handle,
const miopenDropoutDescriptor_t  dropoutDesc,
const miopenTensorDescriptor_t  noise_shape,
const miopenTensorDescriptor_t  dyDesc,
const void *  dy,
const miopenTensorDescriptor_t  dxDesc,
void *  dx,
void *  reserveSpace,
size_t  reserveSpaceSizeInBytes 
)

Execute backward dropout operation.

Interface for executing the backward pass on a Dropout.

Parameters
handleMIOpen handle (input)
dropoutDescDropout layer descriptor (input)
noise_shapeTensor descriptor for noise shape (input placeholder, currently not enabled)
dyDescTensor descriptor for data delta tensor dy (input)
dyData delta tensor dy (input)
dxDescTensor descriptor for data delta tensor dx (input)
dxData delta tensor dx (Output)
reserveSpacePointer to memory allocated for executing backward dropout, expecting reserveSpace unchanged after previous call of miopenDropoutForward (input)
reserveSpaceSizeInBytesNumber of bytes of reservespace required for executing backward dropout (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenDropoutForward()

miopenStatus_t miopenDropoutForward ( miopenHandle_t  handle,
const miopenDropoutDescriptor_t  dropoutDesc,
const miopenTensorDescriptor_t  noise_shape,
const miopenTensorDescriptor_t  xDesc,
const void *  x,
const miopenTensorDescriptor_t  yDesc,
void *  y,
void *  reserveSpace,
size_t  reserveSpaceSizeInBytes 
)

Execute forward dropout operation.

Interface for executing the forward pass on a Dropout.

Parameters
handleMIOpen handle (input)
dropoutDescDropout layer descriptor (input)
noise_shapeTensor descriptor for noise shape (input placeholder, currently not enabled)
xDescTensor descriptor for data tensor x (input)
xData tensor x (input)
yDescTensor descriptor for data tensor y (input)
yData tensor y (Output)
reserveSpacePointer to memory allocated for executing forward dropout, expecting reserveSpace unchanged before next call of miopenDropoutBackward (Output)
reserveSpaceSizeInBytesNumber of bytes of reservespace required for executing forward dropout (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenDropoutGetReserveSpaceSize()

miopenStatus_t miopenDropoutGetReserveSpaceSize ( const miopenTensorDescriptor_t  xDesc,
size_t *  reserveSpaceSizeInBytes 
)

Query the amount of memory required to run dropout.

This function calculates the amount of memory required to run dropout.

Parameters
xDescTensor descriptor for data tensor x (input)
reserveSpaceSizeInBytesNumber of bytes of reservespace required for executing dropout (Output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenDropoutGetStatesSize()

miopenStatus_t miopenDropoutGetStatesSize ( miopenHandle_t  handle,
size_t *  stateSizeInBytes 
)

Query the amount of memory required to store the states of the random number generators.

This function calculates the amount of memory required to store the states of the random number generators used by miopenDropoutForward.

Parameters
handleMIOpen handle (input)
stateSizeInBytesNumber of bytes required to store random generator states (Output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenGetDropoutDescriptor()

miopenStatus_t miopenGetDropoutDescriptor ( miopenDropoutDescriptor_t  dropoutDesc,
miopenHandle_t  handle,
float *  dropout,
void **  states,
unsigned long long *  seed,
bool *  use_mask,
bool *  state_evo,
miopenRNGType_t rng_mode 
)

Get the details of the dropout descriptor.

Interface for querying the dropout descriptor

Parameters
dropoutDescDropout layer descriptor (input)
handleMIOpen handle (input)
dropoutThe probability by which the input is set to 0 in the dropout layer (Output)
statesPointer to memory that holds random number generator states (Output)
seedSeed used to initialize random number generator states (Output)
use_maskBoolean flag indicating whether to use a saved mask (an existing or user-defined dropout layout) in reserveSpace (Output)
state_evoBoolean flag indicating whether to adopt state evolution strategy to update the PRNG states by the end of each implementation (Output placeholder, currently not enabled)
rng_modeRandom number generator used to generate parallel random number sequences (Output)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenRestoreDropoutDescriptor()

miopenStatus_t miopenRestoreDropoutDescriptor ( miopenDropoutDescriptor_t  dropoutDesc,
miopenHandle_t  handle,
float  dropout,
void *  states,
size_t  stateSizeInBytes,
unsigned long long  seed,
bool  use_mask,
bool  state_evo,
miopenRNGType_t  rng_mode 
)

Restore the dropout descriptor to a saved state.

This function restores the state of dropout descriptor using the address of a state buffer with previously saved PRNG state pattern, without launching the expensive PRNG initialization process.

Interface for restoring the dropout descriptor

Parameters
dropoutDescDropout layer descriptor (input/Output)
handleMIOpen handle (input)
dropoutThe probability by which the input is set to 0 in the dropout layer (input)
statesPointer to memory that holds random number generator states (input)
stateSizeInBytesNumber of bytes holding random generator states (input)
seedSeed used to initialize random number generator states (input)
use_maskBoolean flag indicating whether to use a saved mask (an existing or user-defined dropout layout) in reserveSpace (input)
state_evoBoolean flag indicating whether to adopt state evolution strategy to update the PRNG states by the end of each implementation (input placeholder, currently not enabled)
rng_modeRandom number generator used to generate parallel random number sequences (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.

◆ miopenSetDropoutDescriptor()

miopenStatus_t miopenSetDropoutDescriptor ( miopenDropoutDescriptor_t  dropoutDesc,
miopenHandle_t  handle,
float  dropout,
void *  states,
size_t  stateSizeInBytes,
unsigned long long  seed,
bool  use_mask,
bool  state_evo,
miopenRNGType_t  rng_mode 
)

Initialize the dropout descriptor.

Interface for setting up the dropout descriptor

Parameters
dropoutDescDropout layer descriptor (input/Output)
handleMIOpen handle (input)
dropoutThe probability by which the input is set to 0 in the dropout layer (input)
statesPointer to memory that holds random number generator states (input)
stateSizeInBytesNumber of bytes provided for random generator states (input)
seedSeed used to initialize random number generator states (input)
use_maskBoolean flag indicating whether to use a saved mask (an existing or user-defined dropout layout) in reserveSpace (input)
state_evoBoolean flag indicating whether to adopt state evolution strategy to update the PRNG states by the end of each implementation (input placeholder, currently not enabled)
rng_modeRandom number generator used to generate parallel random number sequences (input)
Returns
miopenStatus_t
Examples
/home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-miopen/checkouts/docs-6.2.0/include/miopen/miopen.h.