Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

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

      Question 1 –
      Consider the following neural network model or class:

      class Net(nn.Module):
          def __init__(self,D_in,H,D_out):
              super(Net,self).__init__()
              self.linear1=nn.Linear(D_in,H)
              self.linear2=nn.Linear(H,D_out)
      
              
          def forward(self,x):
              x=torch.sigmoid(self.linear1(x))  
              x=torch.sigmoid(self.linear2(x))
              return x

      How many hidden neurons does the following neural network object have?
      model=Net(1,6,1)

      Answer :
      6

      Question 2 –
      What does the following line of code do?<<
      torch.sigmoid(self.linear1(x))

      Answer :
      Applies a sigmoid activation to every element of the tensor x

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