Skip to main content

Questions tagged [gradient-descent]

For questions surrounding gradient descent, a method for finding the optimum state of a parameterized function based on another function often called the loss or error function. It iteratively descends the loss surface to the minimum loss by adjusting parameters based on the product of the partial derivatives comprising the gradient and a learning rate.

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

Why same learning rate for slope and intercept not working in Linear regression?

I'm a new student in AI, currently learning linear regression. I used the california housing dataset for doing my experiments. My goal is to predict the 'population' column based on the 'total_rooms' ...
Jahid Chowdhury Choton's user avatar
1 vote
1 answer
69 views

Is there a theoretical way to determine the best learning rate for gradient descent if the function is a simple known polynomial?

I was playing around gradient descent topic. Wrote a function that calculates a gradient descent of a degree-2 polynomial. While trying out what is the best "step size multiplyer" (a.k.a. &...
Ababababa's user avatar
  • 113
2 votes
1 answer
127 views

REINFORCE with Baseline update rule

I was looking at the algorithm for REINFORCE with baseline from the Book 'Introduction to Reinforcement Learning' from Sutton: I do not quite understand the update rule for $w$: $w = w + \alpha \...
kklaw's user avatar
  • 175
3 votes
1 answer
250 views

What do you mean by "updating based on a training example/batch" in Gradient Descent?

My understanding is this: When doing Stochastic Gradient Descent over a neural network, in every epoch, we run $n$ iterations (where the dataset has $n$ training examples) and in every iteration, we ...
insipidintegrator's user avatar
2 votes
1 answer
60 views

Can you explain the Hinton's comment "Rprop is equivalent to using the gradient, but also dividing by the size of the gradient"?

Been reviewing some old foundational material and ran into this comment by Hinton on Rprop in his old Coursera class: Rprop is equivalent to using the gradient, but also dividing by the size of the ...
eof's user avatar
  • 121
1 vote
2 answers
43 views

Why use learning rate schedules if weight updates automatically decrease when approaching local optimal?

Andrew Ng said in his slide that: However, there are numerous types of 'learning rate schedules' in TensorFlow that change the learning rate profile as training progresses. If it's true that these ...
Wong's user avatar
  • 11
0 votes
0 answers
21 views

NaN gradients while Training (but loss isn't NaN neither the computational graph is disconnected)

The reason I am asking this here is that I haven't found a bug in my code and maybe there isn't a bug at all (or maybe there is). I just want to validate the idea that I am trying to implement. Here ...
Ryukendo Dey's user avatar
1 vote
1 answer
44 views

A Feedforward Neural Network (FNN) implemented with RMSProp optimization is exhibiting a tendency to overclassify instances into one particular class

hope you're alright. I'm coding an FNN in Rust using the nalgebra crate. I coded the backpropagation based on this article from Brilliant (the link directly highlights the formulas' section I). The ...
Evry's user avatar
  • 13
0 votes
0 answers
33 views

What are w0 and w1 respectively after training with the following two examples of (x, y) in the given order?

The answer is supposed to be w0 = 2.8229, w1 = 2.4686. I'm not sure how that is the case. Can you please also show how you arrived at the solution?
LuminousStar's user avatar
0 votes
1 answer
48 views

Gradient: any resource on how to understand everything about it?

I have read some resources about AI, and they all speak about the gradient. Is there any book focused on this? maybe with tons of images / diagrams? Cheers
zerunio's user avatar
0 votes
0 answers
30 views

Independent parameter update in backpropagation

When we calculate the gradient wrt to each paramters, we consider the other parameters remain constant, but the moment their is a change in any of the other parameters, shouldn't all the other changes ...
In progress...'s user avatar
0 votes
1 answer
30 views

What are the differences between loss surfaces that "derive"from different observations?

If I understand right that each observation whithin a dataset, creates a different loss surface where we want to find the global minimum. How different those surfaces one from another? Would it be ...
Igor's user avatar
  • 181
0 votes
0 answers
32 views

Relation between the number of parameters and the features in Gradient descent algorithm

My book describes this as an equation for minimizing the $\theta$ value, but I have a few questions regarding the intuition behind this equation: The book describes $j$ as the number of features. If ...
someman112's user avatar
1 vote
0 answers
39 views

Can gradient descent cause loss to increase in some situations?

Is a gradient descent step always supposed to decrease loss? I can think of a situation where it would seem that gradient descent would increase loss but maybe it I am misunderstanding a part of ...
Mike Levi's user avatar
1 vote
2 answers
45 views

Is there a resource that offers a detailed overview of the gradient flow?

Understanding the concept of "Gradient Flow" can be quite difficult as there is a lack of widely recognized and clearly defined resources that provide a comprehensive explanation. Although ...
v1998199904's user avatar
0 votes
1 answer
98 views

Is there a recommended resource that can provide a detailed overview of the gradient norm?

When it comes to the concept of "Gradient Norm," it can be challenging to find a widely recognized and clearly defined resource that offers a comprehensive explanation. While many search ...
StudentV's user avatar
10 votes
1 answer
3k views

Why use ReLU over Leaky ReLU?

From my understanding a leaky ReLU attempts to address issues of vanishing gradients and nonzero-centeredness by keeping neurons that fire with a negative value alive. With just this info to go off of,...
John Brown's user avatar
4 votes
1 answer
393 views

What is the best way to combine or weight multiple losses with gradient descent?

I am optimizing a neural network with Adam using 3 different losses. Their scale is very different, and the current method is to either sum the losses and clip the gradient or to manually weight them ...
Simon's user avatar
  • 153
2 votes
1 answer
227 views

What is the justification for this approach of clipping elementwise?

I'm new to the field of AI (though I have a background in mathematics). As I was going through some documents, I read that there is a form of gradient clipping where the elements of the gradient that ...
Ukn0wn's user avatar
  • 21
2 votes
1 answer
272 views

How does gradient descent work with relu if weights are negative?

How does gradient descent work with relu, imagine the weights are quite negative and so our "prediction" is 0, then not much is learned. Is there a risk that training gets stuck when weights ...
Dirk N's user avatar
  • 158
1 vote
1 answer
2k 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 ...
Cyrus's user avatar
  • 111
0 votes
1 answer
360 views

Single Layer Perceptron Backpropagation: How to compute affect of the net value on the output?

Assuming a single perceptron (see figure), I have found two versions of how to use backpropagation to update the weights. The perceptron is split in two, so we see the weighted sum on the left (the ...
HTH's user avatar
  • 1
2 votes
2 answers
166 views

How are gradients of individual layers computed?

I have been reading some papers recently (example: https://arxiv.org/pdf/2012.00363.pdf) which seem to be training individual layers of, say, a transformer, holding the rest of the model frozen/...
nlp4892's user avatar
  • 21
0 votes
1 answer
27 views

What are your "current parameters" in Minibatch Stochastic Gradient Descent?

I was reading a book on Deep Learning when I came across a line, more like a few words that didn't make apparent sense. Thus, we will often settle for sampling a random minibatch of examples every ...
HarshDarji's user avatar
1 vote
2 answers
67 views

Can I minimize a mysterious function by running a gradient descent on her neural net approximations?

So I have this function let call her $F:[0,1]^n \rightarrow \mathbb{R}$ and say $10 \le n \le 100$. I want to find some $x_0 \in [0,1]^n$ such that $F(x_0)$ is as small as possible. I don't think ...
Vladimir Zolotov's user avatar
0 votes
1 answer
92 views

During batch normalization is the mini-batch gone through twice, one to calculate the mean and variance and then to normalize them?

I am asking this question because while designing my own model, I had repeated gradient explosion issues, so I wanted to try batch normalization. I really want to understand the details and math ...
liyu zerihun's user avatar
0 votes
1 answer
123 views

Numerical problems with gradient descent

I'm trying to implement a simple neural network for classification (multi-class) as an exercise (written in C). During gradient descent, the weights and biases quickly get out of control and the ...
martinkunev's user avatar
2 votes
0 answers
50 views

Can objective function and gradient be unlimited in reinforcement learning?

I'm looking at an example where they define a policy $\pi_\theta(a_t|s_t)\sim \mathcal{N}(ks_t, \sigma)$, where $a_t$ and $s_t$ are action and state, while $\theta=(k,\sigma)$ are the parameters of ...
pippo's user avatar
  • 41
1 vote
1 answer
283 views

Why do we use gradient descent to minimize the loss function?

The purpose of training neural networks is to minimize a loss function, in this process we usually use gradient descent method. But in Calculus, if we want to find the global minimum of a ...
Proton's user avatar
  • 111
0 votes
1 answer
177 views

What exactly is the AI explainability problem?

I am pretty new to AI and have recently been paying attention to AI explainability and the fact that it remains a hurdle within the path of commercializing certain AI systems in health for instance. I ...
rp2001's user avatar
  • 1
1 vote
1 answer
614 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 ...
Grumpy C's user avatar
1 vote
2 answers
83 views

At which point, does the momentum based GD helps really in this figure?

Classical gradient descent algorithms sometimes overshoot and escape minima as they depend on the gradient only. You can see such a problem during the update from point 6. In classical GD algorithm, ...
hanugm's user avatar
  • 3,870
0 votes
0 answers
28 views

Resolving Derivation Discrepancies for Differentiating through Optimization Paths

I'm reading the paper "Optimizing Millions of Hyperparameters by Implicit Differentiation". The key contribution of the paper is to show that you can replace optimizing through the ...
Decadz's user avatar
  • 1
0 votes
1 answer
396 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 ...
Guillermo Alvarez's user avatar
1 vote
0 answers
442 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}} ...
Eddie C's user avatar
  • 11
3 votes
1 answer
209 views

In general - is Stochastic Gradient Descent a "superior" algorithm compared to Gradient Descent? [closed]

On a very informal level, if we were to compare the (classical) Gradient Descent Algorithm to the Stochastic Gradient Descent Algorithm, the first thing that comes to mind is: Gradient Descent can be ...
stats_noob's user avatar
0 votes
1 answer
101 views

Unclear fact about difference between Gradient Descent to Stochastic Gradient Decent in wikipedia

From wikipedia page it mentioned: To economize on the computational cost at every iteration, stochastic gradient descent samples a subset of summand functions at every step. This is very effective in ...
JammingThebBits's user avatar
0 votes
1 answer
46 views

Simple Polynomial Gradient Descent algorithm not working

I am trying to implement a simple 2nd order polynomial gradient descent algorithm in Java. It is not converging and becomes unstable. How do I fix it? ...
PentiumPro200's user avatar
2 votes
0 answers
155 views

Watkins' Q(λ) with function approximation: why is gradient not considered when updating eligibility traces for the exploitation phase?

I'm implementing the Watkins' Q(λ) algorithm with function approximation (in 2nd edition of Sutton & Barto). I am very confused about updating the eligibility traces because, at the beginning of ...
Francesco Vignola's user avatar
1 vote
0 answers
57 views

GANs: Why does iterative gradient descent sometimes optimise $\min_G \max_D V(D,G)$ and sometimes $\max_D \min_G V(D,G)$?

For the following minimax equation for generative adversarial networks (GANs), $$\min_G \max_D V(D,G) = \mathbb{E}_{\boldsymbol{x}\sim p_{data}(\boldsymbol{x})}[\log D(\boldsymbol{x})] + \mathbb{E}_{\...
James Ellis's user avatar
8 votes
2 answers
5k views

Why is gradient descent used over the conjugate gradient method?

Based on some preliminary research, the conjugate gradient method is almost exactly the same as gradient descent, except the search direction must be orthogonal to the previous step. From what I've ...
Recessive's user avatar
  • 1,396
1 vote
1 answer
117 views

Is it possible to use stochastic gradient descent at the beginning, then switch to batch gradient descent with only a few training examples?

Batch gradient descent is extremely slow for large datasets, but it can find the lowest possible value for the cost function. Stochastic gradient descent is relatively fast, but it kind of finds the ...
Robo's user avatar
  • 121
1 vote
0 answers
89 views

Why are optimization algorithms for deep learning so simple?

From my knowledge, the most used optimizer in practice is Adam, which in essence is just mini-batch gradient descent with momentum to combat getting stuck in saddle points and with some damping to ...
Moritz Groß's user avatar
1 vote
1 answer
2k views

What is uncentered variance and how it becomes equal to mean square in Adam?

I have been reading about Adam and AdamW (Here). The author mentioned that in "uncentered variance" we don't consider subtracting mean In this statement, the author is talking about ...
learner's user avatar
  • 151
2 votes
0 answers
365 views

How to train neural networks with multiprocessing?

I am trying to figure out how multiprocessing works in neural networks. In the example I've seen, the database is split into $x$ parts (depending on how many workers you have) and each worker is ...
Yedidya kfir's user avatar
0 votes
0 answers
548 views

In mini-batch gradient descent, are the weights updated after each batch or after all the batches have gone through an epoch?

Say I have a mini-batch of size 32, and I have 10 such batches. Assuming I only run it for one epoch (just for the sake of understanding it), Will the weights be updated using the gradients of one ...
Kaustubh Sharma's user avatar
1 vote
0 answers
581 views

What is the effect of gradient clipping by norm on the performance of a model?

It is recommended to apply gradient clipping by normalization in case of exploding gradients. The following quote is taken from here answer One way to assure it is exploding gradients is if the loss ...
hanugm's user avatar
  • 3,870
1 vote
1 answer
262 views

What is the difference between gradient decent in neural networks and temporal difference in reinforcement learning?

I am studying Q-learning in reinforcement learning. My question is about the Bellman equation. In Q-learning, the Bellman equation is often introduced as follows. \begin{align} Q_{new}(s,a) &= Q_{...
Osama El-Ghonimy's user avatar
1 vote
1 answer
343 views

How many iterations of the optimisation algorithm are performed on each mini-batch in mini-batch gradient descent?

I understand the idea of mini-batch gradient descent for neural networks in that we calculate the gradient of the loss function using one mini-batch at a time and use this gradient to adjust the ...
user50018's user avatar
1 vote
2 answers
570 views

In mini-batch gradient descent, do we pass each input in the batch individually or all inputs at the same time through the layer?

In the stochastic gradient descent algorithm, the weight update happens for every training sample. In the mini-batch gradient descent algorithm, the weight update happens for every batch of training ...
hanugm's user avatar
  • 3,870

1
2 3 4 5