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
17 views

Andrew Ng Deep Learning Gradient Descent of Softmax is just y_hat - y?

At about 8:30 in the video here: https://www.youtube.com/watch?v=ueO_Ph0Pyqk so for the given example with 4 classes and first ground truth y being [0,1,0,0] and y_hat being [0.3,0.2,0.1,0.4] for ...
0
votes
1answer
19 views

Linear regression and gradient descend equations

I'm pretty new to ML and was starting out with linear regression combined with gradient descend. This is the equation I was trying to achieve using javascript- And this is what I came up with in js- <...
1
vote
1answer
24 views

How can the ReLU function lead to convergence?

The gradient descent algorithm is based on the fact that the gradient decreases as we move towards the optimum point. However, in the activations by the ReLU ...
1
vote
1answer
32 views

Vanishing gradient problem even after existence of ReLu function?

Let's say I have a deep neural network with 50 hidden layers and at each neuron of hidden layer the ReLu activation function is used. My question is Is it possible for vanishing gradient problem to ...
0
votes
0answers
23 views

Neural Net gradient descend

I was planning on making my own neural network library in C++ and was going through other's code to make sure I am on right track. Below is a sample code that I am trying to learn from. Everything in ...
1
vote
0answers
10 views

Compare rate of change for multiple object/weights

For a Neural Network, the weight update equation is: However, there are millions of such weights W_i. If I am interested in capturing how much each weight/connection W_i is changing as compared to ...
1
vote
0answers
20 views

Stochastic Gradient Region of Confusion

I have come across the following diagram which explains the behavior of SGD graphically. Based on this graphical representation, the gradient of the individual data tend to fluctuate more when it ...
0
votes
1answer
10 views

Gradient descent different implementation cause error

We know that we can get closer to the local minimum of the function by descending our argument according to that rule $$w1 = w0 − γ∇f$$ For example I have a linear regression model that depends on $b,...
1
vote
1answer
29 views

Gradient descent method

If we suppose that this is formula for gradient descent method: $$x_{n+1}=x_n-\lambda\cdot{{df(x)}\over{dx}},\ n=0,1,2,3,...$$ Since there is no exact value that we subtract instead of derivative, ...
0
votes
1answer
23 views

Why the gradient of a ReLU for X>0 is 1?

Gradient is derivative of several variables. I can't understand why is the gradient of a ReLU for X>0 is 1 ? and 0 for x < 0 ? I tried to search for proof and examples but didn't found any good ...
0
votes
0answers
12 views

Step size finds by quadratic fitting in steepest descent

I have a function $f=(1-x_1)^2 + (x_2-(x_1^2))^2$ and initial point $[0,5]$. I wonder how I will find step size by quadratic fitting using the (e.g. $0.01$) value in Steepest Descent with Matlab. To ...
0
votes
0answers
17 views

Bug in single layer Adaline Neuron implementation

I am trying to implement a single layer Adaline neuron, with the following mathematical foundation: The cost function is defined as: The weight update is defined as: inserting the partial derivative ...
0
votes
0answers
8 views

Method for Finding All Local Extrema Using Gradent Ascent/Descent

I have a very abstract model where a set of coefficients controls animal behavior. This model is so abstract that the actual values of a global extrema are not particularly interesting. However, the ...
1
vote
2answers
20 views

Why does using Gradient descent over Stochatic gradient descent improve performance?

Currently, I'm running two types of logistic regression. logistic regression with SGD logistic regression with GD implemented as follows ...
0
votes
0answers
13 views

Getting gradient for gradCam in pytorch

I am using forward and backward hook in my pytorch densenet121 model. I set requires_grad to False at the time of training. ...
0
votes
0answers
6 views

what would happen in max_pool layer if backprop would add gradient to all inputs for particular neuron but only if it's positive

in max_pool layer ANN performs this operation max([in1, in2, ... inN]), now if gradient that comes back to this layer is ...
0
votes
1answer
21 views

Is the usage of the “momentum” significiantly superior to the conventional weight update

The "momentum" adds a little of the history of the last weight updates to the actual update, with diminishing weight history (older momentum shares get smaller). Is it significiantly ...
0
votes
0answers
14 views

Gradient Descentfor non-linear predictor?

From I what I have read so far, if a loss function $\mathcal{l}(y,\hat{y})$ is convex where $\hat{y}$ is the (to be estimated) decision function, then gradient descent tries to minimizes the loss ...
0
votes
0answers
6 views

Gradient calculation of the pre-trained model

I have pre-trained tensorflow model in a graph format. I have not used tf.gradient on the graph structure. In such cases, is there any way to calculate the gradient of some tensors operation?
1
vote
1answer
13 views

Why do neural networks use cost minimization of loss function and not profit maximization of profit function?

In neural networks, gradient descent is used to find optimum minimum value of cost function. Why this preference instead of finding maximum value of profit function? What are the pros and cons of ...
0
votes
0answers
14 views

Theano error when performing Linear Regression

I'm trying to perform Linear Regression using Theano, but there is something I might be missing or doing wrong because I receive an error message, here you have a reproducible example: ...
1
vote
1answer
37 views

What method/algorithm for constrained multi-target regression

I am working with three dimensional measurement data and want to model them using a multivariate linear regression. I have already implemented a simple gradient descent algorithm to solve the classic ...
1
vote
1answer
26 views

What issue is there, when training this network with gradient descent? [closed]

Suppose we have the following fully connected network made of perceptrons with a sign function as the activation unit, what issue arises, when trying to train this network with gradient descent?
0
votes
1answer
22 views

Vanishing gradient problem

In a neural network, does gradient vanish during a great number epochs as well, rather that only vanishing through different layers?
0
votes
1answer
26 views

