def get_flops_per_activation(activation):
    """Returns the number of multiplication ands additions of an activation.
    Args:
    activation: str, type of activation applied to the output.
    Returns:
    n_muls, n_adds
    """
    if activation == 'relu':
        # For the purposes of the "freebie" quantization scoring, ReLUs can be
        # assumed to be performed on 16-bit inputs. Thus, we track them as
        # multiplications in our accounting, which can also be assumed to be
        # performed on reduced precision inputs.
        return 1, 0
    elif activation == 'swish':  # Swish: x / (1 + exp(-bx))
        return 3, 1
    elif activation == 'sigmoid':  # Sigmoid: exp(x) / (1 + exp(x))
        return 2, 1
    elif activation == 'celu':  # Celu: max(0, x) + min(0, alpha * (exp(x/alpha) - 1))
        return 5, 2
    else:
        raise ValueError('activation: %s is not valid' % activation)