Browse Source

!14535 Modify the results in the dicelos example and the example of occlusion sensitivity

From: @lijiaqi0612
Reviewed-by: @kingxian,@zh_qh
Signed-off-by: @kingxian
pull/14535/MERGE
mindspore-ci-bot Gitee 4 years ago
parent
commit
479ffdfcbd
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      mindspore/nn/loss/loss.py
  2. +1
    -1
      mindspore/nn/metrics/occlusion_sensitivity.py

+ 1
- 1
mindspore/nn/loss/loss.py View File

@@ -436,7 +436,7 @@ class DiceLoss(_Loss):
>>> y = Tensor(np.array([[0, 1], [1, 0], [0, 1]]), mstype.float32)
>>> output = loss(y_pred, y)
>>> print(output)
[0.38596618]
0.38596618
"""
def __init__(self, smooth=1e-5):
super(DiceLoss, self).__init__()


+ 1
- 1
mindspore/nn/metrics/occlusion_sensitivity.py View File

@@ -52,7 +52,7 @@ class OcclusionSensitivity(Metric):
Example:
>>> class DenseNet(nn.Cell):
... def __init__(self):
... super(DenseNet, self).init()
... super(DenseNet, self).__init__()
... w = np.array([[0.1, 0.8, 0.1, 0.1],[1, 1, 1, 1]]).astype(np.float32)
... b = np.array([0.3, 0.6]).astype(np.float32)
... self.dense = nn.Dense(4, 2, weight_init=Tensor(w), bias_init=Tensor(b))


Loading…
Cancel
Save