dropout
Dropout function for any dimension input.
dropout(input, mask=None, p=0.5, shared_axes=(), rescale=True, fill_value=0.0, return_mask=False)
- input: tensor to be applied.
- mask: if given, input of
p/shared_axes/rescalewill be ignored, the inputmaskwill be used directly. - p: float scalar or list of floats, probability to drop a value (replaced with
fill_value). Ifpis a list, the actual probability will be calculated in an interval ofp[i]andp[i+1]randomly. By passing a list top, dropout will be executed with varying probability. For example by passingp = [0.1, 0.5]to the function, the dropout probability will be varying at least 0.1 and at most 0.5. - shared_axes: tuple of int, axes to share the dropout mask over. By default, each value is dropped individually. For example, shared_axes=(0,) means using the same mask across the batch. shared_axes=(2, 3) means using the same mask across the spatial dimensions of 2D feature maps, i.e., drop channels.
- rescale: if
True(default), the input tensor will be rescaled by1-pto compensate mean fluctuation due to dropout - fill_value: in our implementation, the dropped values will be replaced with
fill_value(default = 0, this is equivalent to the behavior of pytorch's builtindropout()) - return_mask: if
True, dropout mask used inside will be also returned - return: input masked or (input masked, mask) if
return_mask=True