I'm learning neural networks, specifically backpropagation and am reviewing the cost function. When looking at different educational sources for backprop, I'm seeing the cost function written in different ways. Sometimes it's written as (y_predicted - y_actual)^2 such as in Andrew Ng's notes and in other sources such as Welch Labs youtube NN videos its written as (y_actual - y_predicted)^2 (source: https://www.youtube.com/watch?v=5u0jaA3qAGk at 0.55sec). I've run through some test figures and because it's squared it comes the same but the inconsistency has thrown me. Does the order matter or is it just dependent on how the author wants to write it at the time?
2026-03-25 19:04:12.1774465452
Cost Function: Does it matter what order the y_predicted and y_actual are in?
121 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
There are 1 best solutions below
Related Questions in ERROR-FUNCTION
- Integral of error-like function
- Approximation of poly of degree 4 by degree 2
- To find the new weights of an error function by minimizing it
- About L2 error distribution and its STRANGE oscillatory behaviour
- Remainder in Asymptotic Expansion of Erfc
- How do I show this :$\int_{-\infty}^{+\infty} x^n 2\cosh( x)e^{-x^2}=0$ if it is true with $n$ odd positive integer?
- Intuitive meaning of attitude error function $\Psi$ defined over $SO(3)$. Is $\Psi$ a metric?
- What are the obtained consequences in mathematics if the antiderivative of $e^{-x²}$ and $e^{x²}$ expressed as elementary functions?
- The maximum area of a circle drawn between the graphs of $e^{-x²}$ and $-e^{-x²}$?
- Evaluation of $\int_{0}^\infty \frac{\sin(x)}{x}e^{- x²} dx$
Related Questions in MEAN-SQUARE-ERROR
- Comparing mean squared errors
- What value of a minimises the MSE of this estimator
- Why the writer of this article divided the mean square error formula by 2 instead of MxN?
- Limit Sup of mean square error of 2 Gaussian process
- Comparison of two estimators using the mean-square error
- Which estimator is better here?
- Mean squared error calculation
- MSE of estimator for normal distribution
- Minimum mean squared error of an estimator of the variance of the normal distribution
- moments estimation using Rayleigh distribution
Trending Questions
- Induction on the number of equations
- How to convince a math teacher of this simple and obvious fact?
- Find $E[XY|Y+Z=1 ]$
- Refuting the Anti-Cantor Cranks
- What are imaginary numbers?
- Determine the adjoint of $\tilde Q(x)$ for $\tilde Q(x)u:=(Qu)(x)$ where $Q:U→L^2(Ω,ℝ^d$ is a Hilbert-Schmidt operator and $U$ is a Hilbert space
- Why does this innovative method of subtraction from a third grader always work?
- How do we know that the number $1$ is not equal to the number $-1$?
- What are the Implications of having VΩ as a model for a theory?
- Defining a Galois Field based on primitive element versus polynomial?
- Can't find the relationship between two columns of numbers. Please Help
- Is computer science a branch of mathematics?
- Is there a bijection of $\mathbb{R}^n$ with itself such that the forward map is connected but the inverse is not?
- Identification of a quadrilateral as a trapezoid, rectangle, or square
- Generator of inertia group in function field extension
Popular # Hahtags
second-order-logic
numerical-methods
puzzle
logic
probability
number-theory
winding-number
real-analysis
integration
calculus
complex-analysis
sequences-and-series
proof-writing
set-theory
functions
homotopy-theory
elementary-number-theory
ordinary-differential-equations
circles
derivatives
game-theory
definite-integrals
elementary-set-theory
limits
multivariable-calculus
geometry
algebraic-number-theory
proof-verification
partial-derivative
algebra-precalculus
Popular Questions
- What is the integral of 1/x?
- How many squares actually ARE in this picture? Is this a trick question with no right answer?
- Is a matrix multiplied with its transpose something special?
- What is the difference between independent and mutually exclusive events?
- Visually stunning math concepts which are easy to explain
- taylor series of $\ln(1+x)$?
- How to tell if a set of vectors spans a space?
- Calculus question taking derivative to find horizontal tangent line
- How to determine if a function is one-to-one?
- Determine if vectors are linearly independent
- What does it mean to have a determinant equal to zero?
- Is this Batman equation for real?
- How to find perpendicular vector to another vector?
- How to find mean and median from histogram
- How many sides does a circle have?
You have
$$(y_p-y_a)^2 = (-(y_a-y_p))^2 = ((-1)\cdot (y_a-y_p))^2=(-1)^2(y_a-y_p)^2=(y_a-y_p)^2$$
so no, the order doesn't matter.
You could also just as easily write $|y_p-y_a|^2$ if that makes it any clearer.