Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

Home Forums Assignment courserra IBM AI Engineering Professional Certificate Deep Neural Networks with PyTorch WEEK 3 – 5.1 Logistic Regression: Prediction – QUIZ

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

      Question 1 –
      Will the following line of code run:

      model = nn.Sequential(nn.Linear(2, 1), nn.Sigmoid())
      x = torch.tensor([[1.0]])
      yhat = model(x)

      Answer :
      no

      Question 2 –
      How would you apply the sigmoid function to the tensor z
      z=torch.arange(-100,100,0.1).view(-1, 1)

      Answer :

      sig=nn. Sigmoid ()
      yhat=sig(z)

      yhat= torch.sigmoid(z)

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