Gradient Descent is an algorithm for finding the minimum of a function. It iteratively calculates partial derivatives (gradients) of the function and descends in steps proportional to those partial derivatives. One major application of Gradient Descent is fitting a parameterized model to a set of data: the function to be minimized is an error function for the model.

452 questions
Filter by
Sorted by
Tagged with
15 views

### Mean Square Error not decreasing during gradient descent

I am currently writing a program which is supposed to implement gradient descent to train a prediction model. I am encountering an error whereby my MSE continuously increases, and the network never ...
15 views

### Minimize MAE loss for a target that is sum of two other targets

Working on a regression modelling task where my dataset have some feature columns, two more columns A, B and a target column T. The goal is to predict T, and minimize MAE, that is ...
1 vote
99 views

I am only just getting familiar with gradient descent through learning logistic regression. I understand the directional component in the gradient vectors is correct information derived from the slope ...
10 views

### Why does weight decay produce regularisation in Deep Neural Network?

Weight decay penalizes the model to have smaller weights but how does this help in regularisation? Any intuition on smaller weights => simpler model?
1 vote
26 views

I am confused as to when to hold certain parameters constant in a VAE. I will explain with a concrete example. We can write $\operatorname{ELBO}(\phi, \theta) = \mathbb{E}_{q_{\phi}(z)}\left[\log \... 0 votes 0 answers 32 views ### Gradients of lower layers of a CNN when gradient of an upper layer is 0? Say we have a convolutional neural network with an input layer, 3 convolutional layers and an output layer. Say the gradients with respect to the weights and biases of the third convolutional layer ... 2 votes 1 answer 292 views ### Gradients of lower layers of NN when gradient of an upper layer is 0? Say we have a neural network with an input layer, a hidden layer and an output layer. Say the gradients with respect to the weights and biases of the output layer are all 0. Then, by backpropagation ... 0 votes 0 answers 18 views ### How to calculate the gradient magnitude , orientation and threshold the image intensity values = [10 20 5],[10 20 5] kx=[1 -1] ky=[1 ], [-1] How to calculate the gradient magnitude , orientation and threshold the image intensity values = [10 20 5],[10 20 5] kx=[1 -1] ky=[1 ], [-1] image intensity values = [10 20 5] [10 20 ... 0 votes 0 answers 44 views ### Backpropagation and Gradient Descent: Questions on math behind it I watched this video which goes over backpropagation calculus and read the Wikipedia page on it. This is my understanding of the equations for the algorithm. I have questions regarding the equations ... 1 vote 1 answer 49 views ### Why Cost function is differentiable? I've a very basic question about cost functions. I'm studying gradient descent and there we're using partial differentiation of features "Theta". But isn't the cost function an absolute ... 0 votes 2 answers 38 views ### Does LinearRegression uses Gradient Descent for finding slope and y-intercept of the best fit line? I know that Gradient Descent is an optimization algorithm used for optimizing the cost of the loss function. Does Linear Regression model of the sklearn package use ... 0 votes 0 answers 105 views ### TensorFlow Gradient Tape - LookupError (Tandem Neural Network project) I am trying to train a network by using a custom lost function, then computing the gradient of the loss, and updating the trainable variables in the reverse network (named: reverse_loaded). For ... 0 votes 1 answer 13 views ### feature engineering mechanism why do we need to rescale some feature having large range I know we do it for faster rate of gradient descent ,but still how does rescaling works? and it doesn't break the model and does rescaling ... 1 vote 1 answer 26 views ### Doubt in gradient , vanishing gradient problem in Back propagation As per my knowledge, in back propagation- loss function or gradient is used to update the weights. in back propagation, weights became small w.r.t gradients, this leads to vanishing gradient problem. ... 0 votes 0 answers 9 views ### Correlation between hinge loss function, Langrage function and ai The function$f(w,b) = \frac{1}{2} ||w||^2$is our objective function while our constraints are all the correct classifications of the data points expressed as$g(w,b) = \sum_{i=1}^{l} (y_i (x_i \cdot ...
42 views

I am training a 2 layer MLP on an off-policy learning-to-rank task, where the input is a list of documents against a query with a feature vector for each query-document pair, i.e. if there are M ...
26 views

### cost function including constrain on vector norm

I'm playing with collaborative implementation using numpy. As a reminder, we are given a matrix $R$ of user ratings for movies. Let's assume there are 3 users and 4 movies. The data matrix we are ...
30 views

### Exploring the Concept of 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 ...
1 vote
2k views

### What exactly is Gradient norm?

I found that there is no common resource and well defined definition for "Gradient norm", most search results are based on ML experts providing answers which involves gradient norm or papers ...
49 views

### How exactly does the mini batch method work?

I mean let's say I have a mini batch, I take an example from it and for it I do the following: I do forward propagation. Using the output after forward propogation - I calculate the gradients of the ...
114 views

### Affine layer - gradient shape

In course cs231n, I need to implement backward pass computation for an affine (linear) layer: ...
16 views

### Is It Fair to Simplify Gradient Descent as Derivative of Loss Function * Derivative of Activation Function * Derivative of Neuron?

Recently I've been trying to think of an easier way to wrap my head around gradient descent rather than just manually derive loss function with respect to weights (and chain and yada yada yada). I was ...
1 vote
36 views

### Gradient vector starts to increase at some point, gradient descent from scratch

I have a simple linear function y = w0 + w1 * x, where w0 and w1 are weights, And I'm trying to implement a gradient descent for it. I wrote the function and tested in on the data(a dataset of two ...
13 views

### My linear regression doesn't work when i try to calculate theta1

I want to create my own linear regression. But my formula of the coefficient theta1 doesn't work i have big values : ...
16 views

### moments of weight vectors in Adam

When performing backpropagation with Adam algorithm, are the moment and the second moment of the weight vectors calculated also for the weights in hidden layers?
29 views

### what is static objective function

Paper on Adam mentions Stationary Objective function. I am not able to find its definition on Internet (or may be it's there with some other name and I am not able to figure it out). I will be ...
25 views

Adagrad adapts the learning rate $\alpha$ all along the gradient descent process, by dividing each weight on a quantity based on the sum of the previous squared gradient up to time $t$. Therefore, ...
1 vote
23 views

### How to calculate gradient of MSE in backpropagation? [duplicate]

I want to implement a neural network from scratch to solve linear regression by using backpropagation. I don't understand how to compute the gradient of the MSE cost function with respect to each ...
19 views

Am I understood right that if we put batchnorm layer after every conv layer and our network is very deep, then we won't have a problem of gradient attenuation? In other words, is it true that ...
26 views

230 views

### Why is cross entropy loss averaged and not used directly as a sum during model training(such as in neural networks)

Why is the cross entropy loss for all training examples(or the training examples in a batch) averaged over size of the training set(or batch size) ? Why is it not just summed and used ?
1 vote
32 views

### How train a pre-trained model based on new dataset?

I have trained a deep nn model based on some existing data. In the meantime, I have collected more data and label them so that I can feed it to the model to improve its performance. The questions is, ...
18 views

### How to derive expression for gradient in BPPT

I have the following problem: I am trying to derive final expressions for error gradients in a simple recurrent neural network (Backpropagation through Time, BPPT). The parameters and state update ...
95 views

### GAN Generator Backpropagation Gradient Shape Doesn't Match

In the TensorFlow example (https://www.tensorflow.org/tutorials/generative/dcgan#the_discriminator) the discriminator has a single output neuron (assume batch_size=1). Then over in the training loop ...
189 views

### Understanding the stochastic average gradient (SAG) algorithm used in sklearn

For pedagogical purposes I've been trying to create my own implementation of the stochastic average gradient (SAG) algorithm in a logistic regression framework. Page 10 of the associated paper ...
19 views

### What is the meaning of uncentered variance?

I read some articles that describe ADAM optimizer and they used uncentered variance expression. I'm not sure I understand the ...
77 views

### What does the ellipse in Gradient descent describes?

I saw multiple articles describes GD or SGD with the following diagram: I didn't saw any explanation about the ellipses. What ...
10 views

### In RMSProp how squares of the gradients dumps out the oscillations?

I read multiple articles that say that RMSProp use the squares of the gradients in order to dump oscillations. It's not intuitive to me how the squares of the ...
1 vote
194 views

### How Adam optimizer influence the learning rate? [closed]

I read some papers about how ADAM optimizer works, and there are some issues which seems that are confusing: ADAM equations are: ...
55 views

### What will happen if we apply Gradient Ascent?

I have built a simple neural network on MNIST, but instead of moving toward the opposite direction of gradients, I moved in the same direction of it just by applying( pytorch ): ...
1 vote
490 views

### Does settings $\beta_1 = 0$ or $\beta_2 = 0$ means that ADAM behaves as RMSprop or Momentum?

I read on ADAM optimizer, and I saw multiple quotes which say that ADAM is a combination of Momentum and RMSprop optimizers. So if we: Set $\beta_1 = 0$ does it means that ADAM behaves exactly as ...
59 views

### Normalising data for simple linear regression

Consider a simple linear regression problem where: X = [1,2,3,4,5,100,200] Y= [2,4,6,8,10,200,400] Clearly, the relationship is of the form $y=2x$; While trying ...
19 views

### How backward() is calculated in CrossEntropyLoss?

I have a simple Linear model and I need to calculate the loss for it. I applied two CrossEntropyLoss and NLLLoss but I want to ...
1k views

### How to fit a math formula to data?

I have math formula and some data and I need to fit the data to this model. The math is like. $y(x) = ax^k + b$ and I need to estimate the $a$ and the $b$. I have triet gradient descend to estimate ...
371 views

### Why does Adam outperform SGD in logistic regression?

I am training a logistic regression model. In case it matters, the features are 1376-dimensional embeddings output from a neural network. I tried both SGD and Adam with a learning rate of $10^{-3}$ ...
268 views

### Difference between sklearn's LogisticRegression and SGDClassifier?

What is the difference between sklearn's LogisticRegression classifier and its SGDClassifier? I understand that the SGD is an ...
62 views

### Why backpropagation is done in every epoch when loss is always scalar?

I understand the backpropagation algorithm that it calculates the derivate of loss with respect to all the parameters in the neural network. My question is this derivate is constant right because the ...