torchact.nn.LogSoftmax
- class torchact.nn.LogSoftmax(dim: Optional[int] = None)[source]
Implementation of Log(Softmax(x)).
- Parameters
dim (int) – LogSoftmax dimension. Default: None
- Examples::
>>> import torch, torchact >>> m = torchact.nn.LogSoftmax() >>> input = torch.tensor([1.0, -2.0, 0.0, 3.0]) >>> output = m(input) >>> print(output) tensor([-2.1755, -5.1755, -3.1755, -0.1755])