def get_features(encoder, x):
    """ Extract the features generated by each block of the encoder model """
    x = encoder.layers[0](x)  # This is just the input layer
    features = []
    for layer in encoder.layers[1:]:
        x = layer(x)
        features.append(x)
    return features