Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

映射文档 No. 370 #6116

Merged
merged 2 commits into from
Sep 4, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## [ torch 参数更多 ]torch.nn.functional.dropout1d

### [torch.nn.functional.dropout1d](https://pytorch.org/docs/stable/generated/torch.nn.functional.dropout1d.html#torch.nn.functional.dropout1d)

```python
torch.nn.functional.dropout1d(input, p=0.5, training=True, inplace=False)
```

### [paddle.nn.functional.dropout](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/dropout_cn.html)

```python
paddle.nn.functional.dropout(x, p=0.5, axis=None, training=True, mode='upscale_in_train', name=None)
```

其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以再详细一点解释下两者细微差异,torch对于dropout1d/dropout2d/dropout3d,是将某个Channel以一定概率全部置0,paddle是所有元素以一定概率置0
然后再说下 但该差异一般不影响网络训练效果

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改

### 参数映射
| PyTorch | PaddlePaddle | 备注 |
| -------- | ------------ | --------------------------------------------------------------------------------------------------------------- |
| input | x | 输入的多维 Tensor,仅参数名不一致。 |
| p | p | 将输入节点置 0 的概率,即丢弃概率。 |
| training | training | 标记是否为训练阶段。 |
| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 |
| - | axis | 指定对输入 Tensor 进行 dropout 操作的轴,PyTorch 无此参数,Paddle 保持默认即可。 |
| - | mode | 标记是否为训练阶段,PyTorch 无此参数,Paddle 保持默认即可。 |