Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

Viewing 0 reply threads
  • Author
    Posts
    • #1213
      Yash AroraYash Arora
      Keymaster

      Question 1 –
      Consider the following lines of code, what is yhat?

      z = torch.tensor([[10,5,0],[10,8,2],[10,5,1]])
      _, yhat = z.max(1)

      Answer :
      tenor([0, 0, 0])

      Question 2 –
      In we have two input features and three classes , what are the parameters for Softmax() constructor according to the above code?

      class Softmax (nn.Module):
      
          def __init__(self, in_size, out_size):
      
              super(Softmax, self).__init__()
      
              self.linear=nn.Linear(in_size, out_size)
      
          def forward(self, x):
      
              out=self.linear(x)
      
              return out

      Answer :
      Sofmax(2,3)

Viewing 0 reply threads
  • You must be logged in to reply to this topic.