def calculate_sparsity_score(alpha, ihls, ils, df):
    """
    @param: alpha: hyperparameter between 0 and 1. Closer to 1 means jumping factor is more weighted. Closer to 0 means the 1/df is more weighted.
    @param: ihls: Initial hidden layer size
    @param: ils: input layer size
    @param: df: division factor. (i.e. If first ihls is 40 and df is 2, then the hidden layers will have 40, 20, 10, 5, 2 sizes)
    @returns: sparsity score. Returns -1 if the alpha is outside of the [0,1] range.
    """
    if not 0<=alpha<=1: return -1
    jumping_factor = ihls/ils
    return round(alpha*(jumping_factor) + (1-alpha)*1/df, 4)