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

This commit is contained in:
Jiaqi 2021-04-01 14:31:50 +08:00
parent b70444e3cb
commit 32b772b659
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))