Skip to main content

Questions tagged [backpropagation]

For questions about the back-propagation (aka "backprop", and often abbreviated as "BP") algorithm, which is used to compute the gradient of the objective function (e.g. the mean squared error) with respect to the parameters (or weights) of the neural network, when trained with gradient descent.

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

Back Propagation Involving Sorting and Tensor Indexing in Pytorch [closed]

I have a matrix and am computing its column sums and sorting k indices with the highest values in the column sum. These k indices are then used to reduce another 2-D matrix by picking rows ...
Riya's user avatar
  • 9
2 votes
2 answers
425 views

Is it easier to use back-propagation or genetic algorithms to teach an artificial intelligence?

I am making a very simple neural network for a school project, and I would like to know what the best and easiest way to "teach" a neural network would be. From what I know, backpropagation ...
AlexanderB's user avatar
0 votes
0 answers
19 views

Is my C# Adam implementation correct?

I have some doubt because I incurred in different papers proposing different implementations. Also implementations on opensource projects looks different. In example there is a C++ library that ...
CoffeDeveloper's user avatar
0 votes
1 answer
45 views

Total loss in backpropagation

I'd say I have some understanding of backpropagation, however I am not really sure of the total loss being calculated. Let us take the example below: After 1 forward pass when I have to update the ...
xkcd101's user avatar
0 votes
1 answer
39 views

How to optimise a FNN/MLP network with MSE (positive only loss) in C

I can create a FNN/MLP network in C but only g-p loss works, where g = ground truth and p = predicted. What I don't understand is how MSE a positive only loss value can train a back propagation ...
user avatar
1 vote
2 answers
65 views

Why do we update parameters with respect to cost instead of loss? [closed]

Assuming that the cost function $J$ is the average of the loss function $\mathcal{L}$ over all training examples $m$ $J(w) = \frac{1}{m} \displaystyle\sum_{i=0}^{m} \mathcal{L}$ why do we update the ...
Aditya Tomar's user avatar
0 votes
0 answers
36 views

Reinforcement learning - calculating policy gradient using cross entropy loss

I am writing a program that uses reinforcement learning and the policy gradient method to play Pong. It basically extends Andrej Karpathy's version (https://gist.github.com/karpathy/...
Blato's user avatar
  • 1
0 votes
0 answers
41 views

Why does "in-place" mutation cause automatic differentiation to fail, and how to write code to avoid this problem

I work with a few different automatic differentiation frameworks, including pytorch, Jax, and Flux in Julia. Periodically I run some code and I get errors about mutations or operations occurring "...
krishnab's user avatar
  • 207
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
0 votes
0 answers
11 views

Neural Net Convergence for Batch SGD

I've built a dynamically sized neural network framework with for multi class classification—just to strengthen my understanding of the deep networks. I'm training and predicting my network to classify ...
arjaras's user avatar
0 votes
1 answer
31 views

Can positional encodings in transformers be added

Here's a basic GPT2 implementation: ...
Foobar's user avatar
  • 153
0 votes
1 answer
42 views

How to prevent update a pretrained model if a model is optimized with backpropagation? [closed]

These are components in my model: A generator An encoder: a pretrained, and should not updated. A loss function. Input is passed to the encoder to generate X, X is then passed to generator to ...
Jesse's user avatar
  • 109
0 votes
0 answers
34 views

What am I doing wrong that result in a graph indicating better gradients in non-scaled dot-product attention compared to the scaled version?

I'm trying to visualize how the gradients change as we're increasing $d_{k}$ in the scaled dot-product attention and compare it to its non scaled version but I'm failing to produce a reasonable graph ...
Daviiid's user avatar
  • 575
1 vote
1 answer
74 views

In multilayer perceptron, to update the Bias value, do we use the neuron's delta, or do we use the sum of all deltas?

In multilayer perceptron, to update the Bias value, do we use the neuron's delta, or do we use the sum of all deltas? I ask this because I once saw a video on YouTube where the formula for updating ...
will The J's user avatar
0 votes
0 answers
50 views

In MLP, in the formula to calculate the delta in the hidden layer, it uses the sum of all Deltas and Connection Weights in the next layer?

