From 0b8ebb0b8b2cd8182de86e2424eab45b60802c25 Mon Sep 17 00:00:00 2001 From: Lai Wei Date: Tue, 30 Jul 2019 09:34:24 -0700 Subject: [PATCH] add to website index --- docs/api/python/gluon/contrib.md | 29 +++++++++++++++++++ .../gluon/contrib/estimator/event_handler.py | 7 +++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/docs/api/python/gluon/contrib.md b/docs/api/python/gluon/contrib.md index a940f697de69..2cf893664e37 100644 --- a/docs/api/python/gluon/contrib.md +++ b/docs/api/python/gluon/contrib.md @@ -114,6 +114,32 @@ In the rest of this document, we list routines provided by the `gluon.contrib` p WikiText103 ``` +### Estimator + +```eval_rst +.. currentmodule:: mxnet.gluon.contrib.estimator + +.. autosummary:: + :nosignatures: + + Estimator +``` + +#### EventHandler +```eval_rst +.. currentmodule:: mxnet.gluon.contrib.estimator.event_handler + +.. autosummary:: + :nosignatures: + + StoppingHandler + MetricHandler + ValidationHandler + LoggingHandler + CheckpointHandler + EarlyStoppingHandler +``` + ## API Reference @@ -144,6 +170,9 @@ In the rest of this document, we list routines provided by the `gluon.contrib` p :members: :imported-members: +.. automodule:: mxnet.gluon.contrib.estimator + :members: + :imported-members: ``` diff --git a/python/mxnet/gluon/contrib/estimator/event_handler.py b/python/mxnet/gluon/contrib/estimator/event_handler.py index 57315e0be951..bd7cfce9ab7b 100644 --- a/python/mxnet/gluon/contrib/estimator/event_handler.py +++ b/python/mxnet/gluon/contrib/estimator/event_handler.py @@ -26,8 +26,11 @@ import numpy as np -from ....metric import EvalMetric, Loss +from ....metric import EvalMetric +from ....metric import Loss as metric_loss +__all__ = ['StoppingHandler', 'MetricHandler', 'ValidationHandler', + 'LoggingHandler', 'CheckpointHandler', 'EarlyStoppingHandler'] class TrainBegin(object): def train_begin(self, estimator, *args, **kwargs): @@ -127,7 +130,7 @@ def batch_end(self, estimator, *args, **kwargs): label = kwargs['label'] loss = kwargs['loss'] for metric in self.train_metrics: - if isinstance(metric, Loss): + if isinstance(metric, metric_loss): # metric wrapper for loss values metric.update(0, loss) else: