Which log softmax?

Hi everyone,

I went over the PyTorch tutorials and haven’t been able to understand when would I want to use a LogSoftmax layer (declared in __init__), or the log_softmax function from torch.nn.functional.

Thanks!

They are basically the same. The functional version can’t be used in structures like torch.nn.Sequential etc. Beside that it should be your own choice whether to use the layer (initialize it and call it) or call the functional API.