Why is backpropagation used for finding the loss gradient?

I am relatively new to the world of machine learning. After getting a general idea of the concept, I tried creating a program for training a deep learning network from scratch. My goal was to use as ...
0
votes
1answer
36 views

How do i get the loss function graph?

I used Mini-batch gradient descent to train the model, but i am unable to get the proper loss graph. The loss graph is always showed as a straight line. I know there is something wrong but would ...
0
votes
1answer
24 views

Gradient descent around optimal loss surface

All the loss surface used in examples have some of bowl shape that decrease drastically far from the optimal and decrease slowly around the optimal flat point. My questions are: Has all the loss ...
0
votes
0answers
11 views

Learning Rule fo bias weights

Consider the network : The learning rule (weight update )used for the hidden-to-output weights is: The learning rule (weight update )used for the input-to-hidden weights is: So what about the bias ...
0
votes
1answer
31 views

How does the equation “dW = - (2 * (X^T ).dot(Y - Y_hat)) / m” comes in Linear Regression (using Matrix + Gradient Descent)?

I was trying to code the Linear Regression in Python using Matrix Multiplication method using Gradient Descent and followed a code where there was no mention what is the loss but just a code as Per ...
0
votes
0answers
12 views

When to use Gradient boosting over stochastic gradient boosting

Gradient boosting works on the Gradient Descent concept and it's one of the ensemble methods. It has a regularization parameter to select subsamples, which is called stochastic gradient boosting. ...
2
votes
1answer
39 views

Adam Optimiser First Step

Plotting the paths on the cost surface from different gradient descent optimisers on a toy example, I found that the Adam algorithm does not initially travel in the direction of steepest gradient (...
1
vote
1answer
39 views

Derivative of a custom loss function with the logistic function

I have costum loss function with $\mu ,p, o, u, v$ as variables and $\sigma$ is the logistic function. I need to derive this loss function. Due to multiple variables in the loss function, I need to ...
1
vote
0answers
13 views

Can we talk about vanishing activations?

When updating the weights of a deep neural network using backpropagation, to update the weights of a given hidden layer, we use both the partial derivatives of the objective function with respect to ...
0
votes
1answer
24 views

Why are mini-batches degrading my conv net MNIST classifier?

I have made a convolutional neural network from scratch in python to classify the MNIST handwritten digits (centralized). It is composed of a single convolutional network with 8 3x3 kernels, a 2x2 ...
0
votes
0answers
17 views

When should I update weights and biases in Neural Network?

So, I am building a Neural Network from scratch for (typically) classifying MNIST digits. Everything is going fine, I can get up to 85% accuracy accross all testing data with stochastic gradient ...
0
votes
0answers
17 views

Unbiased Predictions for all Distinct Training Subsets

Suppose I have a data set $\left(X_i \in \chi, y_i \in \zeta \right)$ where $X_i$ and $y_i$ correspond to instances and labels, and $\chi$ and $\zeta$ correspond to the space where $X_i$ and $y_i$ ...
6
votes
1answer
385 views

Changing the batch size during training

The choice of batch size is in some sense the measure of stochasticity : On one hand, smaller batch sizes make the gradient descent more stochastic, the SGD can deviate significantly from the exact ...
3
votes
3answers
682 views

Why a sign of gradient (plus or minus) is not enough for finding a steepest ascend?

Consider a simple 1-D function $y = x^2$ to find a maximum with the gradient ascent method. If we start in point 3 on x-axis: $$ \frac{\partial f}{\partial x} \...
1
vote
0answers
23 views

Dying gradient issue in Graph Neural Networks

I am using Pytorch-Geometric library to implement a Graph Convolutional Layer(GCN) followed by few linear layers for a prediction task. But after training on graphs with np. of nodes being 10K and no. ...
0
votes
1answer
18 views

Neural Network Optimization steps order

I have a very basic question on the optimization algotithm, when I'm adjusting weights and biases in a NN, should I: Forward propagate and backpropagate to calculate gradient descent (DC) for each ...
1
vote
0answers
87 views

OLS and gradient descent difference?

I am doing a course on Udemy on which the instructor applied OLS (Ordinary least square) on a housing dataset. The curve he got was linear,with parameters [10^5,239]. Now When I tried to repeat the ...
3
votes
1answer
89 views

what is difference between Logistic regression and SGDClassifier with log loss OR SVM and SGDClassifer with hinge loss?

Can we just use SGDClassifier with log loss instead of Logistic regression, would they have similar results ?
1
vote
1answer
58 views

Do zero weights receive zero gradient in ReLU neural networks?

Suppose I have a deep neural network using the ReLU activation function, that is $\sigma(x) = max(x, 0)$. Suppose some weight $w_i$ becomes exactly $0$ at some point. Am I getting something wrong here,...
1
vote
0answers
6 views

Error term in probabilistic interpretation of least squares update rule

I have read in Stanford's CS229 course notes that to justify the least-squares update rule with probability, the following is assumed: $$y^{(i)} = \theta^Tx^{(i)}+\epsilon^{(i)}$$ , where $\epsilon^{(...
0
votes
0answers
21 views

Why is this equation converted to matrix form in this way? Is it possible to multiply an inverse matrix with a vector?

I have been banging my head on wall for days trying to decode this equation. please help me out with this... Below is the equation (consider $x$ as $\Delta x$, and $y$ as $\Delta y$): $x = - \eta(Id-\...
0
votes
0answers
16 views

How to interpret gradient descent in boosting ensembles?

I struggle to grasp the role of gradient based optimization in boosting ensembles. As far as I understand boosting means combining a bunch of estimators (of the same types, usually decision trees) ...
0
votes
0answers
33 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
46 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
2answers
44 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)?

1
2 3 4 5
8