Reference: http://neuralnetworksanddeeplearning.com/chap2.html I have a question about the equation to calculate the delta in the hidden layer: In the formula to calculate the delta in the hidden ...
will The J's user avatar
0 votes
0 answers
20 views

In MLP, Why in the formula to calculate delta, the derivation of the cost function "(predicted - expected)" just as "(predicted - expected)" itself?

I know that we have to perform the derivation of the terms, using the chain rule, to obtain the equations to calculate the gradients of the neurons. In this article: https://machinelearningmastery.com/...
will The J's user avatar
1 vote
0 answers
38 views

In MLP, to calculate the delta, do I need to calculate the derivative of the cost function? Or can I just use the cost function result?

In Multi Layer Perceptron networks, I have a question: in the formula to calculate the error in the output layer, Some articles say it is like this ...
will The J's user avatar
-1 votes
1 answer
75 views

How is back propagation applied in case the activation function is not differentiable?

Back propagation is based on partial derivatives including the activation functions. How is back propagation applied when the activation function is not differentiable?
DSPinfinity's user avatar
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
113 views

Why in one article to calcule the delta uses the weights of current layer, while in another article uses the weights of neuron inputs of next layer?

Article 1: https://pyimagesearch.com/2021/05/06/backpropagation-from-scratch-with-python/ Article 2: https://machinelearningmastery.com/implement-backpropagation-algorithm-scratch-python/ I was ...
will The J's user avatar
1 vote
0 answers
37 views

Neural network learns to mimic distribution of classes in dataset instead of using signal from input

I'm trying to implement example from a classic AI paper named "Learning representations by back-propagating errors" by Hinton et al. Example aims at training network able to predict third ...
Jan Grzybek's user avatar
0 votes
0 answers
31 views

How was the word2vec model trained?

Let's take the CBOW (continuous bag of words) model as the example. Suppose that, there are $c$ context words, each of which is a one-hot encoding vector. So the total number of elements of input ...
J. Doe's user avatar
  • 1
0 votes
1 answer
43 views

If I manually trained a multilayer percetron neural network, always following exactly the same steps meticulously, would I always get the same result?

Reference: https://home.agh.edu.pl/~vlsi/AI/backp_t_en/backprop.html If I trained a multilayer percetron neural network manually, following exactly the backpropagation steps described in the article, ...
will The J's user avatar
0 votes
2 answers
125 views

Does this article make use of the chain rule? And where?

References: Chain rule in Wikipedia: https://en.wikipedia.org/wiki/Chain_rule Chain rule in Towards Data Science: https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd#:~...
will The J's user avatar
1 vote
1 answer
59 views

In multilayer perceptron neural networks, are the names "delta", "gradient" and "error" all the same thing? or not?

What is the difference between "delta", "gradient" and "error", are these names the same thing? I'm confused because someone once told me that both the names "delta&...
will The J's user avatar
1 vote
1 answer
85 views

Please, could someone help me understand if the backpropagation explanations in these two articles about calculate the error are equivalent?

I have a question about backpropagation, I'm a beginner, I'm studying the formulas to calculate the delta of neurons, there are several sources on the internet, which teach in different ways, so I'm ...
will The J's user avatar
1 vote
1 answer
416 views

what is the backpropagation formula to calculate delta and update weights?

I'm trying to study how backpropagation works step by step in a MultiLayer Perceptron neural network. I would really like to be able to understand how these calculations work. And I have a specific ...
will The J'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
0 answers
27 views

Is it possible to combine SGD with an unsupervised learning approach effectively

Before I undertake quite a large project I would like to clarify whether my idea for training a multi-layer neural network will work. I plan to make an AI that can land a rocket from randomly ...
Gamaray's user avatar
0 votes
1 answer
96 views

Confusion over taking gradients in Variational Autoencoders (VAE)

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 \...
Joel's user avatar
  • 33
0 votes
0 answers
40 views

neural network not training correctly

i'm trying to learn how a neural network works. i'm writing the neural network in C for handwritten digit recognition and training it on MNIST dataset. the neural network has an input layer with 28*28 ...
Faby's user avatar
  • 9
0 votes
1 answer
344 views

