Questions tagged [gradient]

For questions related to the gradient, a way of packing together all the partial derivative information of a function

Filter by
Sorted by
Tagged with
0 votes
1 answer
59 views

How does MAML inner loop optimization works?

I started to learn meta-learning, reading the MAML paper https://arxiv.org/pdf/1703.03400.pdf In the inner loop, I am calculating adapted parameters for each task, I will be doing multiple steps of ...
user avatar
1 vote
0 answers
26 views

What do "large variables" and "small weights" mean in these sentences?

I'm trying to understand these two points from an article: Models with large variables i.e weight matrices. As a consequence such models have correspondingly large gradients and optimizer states. The ...
user avatar
  • 111
0 votes
1 answer
47 views

How to explain near zero gradients on first epochs?

As I understand the gradient should reflect how near the weights are to the optimal values. In this way i will expect that on the first epochs the gradients far from zero or at least not mostly zero ...
user avatar
0 votes
0 answers
12 views

How to interpret integrated gradients in an NLP toxic text classification use-case?

I am trying to understand how integrated gradients work in the NLP case. Let $F: \mathbb{R}^{n} \rightarrow[0,1]$ a function representing a neural network, $x \in \mathbb{R}^{n}$ an input and $x' \in ...
user avatar
1 vote
0 answers
44 views

Why would one prefer the gradient of the sum rather than the sum of the gradients?

When gradients are aggregated over mini batches, I sometimes see formulations like this, e.g., in the "Deep Learning" book by Goodfellow et al. $$\mathbf{g} = \frac{1}{m} \nabla_{\mathbf{w}} ...
user avatar
  • 11
0 votes
1 answer
115 views

What does it mean by "gradient flow" in the context of neural networks?

Several research papers and textbooks (e.g. this) contain the phrase "gradient flow" in the context of neural networks. I am confused about whether it has any rigorous and formal way of ...
user avatar
  • 3,131
2 votes
2 answers
107 views

What specifically is the gradient of the log of the probability in policy gradient methods?

I am getting tripped up slightly by how specifically the gradient is calculated in policy gradient methods (just the intuitive understanding of it). This Math Stack Exchange post is close, but I'm ...
user avatar
1 vote
0 answers
100 views

What exactly do gradient-based saliency map tell us?

As far as I understand, gradients are supposed to tell us 1) the magnitude and 2) direction, to update a parameter such as to minimize the loss function. Regarding saliency maps, which use gradients ...
user avatar
1 vote
1 answer
34 views

Rank of gradient-of-loss with respect to layer weights in an MLP

The paper: https://arxiv.org/abs/2110.11309, makes the following claim at the end of page 3: The gradient of loss $L$ with respect to weights $W_l$ of an MLP is a rank-1 matrix for each of B batch ...
user avatar
  • 63
0 votes
1 answer
32 views

Which is more popular/common way of representing a gradient in AI community: as a row or column vector?

