Using Softmax in Pytorch

First thing, import torch and torch.nn



In the next steps, define a random input tensor with the shape of (2,3). See the difference when softmax is applied on the dimension-0 (dim=0) and dimension-1 (dim=1).


Hope this helps.

Comments

Popular posts from this blog

Adding a Dashed Connector in Draw.io

DBeaver / PostgreSQL: "Error: database already exists" Workaround

How to Get The Replication Factor of HDFS Files