Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

derivative of multivariable function pytorch

import torch

x = torch.autograd.Variable(torch.Tensor([2]),requires_grad=True)
y = 5*x**4 + 3*x**3 + 7*x**2 + 9*x - 5

y.backward()
x.grad
Source by www.kdnuggets.com #
 
PREVIOUS NEXT
Tagged: #derivative #multivariable #function #pytorch
ADD COMMENT
Topic
Name
3+8 =