def create_head1d(
    nf: int,
    nc: int,
    lin_ftrs: Optional[Collection[int]] = None,
    ps=0.5,
    bn_final: bool = False,
    bn: bool = True,
    act="relu",
    concat_pooling=True,
):
    "Model head that takes `nf` features, runs through `lin_ftrs`, and about `nc` classes; added bn and act here"
    lin_ftrs = (
        [2 * nf if concat_pooling else nf, nc]
        if lin_ftrs is None
        else [2 * nf if concat_pooling else nf] + lin_ftrs + [nc]
    )  # was [nf, 512,nc]
    ps = listify(ps)
    if len(ps) == 1:
        ps = [ps[0] / 2] * (len(lin_ftrs) - 2) + ps
    actns = [nn.ReLU(inplace=True) if act == "relu" else nn.ELU(inplace=True)] * (
        len(lin_ftrs) - 2
    ) + [None]
    layers = [AdaptiveConcatPool1d() if concat_pooling else nn.MaxPool1d(2), Flatten()]
    for ni, no, p, actn in zip(lin_ftrs[:-1], lin_ftrs[1:], ps, actns):
        layers += bn_drop_lin(ni, no, bn, p, actn)
    if bn_final:
        layers.append(nn.BatchNorm1d(lin_ftrs[-1], momentum=0.01))
    return nn.Sequential(*layers)
Model head that takes `nf` features, runs through `lin_ftrs`, and about `nc` classes; added bn and act here
analyze/convnexts4nd/src/models/baselines/nonaka/basic_conv1d.py