For the 2nd question in Excercises. Do we have different variables x1 and x2 or is it a single variable x ? If itโs a single variable, is it 5ex^2 that is in the equation?
Hey guys hope u all good. Iโve found today this course. Itโs quite interesting. Iโm completing it in python. Iโm learning mostly python for machine learning and AI applications. Even iโve been learning how to manage to use AWS sagemaker and clouds services. But i wanted to ask a question about finding the gradient of the function. I mean question 2: Itโs possible to define
a function like
import numpy as np
def(x): where x is a list
return 3x[0]**2 + 5np.exp(x[1])
and then apply numerical_limit function with following parameters(f = f(x), x =[1,1], h =0.01)
and return a list looping thought each index of the list x =[1,1]
or this logic is too dump?
If you guys can help me
I studied math in the past, but donโt know how to code with the most fresh and efficient way x)
Hi @Luis_Ramirez, your logic is never dump! In most of DL framework, we decompose a complex function to each directly differentiable step and then apply the chain rule (i,e., we define all the derivative formula in code and apply chain rule). Check https://d2l.ai/chapter_preliminaries/autograd.html for more details. Besides, if you would like to see how to code from scratch, check here. Let me know if it helps!
hello,
I tried my code:
import torch
x = torch.arange(2.0)
x.requires_grad_(True)
x.grad
y = 3 * torch.dot(x,x) + 5 * torch.exp(x)
y
y.backward()
x.grad
Iโm confused with partial derivatives. Since for partial derivatives we can treat all other variables as constants, shouldnโt the derivative vector be [6x_1, 5e^x_2] ?
โf/โx_1 = โ/โx_1 (3x_1^2) + DC = 6x_1 + 0 = 6x_1 (C being a constant)
โf/โx_2 = DC + โ/โx_2 (5e^x_2) = 0 + 5e^x_2 = 5e^x_2
Iโm not clear on what the notation implies when there is both a subscript F and a superscript 2. The text reads as if the Frobenius Norm is always the square root of the sum of its matrix elements, so the superscript should always be 2. Is this understanding incorrect?