fix docs error in fbeta

This commit is contained in:
wangnan39@huawei.com 2020-09-15 19:15:00 +08:00
parent 4abb33f151
commit 8d1d271550
3 changed files with 8 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class Fbeta(Metric):
{(1+\beta^2) \cdot true\_positive +\beta^2 \cdot false\_negative + false\_positive}
Args:
beta (float): The weight of precision.
beta (Union[float, int]): The weight of precision.
Examples:
>>> x = Tensor(np.array([[0.2, 0.5], [0.3, 0.1], [0.9, 0.6]]))
@ -122,14 +122,14 @@ class F1(Fbeta):
Refer to class `Fbeta` for more details.
.. math::
F_\beta=\frac{2\cdot true\_positive}{2\cdot true\_positive + false\_negative + false\_positive}
F_1=\frac{2\cdot true\_positive}{2\cdot true\_positive + false\_negative + false\_positive}
Examples:
>>> x = Tensor(np.array([[0.2, 0.5], [0.3, 0.1], [0.9, 0.6]]))
>>> y = Tensor(np.array([1, 0, 1]))
>>> metric = nn.F1()
>>> metric.update(x, y)
>>> fbeta = metric.eval()
>>> f1 = metric.eval()
"""
def __init__(self):
super(F1, self).__init__(1.0)

View File

@ -18,7 +18,7 @@ High-Level training interfaces.
Helper functions in train piplines.
"""
from .model import Model
from .dataset_helper import DatasetHelper
from .dataset_helper import DatasetHelper, connect_network_with_dataset
from . import amp
__all__ = ["Model", "DatasetHelper", "amp"]
__all__ = ["Model", "DatasetHelper", "amp", "connect_network_with_dataset"]

View File

@ -302,3 +302,6 @@ class _DatasetIterNormal:
def __next__(self):
data = self.iter.__next__()
return data
__all__ = ["DatasetHelper", "connect_network_with_dataset"]