Skip to content

Commit 0ed6660

Browse files
committed
fix the loss doc
1 parent 9cd5a15 commit 0ed6660

17 files changed

+41
-48
lines changed

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCELoss.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2929
```python
3030
# PyTorch 写法
3131
torch.nn.BCELoss(weight=w, size_average=False, reduce=True)
32-
torch.nn.BCELoss(weight=w, size_average=Flase)
32+
torch.nn.BCELoss(weight=w, size_average=False)
3333

3434
# Paddle 写法
3535
paddle.nn.BCELoss(weight=w, reduction='sum')
@@ -47,13 +47,13 @@ torch.nn.BCELoss(weight=w)
4747
paddle.nn.BCELoss(weight=w, reduction='mean')
4848
```
4949

50-
#### reduction 为 None
50+
#### reduction 为 none
5151
```python
5252
# PyTorch 写法
5353
torch.nn.BCELoss(weight=w, size_average=True, reduce=False)
5454
torch.nn.BCELoss(weight=w, size_average=False, reduce=False)
5555
torch.nn.BCELoss(weight=w, reduce=False)
5656

5757
# Paddle 写法
58-
paddle.nn.BCELoss(weight=w, reduction='None')
58+
paddle.nn.BCELoss(weight=w, reduction='none')
5959
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCEWithLogitsLoss.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
3232
```python
3333
# PyTorch 写法
3434
torch.nn.BCEWithLogitsLoss(weight=w, size_average=False, reduce=True)
35-
torch.nn.BCEWithLogitsLoss(weight=w, size_average=Flase)
35+
torch.nn.BCEWithLogitsLoss(weight=w, size_average=False)
3636

3737
# Paddle 写法
3838
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='sum')
@@ -50,13 +50,13 @@ torch.nn.BCEWithLogitsLoss(weight=w)
5050
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='mean')
5151
```
5252

53-
#### reduction 为 None
53+
#### reduction 为 none
5454
```python
5555
# PyTorch 写法
5656
torch.nn.BCEWithLogitsLoss(weight=w, size_average=True, reduce=False)
5757
torch.nn.BCEWithLogitsLoss(weight=w, size_average=False, reduce=False)
5858
torch.nn.BCEWithLogitsLoss(weight=w, reduce=False)
5959

6060
# Paddle 写法
61-
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='None')
61+
paddle.nn.BCEWithLogitsLoss(weight=w, reduction='none')
6262
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CosineEmbeddingLoss.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2525
```python
2626
# PyTorch 写法
2727
torch.nn.CosineEmbeddingLoss(margin=m, size_average=False, reduce=True)
28-
torch.nn.CosineEmbeddingLoss(margin=m, size_average=Flase)
28+
torch.nn.CosineEmbeddingLoss(margin=m, size_average=False)
2929

3030
# Paddle 写法
3131
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='sum')
@@ -43,13 +43,13 @@ torch.nn.CosineEmbeddingLoss(margin=m)
4343
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='mean')
4444
```
4545

46-
#### reduction 为 None
46+
#### reduction 为 none
4747
```python
4848
# PyTorch 写法
4949
torch.nn.CosineEmbeddingLoss(margin=m, size_average=True, reduce=False)
5050
torch.nn.CosineEmbeddingLoss(margin=m, size_average=False, reduce=False)
5151
torch.nn.CosineEmbeddingLoss(margin=m, reduce=False)
5252

5353
# Paddle 写法
54-
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='None')
54+
paddle.nn.CosineEmbeddingLoss(margin=m, reduction='none')
5555
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CrossEntropyLoss.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
4040
```python
4141
# PyTorch 写法
4242
torch.nn.CrossEntropyLoss(weight=w, size_average=False, reduce=True)
43-
torch.nn.CrossEntropyLoss(weight=w, size_average=Flase)
43+
torch.nn.CrossEntropyLoss(weight=w, size_average=False)
4444

4545
# Paddle 写法
4646
paddle.nn.CrossEntropyLoss(weight=w, reduction='sum')
@@ -58,14 +58,13 @@ torch.nn.CrossEntropyLoss(weight=w)
5858
paddle.nn.CrossEntropyLoss(weight=w, reduction='mean')
5959
```
6060

61-
#### reduction 为 None
61+
#### reduction 为 none
6262
```python
6363
# PyTorch 写法
6464
torch.nn.CrossEntropyLoss(weight=w, size_average=True, reduce=False)
6565
torch.nn.CrossEntropyLoss(weight=w, size_average=False, reduce=False)
6666
torch.nn.CrossEntropyLoss(weight=w, reduce=False)
6767

6868
# Paddle 写法
69-
paddle.nn.CrossEntropyLoss(weight=w, reduction='None')
69+
paddle.nn.CrossEntropyLoss(weight=w, reduction='none')
7070
```
71-

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.HingeEmbeddingLoss.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
3030
```python
3131
# PyTorch 写法
3232
torch.nn.HingeEmbeddingLoss(margin=m, size_average=False, reduce=True)
33-
torch.nn.HingeEmbeddingLoss(margin=m, size_average=Flase)
33+
torch.nn.HingeEmbeddingLoss(margin=m, size_average=False)
3434

