Questions tagged [gradient-descent]

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.

Filter by
Sorted by
Tagged with
0
votes
0answers
24 views

Multivariable linear gradient descent resulting in inf

I am trying to implement a multivariable gradient descent algorithm, it seems to start working fine, and works on smaller datasets, but applying it to larger datasets the variables overflow and cause ...
-1
votes
3answers
38 views

Gradient descent does not converge in some runs and converges in other runs in the following simple Keras network

When training a simple Keras NN (1 input, 1 level with 1 unit for a regression task) during some runs I get big constant loss that does not change in 80 batches. During other runs it decreases. What ...
0
votes
1answer
22 views

Why use gradient descent on Deep Nets / RNNs when cost function is not convex?

Why do we use gradient descent on very non-convex loss functions such as in Deep nets / RNNs rather than a heuristic search (genetic algorithms, simulated annealing, etc)?
3
votes
2answers
91 views

Getting NN weights for every batch / epoch from Keras model

I am trying to get weights for every batch / epoch from Keras model after it is trained. To do so I use callback to make model save weights during training. Yet after model is trained it looks like I ...
1
vote
0answers
29 views

SVM with gradient descent

The constrained optimization problem in SVM is given by min 1/2 ||w||^2 s.t y(i)(w^T x(i) + b >= 1 for all i Now converting this to an unconstrained optimization problem gives the lagriangian L as ...
3
votes
2answers
140 views

How does the descending gradient know what weights to adjust?

I was reading about descending gradient. How does the descending gradient know what weights to adjust? Does it adjust to all network weights at the same time? Does each weight have an associated error?...
2
votes
3answers
34 views

Neural Network Loss Function - Mean Square Error: questions about what 'n' signifies

I'm very new to neural networks and have recently learnt about the loss functions used with neural networks. This question is in regards to the mean square error metric, defined as (from the textbook ...
1
vote
1answer
13 views

Maximum Likelihood with Gradient Descent or Coordinate Descent blows up

Context The maximum likelihood estimators for a Normal distribution with unknown mean and unknown variance are $$ \widehat{\mu} = \frac{1}{n}\sum_{i=1}^n x_i \qquad \text{and} \qquad \widehat{\sigma}^...
1
vote
1answer
38 views

Why standard distribution for ML [closed]

Data normalization: It ensures that each input (each pixel value, in this case) comes from a standard distribution. This standardization makes our model train and reach a minimum error, faster! my ...
3
votes
0answers
70 views

Why the sigmoid activation function results in sub-optimal gradient descent?

I need some help understanding the second shortcoming of the sigmoid activation function as described in this video from Stanford. She says that because the output of sigmoid is always positive, that ...
-1
votes
0answers
15 views

How do I fit a custom curve to a mathematical model using TensorFlow/Keras?

I'm trying to fit a simple S.I.R mathematical model to the U.K. COVID dataset using TensorFlow/Keras. I've spent days looking to no avail. I have the data from a csv file and stored in a tx1 NumPy ...
1
vote
0answers
41 views

How are batch gradients computed on embedding layers?

Consider the following model, which is more or less a 12-dimensional vector lookup table with 10 rows, initialized to all zeros. ...
1
vote
1answer
29 views

How to decide if gradients are vanishing?

I am trying to debug a neural network. I am seeing gradients close to zero. How can I decide whether these gradients are vanishing or not? Is there some threshold to decide on vanishing gradient by ...
4
votes
2answers
1k views

What is momentum in neural network?

While using "Two class neural network" in Azure ML, I encountered "Momentum" property. As per documentation, which is not clear, it says For The momentum, type a value to apply ...
1
vote
1answer
59 views

Why don't we find the analytical function of the cost function?

Then we could derive it and find minimum(s). e.g. in small networks the cost function has not so many variables.
1
vote
0answers
23 views

Backpropagation Mathematics with Sigmoid Output Activation and Cross Entropy Loss

I am deriving a Weight update for a simple toy network with a Sigmoid Output Layer. I need some help double checking my math to make sure I did it correctly. I am using Cross-Entropy Loss as my Loss ...
1
vote
0answers
24 views

Why is the exploding/vanishing gradient problem not solved by line search?

The problem of vanishing gradients is basically that since our step size is proportional to the gradient, if the gradient is very small, it might take a long time to reach a local minimum. So why don'...
0
votes
0answers
20 views

Is it possible to calculate gradient of a filter applied on the objects (that censor them)?

I want to find an optimal censoring function, that removes objects from a given set, as to maximise the set's quality. Suppose I am given a data set consisting of N objects, each is represented by a ...
3
votes
3answers
732 views

Using a random forest, would a RandomForest performance be less if I drop the first or the last tree?

Suppose I've trained a RandomForest model with 100 trees. I then have two cases: I drop the first tree in the model. I drop the last tree in the model. Would the model performance be less in the ...
0
votes
0answers
14 views

How to manufacture exploding gradients in a neural networks

it might sound silly but i have this assignment problem where i have to show how exploding gradients occur in neural nets and i need to create a neural netowork which shows this phenomenon. the ...
2
votes
3answers
114 views

Why do we move in the negative direction of the gradient in Gradient Descent?

It is said that backpropagation, with Gradient Descent, seeks to minimize a cost function using the formula: $$ W_{new} = W_{old} - learningRate \cdot \frac{\partial E}{\partial W} $$ My question is, ...
1
vote
1answer
53 views

vanishing gradient and gradient zero

There is a well known problem vanishing gradient in BackPropagation training of ...
0
votes
1answer
157 views

Why sparse features should have bigger learning rates associated? And how Adagrad achieves this? [closed]

I was learning about Adagrad optimizer. I came to know that it has a very helpful functionality which is that we can have lower learning rates for the features that are more common and greater ...
1
vote
1answer
64 views

Confusion with Notation in the Book on Deep Learning by Ian Goodfellow et al

In chapter 6.1 on 'Example: Learning XOR', the bottom of page 168 mentions: The activation function $g$ is typically chosen to be a function that is applied element-wise, with $h_i = g(x^TW_{:,i}+c_i)...
0
votes
1answer
52 views

Wouldn't it make more sense to give less importance to gradient far away in past in AdaGrad? [closed]

This is the update equation of a weight by AdaGrad: $$w_{new} = w_{old} - \frac{lr}{\sqrt{G_{}+E}}.G_{w_{old}}$$ Where $G$ is the sum of the gradients of the same weight at previous iterations, $E$ is ...
0
votes
1answer
57 views

Why are we taking the square root of the gradient in Adagrad? [closed]

This is how we update weights with Adagrad: $$w_i = w_i - \frac{lr}{\sqrt{g_i+E}}$$ where, $w_i$ is the $i^{th}$ weight, $lr$ is the learning rate, $g_i$ is the gradient of the $i^{th}$ weight at all ...
2
votes
1answer
22 views

Issues with self-implemented logistic regression

I am trying to self-implement a logistic regression algorithm to do some self-learning but I am having a bit of trouble with achieving similar accuracy to the logistic regression of sklearn. Here is ...
0
votes
2answers
42 views

Why Mini batch gradient descent is faster than gradient descent?

According to me: Mini Batch Gradient Descent : 1.It takes a specified batch number say 32. 2.Evaluate loss on 32 examples. 3.Update weights. 4.Repeat until every example is complete. 5.Repeat till a ...
0
votes
1answer
41 views

With Stochastic Gradient Descent why we dont compute exact derivative of loss function?

In a blog I read this: With Stochastic Gradient Descent we don’t compute the exact derivate of our loss function. Instead, we’re estimating it on a small batch. blog. Now I am confused with the whole ...
0
votes
0answers
25 views

Why do we use stochastic gradient descent in neural networks and what are the main ideas behind this optimization technique?

I am a student and I am studying machine learning. I am focusing on neural network, and I have seen that for a neural network, to define the optimal weights, we don't use gradient descent, but we use ...
1
vote
1answer
42 views

Why do we only care about convex functions when doing Gradient Descent/SGD?

I mean I know why we specifically care about convex functions: it's because their local minimum are also global, and so you just have to "follow a path which goes down" to find the minima of ...
0
votes
1answer
50 views

Linear function gradient descent

I am trying to implement a gradient descent algorithm for a simple linear function: y(x) = x Where initial hypothesis function is: ...
3
votes
1answer
50 views

When does it make sense to choose gradient descent for SVM over liblinear?

I understand using gradient descent methods with SVM is intractable if you've used the kernel trick. In that case, best to use libsvm as your solver. But in the case that you are not using a kernel ...
0
votes
1answer
26 views

implementing forward and backward of a Linear model

I'm implementing the code of this abstraction. The forward is easy and looks like that: I don't understand the backward path and how it fit's the abstraction in the first image: Why is db defined as ...
0
votes
0answers
18 views

a technique to improve convergence rate

So I saw this technique which is explained as an improvement for gradient descent algorithm, which is based on coordinate transformation: What I don't understand is why in the second slide ...
0
votes
2answers
36 views

Intuitive explanation for representing gradient in higher dimensions

I do not understand how complex networks with many parameters/dimensions can be represented in a 3D space, and form a standard cost surface just like a simple network with, say, 2 parameters. For ...
0
votes
0answers
10 views

For calculating gradient penalty, why we need to consider data point that lies on the straight lines between actual and generator data pairs?

I am trying to understand the gradient penalty which was introduced in the following famous paper: Improved Training of Wasserstein GANs Introduced in section 4, equation 3 For calculating gradient ...
0
votes
0answers
6 views

Why does the error function become constant while implementing stochastic gradient descent using 2D inputs?

According to Q8,9 of HW5, Caltech's Learning from data course, we have to generate 100 test points of the form (x1,x2) and get their outputs 1/0 depending on which side of a random line they lie on. ...
1
vote
1answer
51 views

Can mini-batch gradient descent outperform batch gradient descent? [duplicate]

As I was reading and going through the second course of Andrew Ng's deep learning course, I came across a sentence that said, With a well-turned mini-batch size, usually it outperforms either ...
0
votes
2answers
71 views

In a neural network, is it possible to gradient descent with more than one input?

I went through a few tutorials, examples recently, and all (not sure if just for demonstration purposes) done gradient descent for one input. To get a deep understanding of backpropagation, I wrote a ...
2
votes
2answers
87 views

How do local minima occur in the equation of loss function?

In gradient descent, I know that local minima occur when the derivative of a function is zero, but when the loss function is used, the derivative is equal to zero only when the output and the ...
0
votes
0answers
25 views

What are ways to pick a single training sample to compute gradient in SGD?

instead of computing the full gradient as in GD, SGD computes estimate of the gradient by either computing gradient of a mini-batch or computing gradient for a single training sample, picked randomly ...
0
votes
0answers
9 views

How to use Meta-SGD with U-Net

I'm guessing how to use Meta-SGD with U-Net network. I've been searching for an example, but I haven't found anything yet. I'm reading the book Hands On Meta Learning with Python, which has the ...
1
vote
1answer
43 views

Mathematics: Can the result of a derivative for the Gradient Descent consist of only one value?

I have a problem of a task using the formula of the Gradient Descent: Perform two steps of the gradient descent towards a local minimum for the function given below, using a step size of 0.1 and an ...
1
vote
1answer
68 views

Do batch GD and stochastic GD give the same results?

If a neural network is trained on a dataset of M samples for N epochs, do batch GD and SGD give the same result? Is SGD is faster because utilize the hardware better? I am asking because I figured out ...
4
votes
1answer
79 views

Learning parameters when loss is a piecewise function

I have a network to generate a single number $T$. I know in advance: a property of the loss function is that, when $T \in [a_1, a_2]$, the loss has the same value $L_1$; when $T \in [a_2, a_3]$, the ...
2
votes
0answers
183 views

Why L2 norm in AdaGrad update equation not L1?

The update equation of AdaGrad is as follows: I understand that sparse features have small updates and this is a problem. I understand that the idea of AdaGrad is to make the update speed (learning ...
1
vote
1answer
83 views

Is it valid to use numpy.gradient to find slope of line as well as slope of curve at any point?

what is the difference between slope of the line and slope of the curve? Is it valid to use numpy.gradient to find the slope of the line and slope of the curve at ...
1
vote
1answer
51 views

How to find slope of curve at certain points

how to find slope at certain points circled in blue in below curve ? Are these below 2 approaches valid ? though they give different results . How to automatically find the points where the slope ...
0
votes
1answer
847 views

No gradients provided for any variable: ['Variable:0', 'Variable:0']

I am using Python 3.6 and Tensorflow 2.0 for the following code for linear regression: ...

1
2 3 4 5
8