'Run the model given an input and calculate the score
as assessed by an evaluation metric.
Parameters
X : mxnet.DataIter
eval_metric : metric.metric
The metric for calculating score.
num_batch : int or None
The number of batches to run. Go though all batches if ``None``.
Returns
s : float
The final score.'

def score(self, X, eval_metric='acc', num_batch=None, batch_end_callback=None, reset=True):

    if (not isinstance(eval_metric, metric.EvalMetric)):
        eval_metric = metric.create(eval_metric)
    X = self._init_iter(X, None, is_train=False)
    if reset:
        X.reset()
    data_shapes = X.provide_data
    data_names = [x[0] for x in data_shapes]
    type_dict = dict(((key, value.dtype) for (key, value) in self.arg_params.items()))
    for x in X.provide_data:
        if isinstance(x, DataDesc):
            type_dict[x.name] = x.dtype
        else:
            type_dict[x[0]] = mx_real_t
    self._init_predictor(data_shapes, type_dict)
    data_arrays = [self._pred_exec.arg_dict[name] for name in data_names]
    for (i, batch) in enumerate(X):
        if ((num_batch is not None) and (i == num_batch)):
            break
        _load_data(batch, data_arrays)
        self._pred_exec.forward(is_train=False)
        eval_metric.update(batch.label, self._pred_exec.outputs)
        if (batch_end_callback is not None):
            batch_end_params = BatchEndParam(epoch=0, nbatch=i, eval_metric=eval_metric, locals=locals())
            _multiple_callbacks(batch_end_callback, batch_end_params)
    return eval_metric.get()[1]
