def set_layer_weights_from_single_trained_model(model, trained_model):
    """
    Sets the weights of a Keras model based on an already trained trained_model.

    Parameters
    ----------
    model : ks.models.Model
        Keras model instance withought weights.
    trained_model : ks.models.Model
        Pretrained Keras model used to set the weights for the new model.

    """
    skip_layers = ['dropout', 'input', 'flatten', 'max_pooling',
        'activation', 'concatenate']
    i = -1
    for layer in model.layers:
        i += 1
        skip = False
        for skip_layer_str in skip_layers:
            if skip_layer_str in layer.name:
                skip = True
        if skip:
            continue
        layer.set_weights(trained_model.layers[i].get_weights())
