def LinearActivation(
        d_input,
        d_output,
        bias=True,
        zero_bias_init=False,
        transposed=False,
        initializer=None,
        activation=None,
        activate=False,
        weight_norm=False,
        **kwargs):
    """
    generate activation module
    Args:
        d_input (int): input dimension
        d_output (int): output dimension
        bias (bool): bias
        zero_bias_init (bool): bias
        transposed (bool): transposed
        initializer (str): initializer
        activation (str): activation
        activate (str): activation
        weight_norm (bool): weight normalization
    return: a linear nn.Module with control over axes order, initialization, and activation
    """

    # Construct core module
    linear_cls = TransposedLinear if transposed else nn.Linear
    if activation == 'glu':
        d_output *= 2
    linear = linear_cls(d_input, d_output, bias=bias, **kwargs)

    # Initialize weight
    if initializer is not None:
        get_initializer(initializer, activation)(linear.weight)

    # Initialize bias
    if bias and zero_bias_init:
        nn.init.zeros_(linear.bias)

    # Weight norm
    if weight_norm:
        linear = nn.utils.weight_norm(linear)

    if activate and activation is not None:
        activation = Activation(activation, dim=-2 if transposed else -1)
        linear = nn.Sequential(linear, activation)
    return linear
generate activation module
Args:
d_input (int): input dimension
d_output (int): output dimension
bias (bool): bias
zero_bias_init (bool): bias
transposed (bool): transposed
initializer (str): initializer
activation (str): activation
activate (str): activation
weight_norm (bool): weight normalization
return: a linear nn.Module with control over axes order, initialization, and activation
towhee/models/vis4mer/linearactivation.py