'Trains the model for a fixed number of epochs.
# Arguments
x: input data, as a Numpy array or list of Numpy arrays
(if the model has multiple inputs).
y: labels, as a Numpy array.
batch_size: integer. Number of samples per gradient update.
epochs: integer, the number of epochs to train the model.
verbose: 0 for no logging to stdout,
1 for progress bar logging, 2 for one log line per epoch.
callbacks: list of `keras.callbacks.Callback` instances.
List of callbacks to apply during training.
See [callbacks](/callbacks).
validation_split: float (0. < x < 1).
Fraction of the data to use as held-out validation data.
validation_data: tuple (x_val, y_val) or tuple
(x_val, y_val, val_sample_weights) to be used as held-out
validation data. Will override validation_split.
shuffle: boolean or str (for \'batch\').
Whether to shuffle the samples at each epoch.
\'batch\' is a special option for dealing with the
limitations of HDF5 data; it shuffles in batch-sized chunks.
class_weight: dictionary mapping classes to a weight value,
used for scaling the loss function (during training only).
sample_weight: Numpy array of weights for
the training samples, used for scaling the loss function
(during training only). You can either pass a flat (1D)
Numpy array with the same length as the input samples
(1:1 mapping between weights and samples),
or in the case of temporal data,
you can pass a 2D array with shape (samples, sequence_length),
to apply a different weight to every timestep of every sample.
In this case you should make sure to specify
sample_weight_mode="temporal" in compile().
initial_epoch: epoch at which to start training
(useful for resuming a previous training run)
# Returns
A `History` object. Its `History.history` attribute is
a record of training loss values and metrics values
at successive epochs, as well as validation loss values
and validation metrics values (if applicable).
# Raises
RuntimeError: if the model was never compiled.'

def fit(self, x, y, batch_size=32, epochs=10, verbose=1, callbacks=None, validation_split=0.0, validation_data=None, shuffle=True, class_weight=None, sample_weight=None, initial_epoch=0, **kwargs):

    if ('nb_epoch' in kwargs):
        warnings.warn('The    `nb_epoch`    argument    in    `fit`    has    been    renamed    `epochs`.')
        epochs = kwargs.pop('nb_epoch')
    if kwargs:
        raise TypeError(('Unrecognized    keyword    arguments:    ' + str(kwargs)))
    if (not self.built):
        raise RuntimeError('The    model    needs    to    be    compiled    before    being    used.')
    return self.model.fit(x, y, batch_size=batch_size, epochs=epochs, verbose=verbose, callbacks=callbacks, validation_split=validation_split, validation_data=validation_data, shuffle=shuffle, class_weight=class_weight, sample_weight=sample_weight, initial_epoch=initial_epoch)
