module onnxrt.ops_cpu.op_dropout#

Inheritance diagram of mlprodict.onnxrt.ops_cpu.op_dropout

Short summary#

module mlprodict.onnxrt.ops_cpu.op_dropout

Runtime operator.

source on GitHub

Classes#

class

truncated documentation

Dropout_12

Dropout ======= Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional …

Dropout_12

Dropout ======= Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional …

Dropout_7

DropoutBase

Functions#

function

truncated documentation

_dropout

Properties#

property

truncated documentation

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default

Returns the list of arguments as well as the list of parameters with the default values (close to the signature). …

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_default_modified

Returns the list of modified parameters.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_mandatory

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

args_optional

Returns the list of optional arguments.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

atts_value

Returns all parameters in a dictionary.

Methods#

method

truncated documentation

__init__

__init__

__init__

__init__

_private_run

_private_run

_private_run

_private_run

_run

_run

_run

Documentation#

Runtime operator.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_dropout.Dropout#

alias of Dropout_12

class mlprodict.onnxrt.ops_cpu.op_dropout.DropoutBase(onnx_node, desc=None, expected_attributes=None, **options)#

Bases: OpRun

__init__(onnx_node, desc=None, expected_attributes=None, **options)#
_private_run(X, seed=None, ratio=0.5, training_mode=False)#
class mlprodict.onnxrt.ops_cpu.op_dropout.Dropout_12(onnx_node, desc=None, **options)#

Bases: DropoutBase

Dropout#

Dropout takes an input floating-point tensor, an optional input ratio (floating-point scalar) and an optional input training_mode (boolean scalar). It produces two tensor outputs, output (floating-point tensor) and mask (optional Tensor<bool>). If training_mode is true then the output Y will be a random dropout; Note that this Dropout scales the masked input data by the following equation, so to convert the trained model into inference mode, the user can simply not pass training_mode input or set it to false. `` output = scale * data * mask, `` where `` scale = 1. / (1. - ratio). `` This operator has optional inputs/outputs. See ONNX for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument’s name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.

Attributes

  • seed: (Optional) Seed to the random generator, if not specified we will auto generate one. default value cannot be automatically retrieved (INT)

Inputs

Between 1 and 3 inputs.

  • data (heterogeneous)T: The input data as Tensor.

  • ratio (optional, heterogeneous)T1: The ratio of random dropout, with value in [0, 1). If this input was not set, or if it was set to 0, the output would be a simple copy of the input. If it’s non-zero, output will be a random dropout of the scaled input, which is typically the case during training. It is an optional value, if not specified it will default to 0.5.

  • training_mode (optional, heterogeneous)T2: If set to true then it indicates dropout is being used for training. It is an optional value hence unless specified explicitly, it is false. If it is false, ratio is ignored and the operation mimics inference mode where nothing will be dropped from the input data and if mask is requested as output it will contain all ones.

Outputs

Between 1 and 2 outputs.

  • output (heterogeneous)T: The output.

  • mask (optional, heterogeneous)T2: The output mask.

Type Constraints

  • T tensor(float16), tensor(float), tensor(double): Constrain input and output types to float tensors.

  • T1 tensor(float16), tensor(float), tensor(double): Constrain input ‘ratio’ types to float tensors.

  • T2 tensor(bool): Constrain output ‘mask’ types to boolean tensors.

Version

Onnx name: Dropout

This version of the operator has been available since version 12.

Runtime implementation: Dropout

__init__(onnx_node, desc=None, **options)#
_run(*inputs, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

class mlprodict.onnxrt.ops_cpu.op_dropout.Dropout_7(onnx_node, desc=None, **options)#

Bases: DropoutBase

__init__(onnx_node, desc=None, **options)#
_run(X, attributes=None, verbose=0, fLOG=None)#

Should be overwritten.

source on GitHub

mlprodict.onnxrt.ops_cpu.op_dropout._dropout(X, drop_probability=0.5, seed=0, training_mode=False, return_mask=False)#