class_docstr: Makes any ``tf.keras.models.Sequential`` object compatible with :py:class:`CleanLearning <cleanlab.classification.CleanLearning>` and sklearn.
  
  `KerasWrapperSequential` is instantiated in the same way as a keras ``Sequential``  object, except for optional extra `compile_kwargs` argument.
  Just instantiate this object in the same way as your ``tf.keras.models.Sequential`` object (rather than passing in an existing ``Sequential`` object).
  The instance methods of this class work in the same way as those of any keras ``Sequential`` object, see the `Keras documentation <https://keras.io/>`_ for details.
  
  Parameters
  ----------
  layers: list
      A list containing the layers to add to the keras ``Sequential`` model (same as for ``tf.keras.models.Sequential``).
  
  name: str, default = None
      Name for the Keras model (same as for ``tf.keras.models.Sequential``).
  
  compile_kwargs: dict, default = {"loss": tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True)}
      Dict of optional keyword arguments to pass into ``model.compile()`` for declaring loss, metrics, optimizer, etc.
class_docstr_tok: ["Makes","any","``","tf.keras.models.Sequential","``","object","compatible","with",":","py",":","class",":","`","CleanLearning","<","cleanlab.classification.CleanLearning",">","`","and","sklearn",".","`","KerasWrapperSequential","`","is","instantiated","in","the","same","way","as","a","keras","``","Sequential","``","object",",","except","for","optional","extra","`","compile_kwargs","`","argument",".","Just","instantiate","this","object","in","the","same","way","as","your","``","tf.keras.models.Sequential","``","object","(","rather","than","passing","in","an","existing","``","Sequential","``","object",")",".","The","instance","methods","of","this","class","work","in","the","same","way","as","those","of","any","keras","``","Sequential","``","object",",","see","the","`","Keras","documentation","<","https",":","\/\/keras.io\/",">","`","_","for","details",".","Parameters","--","--","--","--","--","layers",":","list","A","list","containing","the","layers","to","add","to","the","keras","``","Sequential","``","model","(","same","as","for","``","tf.keras.models.Sequential","``",")",".","name",":","str",",","default","=","None","Name","for","the","Keras","model","(","same","as","for","``","tf.keras.models.Sequential","``",")",".","compile_kwargs",":","dict",",","default","=","{","``","loss","''",":","tf.keras.losses.SparseCategoricalCrossentropy","(","from_logits=True",")","}","Dict","of","optional","keyword","arguments","to","pass","into","``","model.compile","(",")","``","for","declaring","loss",",","metrics",",","optimizer",",","etc","."]
docstr: Trains a Sequential Keras model.
  
  Parameters
  ----------
  X : tf.Dataset or np.array or pd.DataFrame
      If ``X`` is a tensorflow dataset object, it must already contain the labels as is required for standard Keras fit.
  
  y : np.array or pd.DataFrame, default = None
      If ``X`` is a tensorflow dataset object, you can optionally provide the labels again here as argument `y` to be compatible with sklearn,
      but they are ignored.
      If ``X`` is a numpy array or pandas dataframe, the labels have to be passed in using this argument.
docstr_tok: ["Trains","a","Sequential","Keras","model",".","Parameters","--","--","--","--","--","X",":","tf.Dataset","or","np.array","or","pd.DataFrame","If","``","X","``","is","a","tensorflow","dataset","object",",","it","must","already","contain","the","labels","as","is","required","for","standard","Keras","fit",".","y",":","np.array","or","pd.DataFrame",",","default","=","None","If","``","X","``","is","a","tensorflow","dataset","object",",","you","can","optionally","provide","the","labels","again","here","as","argument","`","y","`","to","be","compatible","with","sklearn",",","but","they","are","ignored",".","If","``","X","``","is","a","numpy","array","or","pandas","dataframe",",","the","labels","have","to","be","passed","in","using","this","argument","."]
code: def fit(self, X, y=None, **kwargs):
      """Trains a Sequential Keras model.
  
      Parameters
      ----------
      X : tf.Dataset or np.array or pd.DataFrame
          If ``X`` is a tensorflow dataset object, it must already contain the labels as is required for standard Keras fit.
  
      y : np.array or pd.DataFrame, default = None
          If ``X`` is a tensorflow dataset object, you can optionally provide the labels again here as argument `y` to be compatible with sklearn,
          but they are ignored.
          If ``X`` is a numpy array or pandas dataframe, the labels have to be passed in using this argument.
      """
      if self.net is None:
          self.net = tf.keras.models.Sequential(self.layers, self.name)
          self.net.compile(**self.compile_kwargs)
  
      # TODO: check for generators
      if y is not None and not isinstance(
          X, (tf.data.Dataset, keras.utils.Sequence)
      ):
          kwargs["y"] = y
  
      self.net.fit(X, **{**self.params, **kwargs})
  
imports: import tensorflow
  import keras
  import numpy
  from typing import Callable, Optional
label_desc: Use image node_id 4 for calling the KerasWrapperSequential obj's underlying member method code with example usage: obj.fit(X, y) without return types