3535
# Paddle 写法
3636
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='sum')
@@ -48,14 +48,13 @@ torch.nn.HingeEmbeddingLoss(margin=m)
4848
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='mean')
4949
```
5050

51-
#### reduction 为 None
51+
#### reduction 为 none
5252
```python
5353
# PyTorch 写法
5454
torch.nn.HingeEmbeddingLoss(margin=m, size_average=True, reduce=False)
5555
torch.nn.HingeEmbeddingLoss(margin=m, size_average=False, reduce=False)
5656
torch.nn.HingeEmbeddingLoss(margin=m, reduce=False)
5757

5858
# Paddle 写法
59-
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='None')
59+
paddle.nn.HingeEmbeddingLoss(margin=m, reduction='none')
6060
```
61-

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.KLDivLoss.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PyTorch 相比 Paddle 支持更多其他参数,具体如下:
2828
```python
2929
# PyTorch 写法
3030
torch.nn.KLDivLoss(size_average=False, reduce=True)
31-
torch.nn.KLDivLoss(size_average=Flase)
31+
torch.nn.KLDivLoss(size_average=False)
3232

3333
# Paddle 写法
3434
paddle.nn.KLDivLoss(reduction='sum')
@@ -46,15 +46,13 @@ torch.nn.KLDivLoss()
4646
paddle.nn.KLDivLoss(reduction='mean')
4747
```
4848

49-
#### reduction 为 None
49+
#### reduction 为 none
5050
```python
5151
# PyTorch 写法
5252
torch.nn.KLDivLoss(size_average=True, reduce=False)
5353
torch.nn.KLDivLoss(size_average=False, reduce=False)
5454
torch.nn.KLDivLoss(reduce=False)
5555

5656
# Paddle 写法
57-
paddle.nn.KLDivLoss(reduction='None')
57+
paddle.nn.KLDivLoss(reduction='none')
5858
```
59-
60-

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.L1Loss.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ torch.nn.L1Loss()
4444
paddle.nn.L1Loss(reduction='mean')
4545
```
4646

47-
#### reduction 为 None
47+
#### reduction 为 none
4848
```python
4949
# PyTorch 写法
5050
torch.nn.L1Loss(size_average=True, reduce=False)
5151
torch.nn.L1Loss(size_average=False, reduce=False)
5252
torch.nn.L1Loss(reduce=False)
5353

5454
# Paddle 写法
55-
paddle.nn.L1Loss(reduction='None')
55+
paddle.nn.L1Loss(reduction='none')
5656
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MSELoss.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ torch.nn.MSELoss()
4343
paddle.nn.MSELoss(reduction='mean')
4444
```
4545

46-
#### reduction 为 None
46+
#### reduction 为 none
4747
```python
4848
# PyTorch 写法
4949
torch.nn.MSELoss(size_average=True, reduce=False)
5050
torch.nn.MSELoss(size_average=False, reduce=False)
5151
torch.nn.MSELoss(reduce=False)
5252

5353
# Paddle 写法
54-
paddle.nn.MSELoss(reduction='None')
54+
paddle.nn.MSELoss(reduction='none')
5555
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MarginRankingLoss.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,13 @@ torch.nn.MarginRankingLoss(margin=m)
4848
paddle.nn.MarginRankingLoss(margin=m, reduction='mean')
4949
```
5050

51-
#### reduction 为 None
51+
#### reduction 为 none
5252
```python
5353
# PyTorch 写法
5454
torch.nn.MarginRankingLoss(margin=m, size_average=True, reduce=False)
5555
torch.nn.MarginRankingLoss(margin=m, size_average=False, reduce=False)
5656
torch.nn.MarginRankingLoss(margin=m, reduce=False)
5757

5858
# Paddle 写法
59-
paddle.nn.MarginRankingLoss(margin=m, reduction='None')
59+
paddle.nn.MarginRankingLoss(margin=m, reduction='none')
6060
```

docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelMarginLoss.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ torch.nn.MultiLabelMarginLoss()
4242
paddle.nn.MultiLabelMarginLoss(reduction='mean')
4343
```
4444

45-
#### reduction 为 None
45+
#### reduction 为 none
4646
```python
4747
# PyTorch 写法
4848
torch.nn.MultiLabelMarginLoss(size_average=True, reduce=False)
4949
torch.nn.MultiLabelMarginLoss(size_average=False, reduce=False)
5050
torch.nn.MultiLabelMarginLoss(reduce=False)
5151

5252
# Paddle 写法
53-
paddle.nn.MultiLabelMarginLoss(reduction='None')
53+
paddle.nn.MultiLabelMarginLoss(reduction='none')
5454
```
55-

0 commit comments

Comments
 (0)