Skip to content

Commit

Permalink
add to website index
Browse files Browse the repository at this point in the history
  • Loading branch information
roywei authored and piyushghai committed Jul 30, 2019
1 parent 3b1b185 commit 0b8ebb0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
29 changes: 29 additions & 0 deletions docs/api/python/gluon/contrib.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<script type="text/javascript" src='../../../_static/js/auto_module_index.js'></script>
Expand Down Expand Up @@ -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:
```

<script>auto_index("api-reference");</script>
7 changes: 5 additions & 2 deletions python/mxnet/gluon/contrib/estimator/event_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 0b8ebb0

Please sign in to comment.