!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
This commit is contained in:
mindspore-ci-bot 2021-04-02 17:18:43 +08:00 committed by Gitee
commit 479ffdfcbd
2 changed files with 2 additions and 2 deletions

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__()

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))