    def __init__(self, dim_in, num_classes, dropout_rate=0.0, act_func="softmax"):
        """
        Perform linear projection and activation as head for tranformers.
        Args:
            dim_in (`int`):
                The channel dimension of the input to the head.
            num_classes (`int`):
                The channel dimensions of the output to the head.
            dropout_rate (`float`):
                Dropout rate. If equal to 0.0, perform no
                dropout.
            act_func (`string`):
                Activation function to use.
                - "softmax": applies softmax on the output.
                - "sigmoid": applies sigmoid on the output.
        """
        super().__init__()
        if dropout_rate > 0.0:
            self.dropout = nn.Dropout(dropout_rate)
        self.projection = Linear(dim_in, num_classes, bias=True)  # pylint: disable=too-many-function-args,unexpected-keyword-arg

        # Softmax for evaluation and testing.
        if act_func == "softmax":
            self.act = Softmax(dim=1)  # pylint: disable=unexpected-keyword-arg
        elif act_func == "sigmoid":
            self.act = Sigmoid()
        else:
            raise NotImplementedError(
                f"{act_func} is not supported as an activation"
                "function."
            )
Perform linear projection and activation as head for tranformers.
Args:
dim_in (`int`):
The channel dimension of the input to the head.
num_classes (`int`):
The channel dimensions of the output to the head.
dropout_rate (`float`):
Dropout rate. If equal to 0.0, perform no
dropout.
act_func (`string`):
Activation function to use.
- "softmax": applies softmax on the output.
- "sigmoid": applies sigmoid on the output.
towhee/models/multiscale_vision_transformers/mvit.py