import math


def get_cosine_learning_rates(lr_min: float, lr_max: float, f: float, N: int):
    """Decay the learning rate based on a cosine schedule of frequency `f`.
    Returns a list of `N` learning rate values in the interval `[lr_min, lr_max]`.
    """
    lr = []

    for i in range(N):
        freq = f * i / N
        scaler = 0.5 * (1 + math.cos(2 * math.pi * freq))  # [0, 1]
        l = lr_min + scaler * (lr_max - lr_min)
        lr.append(l)

    return lr