def linear_encoder(coeffs, feature_vector):
    """Returns a linear combination of all features."""
    assert len(coeffs) == len(feature_vector)
    return sum(coeffs[i] * feature_vector[i] for i in range(len(feature_vector)))