def model_from_yaml(yaml_string, custom_objects=None):
    """Parses a yaml model configuration file
    and returns a model instance.
    """
    import yaml
    from keras.utils.layer_utils import layer_from_config
    config = yaml.load(yaml_string)
    return layer_from_config(config, custom_objects=custom_objects)
