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 1 – 1.3 Derivatives in PyTorch – QUIZ

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

      Question 1 –
      What task does the following lines of code perform?

      q=torch.tensor(1.0,requires_grad=True)
      fq=2q**3+q
      fq.bakward()
      q.gradc

      Answer :
      Determines the derivative of 2q**3+q at q=1

      Question 2 –
      Try to determine partial derivative 𝑢u of the following function where 𝑢=2u=2 and 𝑣=1v=1: 𝑓=𝑢𝑣+(𝑢𝑣)**2

      Answer :

      u = torch.tensor(2.0, requires_grad = True)
      v = torch.tensor(1.0, requires_grad = True)
      f = u * v + (u * v) ** 2
      f.backward()
      print("The result is ", u.grad)
Viewing 0 reply threads
  • You must be logged in to reply to this topic.