mindspore/docs/api/api_python/ops/mindspore.ops.func_dropout.rst

19 lines
1002 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.ops.dropout
======================
.. py:function:: mindspore.ops.dropout(input, p=0.5)
在训练期间,以服从伯努利分布的概率 `p` 随机将输入Tensor的某些值归零起到减少神经元相关性的作用避免过拟合。此概率与 `ops.Dropout``nn.Dropout` 中的含义相反。
参数:
- **input** (Tensor) - dropout的输入任意维度的Tensor其数据类型为float16或float32。
- **p** (float可选) - 输入神经元丢弃概率数值范围在0到1之间。例如p=0.1删除10%的神经元。默认值0.5。
返回:
- **output** (Tensor) - 归零后的Tensorshape和数据类型与 `input` 相同。
- **mask** (Tensor) - 用于归零的掩码,内部会按位压缩与对齐。
异常:
- **TypeError** - `p` 不是float。
- **TypeError** - `input` 的数据类型既不是float16也不是float32。
- **TypeError** - `input` 不是Tensor。