'Configures the learning process.
# Arguments
optimizer: str (name of optimizer) or optimizer object.
See [optimizers](/optimizers).
loss: str (name of objective function) or objective function.
See [losses](/losses).
metrics: list of metrics to be evaluated by the model
during training and testing.
Typically you will use `metrics=[\'accuracy\']`.
See [metrics](/metrics).
sample_weight_mode: if you need to do timestep-wise
sample weighting (2D weights), set this to "temporal".
"None" defaults to sample-wise weights (1D).
**kwargs: for Theano/CNTK backends, these are passed into
K.function. When using the TensorFlow backend, these are
passed into `tf.Session.run`.
# Example
```python
model = Sequential()
model.add(Dense(32, input_shape=(500,)))
model.add(Dense(10, activation=\'softmax\'))
model.compile(optimizer=\'rmsprop\',
loss=\'categorical_crossentropy\',
metrics=[\'accuracy\'])'

def compile(self, optimizer, loss, metrics=None, sample_weight_mode=None, **kwargs):

    self.build()
    self.model.compile(optimizer, loss, metrics=metrics, sample_weight_mode=sample_weight_mode, **kwargs)
    self.optimizer = self.model.optimizer
    self.loss = self.model.loss
    self.total_loss = self.model.total_loss
    self.loss_weights = self.model.loss_weights
    self.metrics = self.model.metrics
    self.metrics_tensors = self.model.metrics_tensors
    self.metrics_names = self.model.metrics_names
    self.sample_weight_mode = self.model.sample_weight_mode
    self.sample_weights = self.model.sample_weights
    self.targets = self.model.targets
