class_docstr: Mixin abstract base class defining additional functionality required for neural network estimators. This base class
  has to be mixed in with class `BaseEstimator`.
class_docstr_tok: ["Mixin","abstract","base","class","defining","additional","functionality","required","for","neural","network","estimators",".","This","base","class","has","to","be","mixed","in","with","class","`","BaseEstimator","`","."]
docstr: Fit the estimator using a `generator` yielding training batches. Implementations can
  provide framework-specific versions of this function to speed-up computation.
  
  :param generator: Batch generator providing `(x, y)` for each epoch.
  :param nb_epochs: Number of training epochs.
code: def fit_generator(
      self, generator: "DataGenerator", nb_epochs: int = 20, **kwargs
  ) -> None:
      """
      Fit the estimator using a `generator` yielding training batches. Implementations can
      provide framework-specific versions of this function to speed-up computation.
  
      :param generator: Batch generator providing `(x, y)` for each epoch.
      :param nb_epochs: Number of training epochs.
      """
      from art.data_generators import DataGenerator
  
      if not isinstance(generator, DataGenerator):
          raise ValueError(
              f"Expected instance of `DataGenerator` for `fit_generator`, got {type(generator)} instead."
          )
  
      for i in range(nb_epochs):
          for _ in trange(
              int(generator.size / generator.batch_size), desc=f"Epoch {i + 1}/{nb_epochs}"  # type: ignore
          ):
              x, y = generator.get_batch()
  
              # Fit for current batch
              self.fit(
                  x,
                  y,
                  nb_epochs=1,
                  batch_size=generator.batch_size,
                  **kwargs,
              )
  
imports: from abc import ABC, abstractmethod
  from typing import Any, Dict, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  from tqdm.auto import trange
  from art.config import ART_NUMPY_DTYPE
label_desc: Use image node_id 4 for calling the NeuralNetworkMixin obj's underlying member method code with example usage: obj.fit_generator(generator, nb_epochs) without return types