class_docstr: Trainer class for fitting and evaluating :class:`Estimators <deeppavlov.core.models.estimator.Estimator>`
  
  Args:
      chainer_config: ``"chainer"`` block of a configuration file
      batch_size: batch_size to use for partial fitting (if available) and evaluation,
          the whole dataset is used if ``batch_size`` is negative or zero (default is ``-1``)
      metrics: iterable of metrics where each metric can be a registered metric name or a dict of ``name`` and
          ``inputs`` where ``name`` is a registered metric name and ``inputs`` is a collection of parameter names
          from chainer’s inner memory that will be passed to the metric function;
          default value for ``inputs`` parameter is a concatenation of chainer’s ``in_y`` and ``out`` fields
          (default is ``('accuracy',)``)
      evaluation_targets: data types on which to evaluate trained pipeline (default is ``('valid', 'test')``)
      show_examples: a flag used to print inputs, expected outputs and predicted outputs for the last batch
          in evaluation logs (default is ``False``)
      max_test_batches: maximum batches count for pipeline testing and evaluation, ignored if negative
          (default is ``-1``)
      **kwargs: additional parameters whose names will be logged but otherwise ignored
docstr: Calls :meth:`~fit_chainer` with provided data iterator as an argument
docstr_tok: ["Calls",":","meth",":","`","~fit_chainer","`","with","provided","data","iterator","as","an","argument"]
code: def train(
      self, iterator: Union[DataFittingIterator, DataLearningIterator]
  ) -> None:
      """Calls :meth:`~fit_chainer` with provided data iterator as an argument"""
      self.fit_chainer(iterator)
      self._saved = True
  
imports: import datetime
  import json
  import time
  from itertools import islice
  from logging import getLogger
  from typing import Tuple, Dict, Union, Optional, Iterable, Any, Collection
  from tqdm import tqdm
  from deeppavlov.core.commands.infer import build_model
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.core.common.params import from_params
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.data.data_fitting_iterator import DataFittingIterator
  from deeppavlov.core.data.data_learning_iterator import DataLearningIterator
  from deeppavlov.core.models.estimator import Estimator
  from deeppavlov.core.trainers.utils import Metric, parse_metrics, prettify_metrics, NumpyArrayEncoder
label_desc: Use image node_id 5 for calling the FitTrainer obj's underlying member method code with example usage: obj.train(iterator) without return types