Questions tagged [gradient]
For questions related to the gradient, a way of packing together all the partial derivative information of a function
40
questions
1
vote
0
answers
23
views
How to estimate the gradient of an argmin loss
Suppose we have a neural network $f_\theta(x)$, where $x$ is the input and $\theta$ is the network's parameters.
For each $\theta$, we can minimize $f_\theta(x)$ w.r.t. $x$ and obtain the minimum ...
1
vote
0
answers
20
views
How to prepare audio data for deep learning?
Audio data is typically an array with the waveform represented by values from -1 to 1. There are two issues with that:
if all values are inverted, e.g. -1 becomes 1 and 1 becomes -1, the audio doesn'...
2
votes
0
answers
114
views
GAN : Why does a perfect discriminator mean no gradient for the generator?
In the training of a Generative Adversarial Networks (GAN) system, a perfect discriminator (D) is one which outputs 1 ("true image") for all images of the training dataset and 0 ("false ...
0
votes
1
answer
108
views
Why to use gradient accumulation?
I know that gradient accumulation is (1) a way to reduce memory usage while still enabling the machine to fit a large dataset (2) reducing the noise of the gradient compared to SGD, and thus smoothing ...
2
votes
1
answer
77
views
Why is automatic differentiation still used, if today's computers can calculate symbolic derivatives quite fast?
Today's computers can calculate symbolic derivatives quite fast, why is automatic differentiation still used? For example, Mathematica can handle algebraic operations with arrays. Doesn't automatic ...
-1
votes
1
answer
111
views
I’m making a simple neural network from scratch and it won’t learn anything. Please help [closed]
I am coding a classifier neural network from scratch. It is not really learning and I believe that somewhere there is a gradient explosion/vanishing issue. Could be some other stuff as well that I ...
0
votes
0
answers
44
views
How to select pseudo label samples that minimize validation loss?
I have a problem about meta pseudo labeling, I want to select the most significant pseudo-labels that minimize validation loss. Let's say i initialize a set of pseudo label denoted $Y_{pseudo}$, then ...
0
votes
0
answers
51
views
Basic question about gradient for nominal regression
Say that we want to binary-classify images using a sigmoid function with the entropy-loss function. This algorithm is quite slow.
The sigmoid function is:
I find that this could be traced to the $L(y,...
1
vote
1
answer
305
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 ...
1
vote
0
answers
33
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 ...
0
votes
1
answer
175
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 ...
0
votes
0
answers
21
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 ...
1
vote
0
answers
165
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}} ...
2
votes
2
answers
1k
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 ...
2
votes
2
answers
368
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 ...
1
vote
0
answers
179
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 ...
1
vote
1
answer
58
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 ...
0
votes
1
answer
34
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 (...
0
votes
1
answer
109
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 (...
1
vote
1
answer
154
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 ...
0
votes
1
answer
93
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 ...
0
votes
1
answer
225
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 ...
1
vote
1
answer
62
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 ...
1
vote
1
answer
39
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 ...
1
vote
1
answer
58
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.
...
2
votes
1
answer
145
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 ...
1
vote
1
answer
88
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 ...
0
votes
1
answer
509
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 ...
1
vote
1
answer
96
views
What does it mean by "zeros the networks parameters gradients" in the context of training a neural network?
Consider the following PyTorch code
...
1
vote
0
answers
16
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 "$...
0
votes
1
answer
112
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:
...
4
votes
1
answer
1k
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 ...
5
votes
2
answers
820
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 ...
2
votes
1
answer
91
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-...
10
votes
1
answer
8k
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 ...
2
votes
2
answers
1k
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 ...
5
votes
2
answers
266
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 (...
5
votes
1
answer
2k
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]
$$
...
1
vote
1
answer
327
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 ...
4
votes
2
answers
596
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(\...