def compile_model(model, loss='categorical_crossentropy', optimizer='adam', metrics=['categorical_accuracy']):
    """
    Compile the model.
    
    :param model: model form build_model
    :param loss: lost fucntion, defaults to 'categorical_crossentropy'
    :type loss: str, optional
    :param optimizer: optimizer sinstance, defaults to 'adam'
    :type optimizer: str, optional
    :param metrics: metrics to be evaluated by the model, defaults to ['categorical_accuracy']
    :type metrics: list, optional
    :return: compiled model
    """
    model.compile(loss=loss,
              optimizer=optimizer,
              metrics=metrics)
    return model