torch_concepts.nn.functional.soft_select¶
- soft_select(values, temperature, dim=1) Tensor[source]¶
Soft selection function, a special activation function for a network rescaling the output such that, if they are uniformly distributed, then we will select only half of them. A higher temperature will select more concepts, a lower temperature will select fewer concepts.
- Parameters:
values – Output of the network.
temperature – Temperature for the softmax function [-inf, +inf].
dim – dimension to apply the softmax function. Default is 1.
- Returns:
Soft selection scores.
- Return type:
Tensor