def METHOD_NAME(self, epoch):
    """Update sparsity goals according to epoch numbers.
    Args:
        epoch (int): the epoch number
    Returns:
        sparsity (float): sparsity target in this epoch
    """
    if epoch < self.start_epoch:
        return 0
    if self.start_epoch == self.end_epoch or epoch > self.end_epoch:
        return self.target_sparsity
    return self.initial_sparsity + (self.target_sparsity - self.initial_sparsity) * (
        (epoch - self.start_epoch + 1) // self.freq
    ) * self.freq / (self.end_epoch - self.start_epoch + 1)