class_docstr: Wrapper class for importing Keras regression models.
class_docstr_tok: ["Wrapper","class","for","importing","Keras","regression","models","."]
docstr: Fit the regressor using the generator that yields batches as specified.
  
  :param generator: Batch generator providing `(x, y)` for each epoch. If the generator can be used for native
                    training in Keras, it will.
  :param nb_epochs: Number of epochs to use for training.
  :param kwargs: Dictionary of framework-specific arguments. These should be parameters supported by the
         `fit_generator` function in Keras and will be passed to this function as such. Including the number of
         epochs as part of this argument will result in as error.
docstr_tok: ["Fit","the","regressor","using","the","generator","that","yields","batches","as","specified",".",":","param","generator",":","Batch","generator","providing","`","(","x",",","y",")","`","for","each","epoch",".","If","the","generator","can","be","used","for","native","training","in","Keras",",","it","will",".",":","param","nb_epochs",":","Number","of","epochs","to","use","for","training",".",":","param","kwargs",":","Dictionary","of","framework-specific","arguments",".","These","should","be","parameters","supported","by","the","`","fit_generator","`","function","in","Keras","and","will","be","passed","to","this","function","as","such",".","Including","the","number","of","epochs","as","part","of","this","argument","will","result","in","as","error","."]
code: def fit_generator(
      self, generator: "DataGenerator", nb_epochs: int = 20, **kwargs
  ) -> None:
      """
      Fit the regressor using the generator that yields batches as specified.
  
      :param generator: Batch generator providing `(x, y)` for each epoch. If the generator can be used for native
                        training in Keras, it will.
      :param nb_epochs: Number of epochs to use for training.
      :param kwargs: Dictionary of framework-specific arguments. These should be parameters supported by the
             `fit_generator` function in Keras and will be passed to this function as such. Including the number of
             epochs as part of this argument will result in as error.
      """
      from art.data_generators import KerasDataGenerator
  
      # Try to use the generator as a Keras native generator, otherwise use it through the `DataGenerator` interface
      from art.preprocessing.standardisation_mean_std.numpy import (
          StandardisationMeanStd,
      )
  
      if isinstance(generator, KerasDataGenerator) and (
          self.preprocessing is None
          or (
              isinstance(self.preprocessing, StandardisationMeanStd)
              and (
                  self.preprocessing.mean,
                  self.preprocessing.std,
              )
              == (0, 1)
          )
      ):
          try:
              self._model.fit_generator(
                  generator.iterator, epochs=nb_epochs, **kwargs
              )
          except ValueError:  # pragma: no cover
              logger.info(
                  "Unable to use data generator as Keras generator. Now treating as framework-independent."
              )
              if "verbose" not in kwargs:
                  kwargs["verbose"] = 0
              super().fit_generator(
                  generator, nb_epochs=nb_epochs, **kwargs
              )
      else:  # pragma: no cover
          if "verbose" not in kwargs:
              kwargs["verbose"] = 0
          super().fit_generator(
              generator, nb_epochs=nb_epochs, **kwargs
          )
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  import logging
  import os
  import time
  from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union, TYPE_CHECKING
  import numpy
  import six
  from art import config
  from art.estimators.keras import KerasEstimator
  from art.estimators.regression.regressor import RegressorMixin
label_desc: Use image node_id 11 for calling the KerasRegressor obj's underlying member method code with example usage: obj.fit_generator(generator, nb_epochs) without return types