def fn_set_weights(smaller_model,original_model):
    """
    Reset the weights for the smaller tf.keras model created.

    Parameters
    ----------
    smaller_model : tf.keras model
        Model for the smaller model obtained from the full model.
    original_model : tf.keras model
        Model for the original model (the full model).

    Returns
    -------
    smaller_model : tf.keras model
       Model for the smaller model with the weights properly set.

    """
    modelLayers = [i.name for i in original_model.layers]
    for l in smaller_model.layers:
        orig = l.name
        if orig in modelLayers:
            lWeights = original_model.get_layer(orig)
            l.set_weights(lWeights.get_weights())
    return smaller_model