Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Changes to mxnet.metric #18083

Merged
merged 27 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f07d35e
finish 5 changes
Apr 15, 2020
575f23b
move metric.py to gluon, replace mx.metric with mx.gluon.metric in py…
acphile Apr 16, 2020
8992995
fix importError
acphile Apr 16, 2020
1b8f521
replace mx.metric with mx.gluon.metric in tests/python
acphile Apr 16, 2020
2ff2e38
remove global support
acphile Apr 20, 2020
c06f363
remove macro support
acphile Apr 20, 2020
6beba21
rewrite BinaryAccuracy
acphile Apr 20, 2020
b1fc42b
extend F1 to multiclass/multilabel
acphile Apr 21, 2020
4b091b0
add tests for new F1, remove global tests
acphile Apr 21, 2020
1dfe0e0
use mxnet.numpy instead of numpy
acphile Apr 22, 2020
083e85b
Merge remote-tracking branch 'upstream/master'
acphile Apr 24, 2020
59d98b3
fix sanity
acphile Apr 25, 2020
40e87e3
rewrite ce and ppl, improve some details
acphile Apr 27, 2020
5e153e1
use mxnet.numpy.float64
acphile Apr 27, 2020
bf68c6d
remove sklearn
acphile Apr 28, 2020
56b846e
remove reset_local() and get_global in other files
acphile Apr 29, 2020
8a437e9
fix test_mlp
acphile Apr 29, 2020
b7c2b3b
replace mx.metric with mx.gluon.metric in example
acphile Apr 29, 2020
ec615a5
fix context difference
acphile Apr 29, 2020
c4a3b67
Disable -DUSE_TVM_OP on GPU builds
leezu Apr 30, 2020
0456416
Fix disable tvm op for gpu runs
leezu Apr 30, 2020
2a80a0a
resolve conflicts
acphile May 6, 2020
8163fbb
use label.ctx in metric.py; remove gluoncv dependency in test_cvnets
acphile May 7, 2020
d53e6ef
fix sanity
acphile May 7, 2020
3adfa5e
Merge branch 'master' into master
leezu May 7, 2020
a2b0ffe
fix importError
acphile May 8, 2020
ef3058a
remove nose
acphile May 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion python/mxnet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
from . import random
from . import optimizer
from . import model
from . import metric
from . import notebook
from . import initializer
# use mx.init as short for mx.initializer
Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/contrib/svrg_optimization/svrg_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,8 @@ def fit(self, train_data, eval_data=None, eval_metric='acc',

if validation_metric is None:
validation_metric = eval_metric
if not isinstance(eval_metric, mx.metric.EvalMetric):
eval_metric = mx.metric.create(eval_metric)
if not isinstance(eval_metric, mx.gluon.metric.EvalMetric):
eval_metric = mx.gluon.metric.create(eval_metric)

################################################################################
# training loop
Expand Down
2 changes: 2 additions & 0 deletions python/mxnet/gluon/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
# pylint: disable=wildcard-import
"""Neural network module."""

from . import metric

from .parameter import *

from .block import *
Expand Down
3 changes: 2 additions & 1 deletion python/mxnet/gluon/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
import numpy as np

from ..base import mx_real_t, MXNetError
from .. import symbol, ndarray, initializer, np_symbol, autograd, _deferred_compute as dc
from .. import symbol, ndarray, initializer, autograd, _deferred_compute as dc
from ..symbol.numpy import _symbol as np_symbol
from ..symbol import Symbol
from ..ndarray import NDArray
from .. import name as _name
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/gluon/contrib/data/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from ...data import dataset
from ...utils import download, check_sha1, _get_repo_file_url
from ....contrib import text
from .... import nd, base
from .... import ndarray as nd, base

class _LanguageModelDataset(dataset._DownloadedDataset): # pylint: disable=abstract-method
def __init__(self, root, namespace, vocabulary):
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/gluon/contrib/estimator/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from ...trainer import Trainer
from ...utils import split_and_load
from ....context import Context, cpu, gpu, num_gpus
from ....metric import Loss as metric_loss
from ...metric import Loss as metric_loss
from .batch_processor import BatchProcessor

__all__ = ['Estimator']
Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/gluon/contrib/estimator/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@

import numpy as np

from ....metric import CompositeEvalMetric, EvalMetric
from ....metric import Loss as metric_loss
from ...metric import CompositeEvalMetric, EvalMetric
from ...metric import Loss as metric_loss
from .utils import _check_metrics

__all__ = ['TrainBegin', 'TrainEnd', 'EpochBegin', 'EpochEnd', 'BatchBegin', 'BatchEnd',
Expand Down
4 changes: 2 additions & 2 deletions python/mxnet/gluon/contrib/estimator/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"""Gluon Estimator Utility Functions"""

from ...loss import SoftmaxCrossEntropyLoss
from ....metric import Accuracy, EvalMetric, CompositeEvalMetric
from ...metric import Accuracy, EvalMetric, CompositeEvalMetric

def _check_metrics(metrics):
if isinstance(metrics, CompositeEvalMetric):
Expand All @@ -31,7 +31,7 @@ def _check_metrics(metrics):
metrics = metrics or []
if not all([isinstance(metric, EvalMetric) for metric in metrics]):
raise ValueError("metrics must be a Metric or a list of Metric, "
"refer to mxnet.metric.EvalMetric: {}".format(metrics))
"refer to mxnet.gluon.metric.EvalMetric: {}".format(metrics))
return metrics

def _check_handler_metric_ref(handler, known_metrics):
Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/gluon/contrib/nn/basic_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
'PixelShuffle3D']

import warnings
from .... import nd, context
from .... import ndarray as nd, context
from ...block import HybridBlock, Block
from ...nn import Sequential, HybridSequential, BatchNorm

Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/gluon/data/dataloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
pass

from . import sampler as _sampler
from ... import nd, context
from ... import ndarray as nd, context
from ...util import is_np_shape, is_np_array, set_np
from ... import numpy as _mx_np # pylint: disable=reimported

Expand Down
2 changes: 1 addition & 1 deletion python/mxnet/gluon/data/vision/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

from .. import dataset
from ...utils import download, check_sha1, _get_repo_file_url
from .... import nd, image, recordio, base
from .... import ndarray as nd, image, recordio, base
from .... import numpy as _mx_np # pylint: disable=reimported
from ....util import is_np_array

Expand Down
Loading