From 32b772b6591634eda6bbb44c67e099c859c709fc Mon Sep 17 00:00:00 2001 From: Jiaqi Date: Thu, 1 Apr 2021 14:31:50 +0800 Subject: [PATCH] Modify the results in the dicelos example and the example of occlusion sensitivity --- mindspore/nn/loss/loss.py | 2 +- mindspore/nn/metrics/occlusion_sensitivity.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/nn/loss/loss.py b/mindspore/nn/loss/loss.py index 5be62467e3..bf967e5134 100644 --- a/mindspore/nn/loss/loss.py +++ b/mindspore/nn/loss/loss.py @@ -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__() diff --git a/mindspore/nn/metrics/occlusion_sensitivity.py b/mindspore/nn/metrics/occlusion_sensitivity.py index fc9079e7ce..20da040fa8 100644 --- a/mindspore/nn/metrics/occlusion_sensitivity.py +++ b/mindspore/nn/metrics/occlusion_sensitivity.py @@ -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))