How to do backpropagation with argmax?

I am attempting to utilize two networks: a classifier and a linear network. Based on the output class of the first network, my goal is to retrieve the corresponding value from the linear network using ...
Subrat Prasad's user avatar
0 votes
1 answer
144 views

Does the output of LLM's affect their neural weights?

When an LLM creates an output, it seemingly has no way to check if its output was valid. Therefore it wouldn't be able to back-propagate any changes to the weights is used to create that output. ...
Seph Reed's user avatar
  • 103
1 vote
2 answers
164 views

Backpropagation with CrossEntropy and Softmax, HOW?

Let Zs be the input of the output layer (for example, Z1 is the input of the first neuron in the output layer), Os be the output of the output layer (which are actually the results of applying the ...
qazaq's user avatar
  • 11
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
58 views

How to apply backpropagation when one layer of the network is a call-only function (no gradient)?

I worked with Feed Forward Neural Network and VAE and understood backpropagation algorithm. Now I build a VAE network, one layer of it is a very complex vector-to-vector function $f(x)$ (a general '...
whitegreen's user avatar
0 votes
1 answer
61 views

About the requirement to compute the gradient at layer $l$

I'm trying to understand a line of my note. Let's say there is a simple feedforward neural network that has $N$ layers, and for a given layer $l$, it has weight $W^l$, and $g^l$ is the gradient to ...
NRain's user avatar
  • 121
1 vote
1 answer
233 views

Is there any reference about backpropagation of the Transformer's multi-head layer?

Is there any reference about backpropagation of the Transformer's multi-head layer or multi-head attention (MHA)? I have searched various journals but have not found one yet.
poglhar's user avatar
  • 23
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
2 votes
1 answer
488 views

How is the max function differentiable wrt multiple arguments?

I recently came across an answer on StackOverflow that mentioned the max function being differentiable with respect to its values. From my current understanding of ...
Peyman's user avatar
  • 564
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
0 votes
0 answers
125 views

Computational overhead of "SCALING FORWARD GRADIENT WITH LOCAL LOSSES"

The paper "SCALING FORWARD GRADIENT WITH LOCAL LOSSES" discusses a new way of training deep neural networks called forward gradient learning. This method is different from the traditional ...
caesar's user avatar
  • 101
0 votes
0 answers
29 views

Is it possible to get recurrence through alternating forward and backward propagation?

This is a purely theoretical question, and I'm not trying to solve some real world problem with this, and I don't care about how ineffective this may be, as long as it is theoretically possible. For a ...
camel-cdr's user avatar
  • 101
0 votes
0 answers
53 views

Backpropagation of position-wise feedforward neural network

I have read a paper entitled "Attention is all you need" by Vaswani et al. (2017). This paper use the so-called position-wise feedforward neural network, where the input of this network is a ...
poglhar's user avatar
  • 23
0 votes
0 answers
190 views

Why Hadamard product appear in General backpropagation derivation?

I'm trying to understand the basic backpropagation of a neural network and stuck with this formula, which describes how you calculate the error vector for a layer $i$: $$\delta z^{[i]} = (w^{[i + 1]})^...
MathematicsBeginner's user avatar
3 votes
1 answer
109 views

What is the partial derivative $\frac{\partial y}{\partial x_1}$ in this neural network?

The answer is supposed to be -6, but I don't know how to get that. Also, in a NN, is that 2nd hidden layer possible, where the neurons are not dependent on all the neurons of the previous layer?
duanebobby's user avatar
1 vote
1 answer
129 views

How do policy gradients work?

If I understand it correctly from the following equation $$U(\theta)=\mathbb{E}_{\tau \sim P(\tau;\theta)}\left [ \sum_{t=0}^{H-1}R(s_t,u_t);\pi_{\theta} \right ]=\sum_{\tau}P(\tau;\theta)R(\tau)$$ ...
User's user avatar
  • 175
0 votes
1 answer
45 views

How would I use backpropagation with a changing cost function [closed]

I have a neural network that is being trained with a changing cost function. Could I use backpropagation at all? If yes, how would I do this?
922073's user avatar
  • 11

1
2 3 4 5 6