Consider the following remark about writing gradients from the chapter named Vector Calculus from the test book titled Mathematics for Machine Learning by Marc Peter Deisenroth et al. Remark (...
user avatar
  • 3,131
0 votes
1 answer
79 views

What is the rigorous and formal definition for the direction pointed by a gradient?

Consider the following definition of derivative from the chapter named Vector Calculus from the test book titled Mathematics for Machine Learning by Marc Peter Deisenroth et al. Definition 5.2 (...
user avatar
  • 3,131
1 vote
1 answer
77 views

Mathematically speaking, Is it only the product operation used in the chain rule causing the vanishing or exploding gradient?

I am asking this question from the mathematical perspective of the vanishing and exploding gradient problems that we face generally during training deep neural networks. The chain rule of ...
user avatar
  • 3,131
0 votes
1 answer
35 views

Isssue in understanding the derivation regarding mean squared error

The following derivation is taken from Chapter 5: Machine Learning Basics from the book titled Deep Learning (by Aaron Courville et al.) I am facing difficulty in understanding the zero derivative ...
user avatar
  • 3,131
0 votes
1 answer
111 views

How many directions of gradients exist for a function in higher dimensional space?

Gradients are used in optimization algorithms. Based on the values of gradients, we generally update the weights of a neural network. It is known that gradients have a direction and the direction ...
user avatar
  • 3,131
0 votes
0 answers
41 views

What all does the gradient tells us other than the direction to move parameters?

Gradients are used in optimization algorithms. I know that a gradient gives us information about the direction in which one needs to update the weights of a neural network. We need to travel in the ...
user avatar
  • 3,131
1 vote
1 answer
33 views

What is the high-level algorithm followed by contemporary packages for the calculation of gradient?

Most of the neural network models in contemporary deep learning packages are trained based on gradients. Let $f: \mathbb{R}^m \rightarrow \mathbb{R}^n$ be a function for which we want to find a ...
user avatar
  • 3,131
1 vote
0 answers
37 views

Is there any significance for higher order gradients in artificial intelligence?

Although I don't know in detail, I am aware of the following facts regarding the use of gradients in some domains of artificial intelligence, especially in minimizing the training of neural networks. ...
user avatar
  • 3,131
2 votes
1 answer
78 views

What does it mean by strong or sufficient gradient for training in this context?

It has been mentioned in the research paper titled Generative Adversarial Nets that generator need to maximize the function $\log D(G(z))$ instead of minimizing $\log(1 −D(G(z)))$ since the former ...
user avatar
  • 3,131
0 votes
0 answers
25 views

How to handle critical points during generator training?

Using an MLP as a generator introduces multiple critical points in parameter space. You can read this excerpt from the research paper titled Generative Adversarial Nets by Ian J. Goodfellow et al. In ...
user avatar
  • 3,131
1 vote
1 answer
68 views

What is meant by "well-behaved gradient" in this context?

Consider the following statement (from the paper Generative Adversarial Nets) about the success of discriminative models So far, the most striking successes in deep learning have involved ...
user avatar
  • 3,131
0 votes
1 answer
193 views

How to calculate the gradient penalty proposed in "Improved Training of Wasserstein GANs"?

The research paper titled Improved Training of Wasserstein GANs proposed a gradient penalty in order to avoid undesired behavior due to weight clipping of the discriminator. We now propose an ...
user avatar
  • 3,131
0 votes
0 answers
243 views

What are the input and output gradients in PyTorch?

Suppose I want to train a neural network with $m-$length inputs of form $x = [x_1, x_2, x_3, \cdots, x_m]$ and $n-$length outputs of form $y = [y_1, y_2, y_3, \cdots, y_n]$. Let the number of ...
user avatar
  • 3,131
1 vote
1 answer
50 views

What does it mean by "zeros the networks parameters gradients" in the context of training a neural network?

Consider the following PyTorch code ...
user avatar
  • 3,131
1 vote
0 answers
15 views

Terminology for the weight of likelihood ratio/score function?

If we estimate the gradient of $f(x)$ using the likelihood ratio/score function, i.e. $$\nabla f = f^*\dfrac{\partial \log p(x)}{\partial \theta}$$ is there any agreed upon terminology to call "$...
user avatar
  • 876
0 votes
1 answer
86 views

Why don't integrated gradients explain samples correctly?

I have a linear tabular dataset made of floats. The dataset follows a simple rule like: ...
user avatar
4 votes
1 answer
275 views

Why is it a problem if the outputs of an activation function are not zero-centered?

In this lecture, the professor says that one problem with the sigmoid function is that its outputs aren't zero-centered. Are the explanation provided by the professor regarding why this is bad is that ...
user avatar
  • 509
5 votes
2 answers
487 views

Why is tf.abs non-differentiable in Tensorflow?

I understand why tf.abs is non-differentiable in principle (discontinuity at 0) but the same applies to tf.nn.relu yet, in case of this function gradient is simply set to 0 at 0. Why the same logic is ...
user avatar
2 votes
1 answer
85 views

What is $ \nabla_{\theta_{k-1}} \theta_{k}$ in the context of MAML?

I am attempting to fully understand the explicit derivation and computation of the Hessian and how it is used in MAML. I came across this blog: https://lilianweng.github.io/lil-log/2018/11/30/meta-...
user avatar
10 votes
1 answer
5k views

What is the relationship between gradient accumulation and batch size?

I am currently training some models using gradient accumulation since the model batches do not fit in GPU memory. Since I am using gradient accumulation, I had to tweak the training configuration a ...
user avatar
  • 1,018
2 votes
2 answers
990 views

How can we compute the gradient of max pooling with overlapping regions?

While studying backpropagation in CNNs, I can't understand how can we compute the gradient of max pooling with overlapping regions. That's also a question from this quiz and can be also found on this ...
user avatar
  • 157
5 votes
2 answers
153 views

Is the gradient at a layer independent of the activations of the previous layers?

Is the gradient at a layer (of a feed-forward neural network) independent of the activations of the previous layers? I read this in a paper titled Mean Field Residual Networks: On the Edge of Chaos (...
user avatar
4 votes
1 answer
1k views

How is the gradient of the loss function in DQN derived?

In the original DQN paper, page 1, the loss function of the DQN is $$ L_{i}(\theta_{i}) = \mathbb{E}_{(s,a,r,s') \sim U(D)} [(r+\gamma \max_{a'} Q(s',a',\theta_{i}^{-}) - Q(s,a;\theta_{i}))^2] $$ ...
user avatar
1 vote
1 answer
222 views

How can the sum of squared errors have negative gradient if it's defined as the squared of the error?

The formula for the sum of squared errors (SSE) is: $$ \frac{1}{2} \sum_{i=1}^n (t^i - o^i)^2 $$ I have a few related questions. If $t^i - o^i$ is negative, doesn't the power of 2 eliminate any ...
user avatar
  • 395
4 votes
2 answers
561 views

Why is the derivative of this objective function 0 if the policy is deterministic?

In the Berkeley RL class CS294-112 Fa18 9/5/18, they mention the following gradient would be 0 if the policy is deterministic. $$ \nabla_{\theta} J(\theta)=E_{\tau \sim \pi_{\theta}(\tau)}\left[\left(\...
user avatar
  • 143