Neural Network Gradients
- 79Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
79 questions
- 1A neural network with hidden layers and nonlinear activation functions requires a way to determine how each weight affects the final_____.
Hint
It is the quantity the model training process aims to reduce.
Answer
loss
Explanation
Training requires computing how changes to network weights affect the loss at the output.
- 2For models such as linear SVMs and logistic regression, gradient descent is effective partly because their gradients or subgradients are relatively_____.
Hint
Consider how difficult the derivatives are to calculate in these models.
Answer
simple
Explanation
The gradients or subgradients of these simpler models are relatively simple to calculate.
- 3A numerical gradient approximates a derivative by evaluating the change in a function over a small increment, represented by_____.
Hint
This symbol names the small change in the input used in the approximation.
Answer
delta
Explanation
The finite-difference approximation compares function values at an input and at that input plus a small increment, delta.
- 4The finite-difference approximation estimates a derivative by using a small increment instead of taking the limit as the increment approaches_____.
Hint
A derivative is defined using a limit in which the increment vanishes.
Answer
zero
Explanation
The numerical method dispenses with the limit and uses an appropriately small delta to approximate the limit as delta goes to zero.
- 5For a numerical gradient to be usable, the function must be defined at both the input and the input plus_____.
Hint
The approximation compares two nearby input locations.
Answer
delta
Explanation
The function must be defined at both x and x+δ to calculate the finite difference.
- 6A numerical gradient also assumes that the line between the two sampled points is reasonably representative of the function's behavior_____those points.
Hint
The assumption concerns the function's behavior along the interval joining the samples.
Answer
between
Explanation
The approach assumes the function behaves coherently between the two points, so the line between them is a useful approximation.
- 7Numerical gradients are broadly applicable because they place almost no constraints on the kinds of_____being differentiated.
Hint
The method can be used beyond functions with convenient symbolic derivatives.
Answer
functions
Explanation
Numerical differentiation is widely applicable as long as the function behaves coherently at the required nearby points.
- 8A major drawback of numerical gradients for a network is that each weight must be changed individually and the entire network evaluated again, making the method extremely_____.
Hint
Think about the cost of repeating a full network evaluation for every parameter.
Answer
slow
Explanation
The computation must be repeated for every weight, which makes numerical gradients impractical for large neural networks.
- 9When an analytic gradient is feasible to derive, it is generally the smart, principled, and_____choice.
Hint
It avoids repeatedly evaluating the model at perturbed parameter values.
Answer
efficient
Explanation
An analytic expression can be evaluated directly, making it more efficient than testing every weight with numerical perturbations.
- 10Deriving gradients by hand for large compound functions is difficult and error prone because a small algebraic mistake can affect the entire_____.
Hint
The error can propagate through the calculations used across the network.
Answer
model
Explanation
Complex gradient derivations involve extensive algebra, and a minor mistake can throw off the model's gradient calculations.
- 11The chain rule states that derivatives of composed functions can be calculated by multiplying their local_____.
Hint
These quantities describe how each operation changes its input locally.
Answer
gradients
Explanation
The chain rule combines local derivatives multiplicatively to obtain the derivative of a composition.
- 12For y=f(u) and u=g(x), Leibniz notation expresses the chain rule as dxdy=dudydxdu; the intermediate variable is_____.
Hint
It is the output of the inner function and the input of the outer function.
Answer
u
Explanation
The derivative through the composition is the derivative of the outer stage with respect to the intermediate value multiplied by the derivative of that intermediate value with respect to the input.
- 13For the composition f(g(x)), the derivative of the outer function is evaluated at_____.
Hint
The outer function receives the output of the inner function as its input.
Answer
g(x)
Explanation
The derivative of f is evaluated at g(x), while the derivative of g is evaluated at x.
- 14For a three-function composition f(g(h(x))), the chain rule multiplies the derivatives of f, g, and_____.
Hint
It is the innermost function in the composition.
Answer
h
Explanation
The derivative of the full composition is the product of the local derivatives for all three functions, evaluated at their corresponding inputs.
- 15In a computational graph, nodes represent operations, while edges represent the flow of_____.
Hint
The edges carry values from one operation to another.
Answer
data
Explanation
A directed graph represents a sequence of operations with nodes for operations and edges for the data passed between them.
- 16In the graph for g(f(x)), the value passed from the first operation to the second is_____.
Hint
It is the output of the first operation and the input of the next.
Answer
f(x)
Explanation
The input x enters f, and the resulting value f(x) flows into g.
- 17In a graph with operations f followed by g, the local gradient at the g operation is evaluated at_____.
Hint
The second operation receives the first operation's output.
Answer
f(x)
Explanation
The local gradient at g is g′(f(x)), since the input to g is f(x).
- 18Although multiplication is commutative, gradients in a computational graph are conventionally described as flowing from the end of the graph_____.
Hint
This direction starts at the output and moves toward the input.
Answer
backwards
Explanation
The product of local gradients has no inherent direction, but tracing gradients backward is useful for computation and is the convention used in backpropagation.
- 19In the sequence b=f(a), c=g(b), and d=h(c), each function's output becomes the next function's_____.
Hint
It is the value that the following operation receives.
Answer
input
Explanation
A sequence of operations passes each output forward as the input to the next operation.
- 20For the composition exp(sin(x)), the local derivative of the exponential operation is the_____.
Hint
The derivative of the exponential function has the same form as the function itself.
Answer
output of the exponential
Explanation
The derivative of the exponential is the exponential output, so its local gradient is exp(sin(x)).
- 21For the composition exp(sin(x)), the local derivative of the sine operation is_____.
Hint
Recall the standard derivative of the sine function.
Answer
cos(x)
Explanation
The derivative of sine with respect to its input is cosine, so the local gradient at the sine operation is cos(x).
- 22Using the chain rule, the derivative of exp(sin(x)) is the product of cos(x) and_____.
Hint
Multiply the sine derivative by the derivative of the outer exponential.
Answer
exp(sin(x))
Explanation
The derivative is cos(x)exp(sin(x)), the product of the local gradients.
- 23In the four-operation construction of the sigmoid, the first operation applied to x is negation, which produces_____.
Hint
The first operation multiplies its input by negative one.
Answer
−x
Explanation
Negation changes the input x to −x.
- 24After negation and exponentiation in the sigmoid construction, the intermediate value is_____.
Hint
Exponentiate the negated input.
Answer
e−x
Explanation
Applying the exponential to −x produces e−x.
- 25Adding one to the exponential intermediate in the sigmoid construction produces_____.
Hint
This is the value immediately before taking the reciprocal.
Answer
1+e−x
Explanation
The third operation adds one, giving 1+e−x.
- 26Taking the reciprocal of 1+e−x produces the sigmoid, also called the_____function.
Hint
This name is often used interchangeably with sigmoid.
Answer
logistic
Explanation
The resulting expression, 1+e−x1, is the sigmoid or logistic function.
- 27The local derivative of the negation operation, which multiplies its input by negative one, is_____.
Hint
The slope of a function that maps an input to its negative is constant.
Answer
−1
Explanation
The derivative of multiplication by negative one is negative one.
- 28The local derivative of the operation that adds one to its input is_____.
Hint
Adding a constant does not change the slope.
Answer
1
Explanation
The derivative of the increment operation is one because the output changes at the same rate as its input.
- 29The local derivative of the reciprocal operation with input u is_____.
Hint
Differentiate the reciprocal and express the result using the operation's input.
Answer
−1/u2
Explanation
For a reciprocal, the derivative with respect to its input is negative one divided by the input squared.
- 30For the sigmoid construction with input x=1.5, the final output is approximately_____.
Hint
Negate 1.5, exponentiate it, add one, and take the reciprocal.
Answer
0.82
Explanation
The sequence gives −1.5, then approximately 0.22, then 1.22, and finally a reciprocal of about 0.82.
- 31For the graph y=sigmoid(xw), the local derivative of the multiplication output xw with respect to x is_____.
Hint
Treat w as constant when differentiating the product with respect to x.
Answer
w
Explanation
The partial derivative of xw with respect to x is w.
- 32For the graph y=sigmoid(xw), the local derivative of the multiplication output xw with respect to w is_____.
Hint
Treat x as constant when differentiating the product with respect to w.
Answer
x
Explanation
The partial derivative of xw with respect to w is x.
- 33In the graph y=sigmoid(xw), the overall derivative with respect to x is the sigmoid gradient at xw multiplied by_____.
Hint
The chain rule multiplies the sigmoid's local gradient by the derivative of the product with respect to x.
Answer
w
Explanation
The derivative with respect to x is w times the sigmoid gradient evaluated at xw.
- 34In the graph y=sigmoid(xw), the overall derivative with respect to w is the sigmoid gradient at xw multiplied by_____.
Hint
Use the product node's local derivative with respect to the weight.
Answer
x
Explanation
The derivative with respect to w is x times the sigmoid gradient evaluated at xw.
- 35A numerical value for a gradient at a particular input is sufficient for updating model parameters; the full symbolic expression is not always_____.
Hint
The learning algorithm uses the gradient's value for the case being evaluated.
Answer
needed
Explanation
For a particular input, the numeric gradient provides the information needed to update the model parameters.
- 36For the sine-then-exponential graph with input 2, the sine intermediate is approximately_____.
Hint
Evaluate the sine of two radians as given in the example.
Answer
0.91
Explanation
The sine of the chosen input, 2, is approximately 0.91, and that value is passed to the exponential.
- 37For the sine-then-exponential graph with input 2, the final output is approximately_____.
Hint
Apply the exponential to the sine intermediate of about 0.91.
Answer
2.48
Explanation
The exponential of approximately 0.91 is about 2.48.
- 38For the sine-then-exponential graph with input 2, the cosine local gradient is approximately_____.
Hint
It is the cosine of the original input, not the sine intermediate.
Answer
-0.42
Explanation
The sine node's local derivative is cos(2), approximately −0.42.
- 39For the sine-then-exponential graph with input 2, multiplying the local gradients gives an overall gradient of approximately_____.
Hint
Multiply the cosine value near negative 0.42 by the exponential output near 2.48.
Answer
-1.04
Explanation
The local gradients multiply to approximately (−0.42)(2.48)=−1.04.
- 40For the four-operation sigmoid graph with input 1.5, the local gradient of the exponential operation is approximately_____.
Hint
The derivative of the exponential equals its output at that operation.
Answer
0.22
Explanation
The exponential output at this stage is about 0.22, so its local gradient is also about 0.22.
- 41For the four-operation sigmoid graph with input 1.5, the reciprocal operation's local gradient is approximately_____.
Hint
Use negative one divided by the square of the reciprocal's input, which is about 1.22.
Answer
-0.67
Explanation
The reciprocal derivative is −1/u2; with input about 1.22, it is approximately −0.67.
- 42For the four-operation sigmoid graph with input 1.5, multiplying the local gradients gives an overall derivative of approximately_____.
Hint
Combine the local gradients for negation, exponential, adding one, and reciprocal.
Answer
0.15
Explanation
The product of the local derivatives, propagated backward through the four operations, is about 0.15.
- 43For the multiplication-and-sigmoid graph with x=−1.2 and w=0.3, the multiplication node outputs_____.
Hint
Multiply the two specified input values.
Answer
-0.36
Explanation
The product is (−1.2)(0.3)=−0.36.
- 44For the multiplication-and-sigmoid graph with x=−1.2 and w=0.3, the sigmoid output is approximately_____.
Hint
Apply the sigmoid to the product, negative 0.36.
Answer
0.41
Explanation
The sigmoid of approximately −0.36 is about 0.41.
- 45For the same graph, the sigmoid node's local gradient at input −0.36 is approximately_____.
Hint
Evaluate the sigmoid derivative at the multiplication output.
Answer
0.24
Explanation
Applying the sigmoid derivative to approximately −0.36 gives a local gradient near 0.24.
- 46For the same graph, the overall gradient with respect to x=−1.2 is approximately_____.
Hint
Multiply the sigmoid local gradient by w=0.3.
Answer
0.07
Explanation
The derivative with respect to x is approximately (0.24)(0.3), or about 0.07.
- 47For the same graph, the overall gradient with respect to w=0.3 is approximately_____.
Hint
Multiply the sigmoid local gradient by x=−1.2.
Answer
-0.29
Explanation
The derivative with respect to w is approximately (0.24)(−1.2), or about −0.29.
- 48A computational graph node can calculate its own local gradient because it keeps track of its local inputs and_____.
Hint
These are the values the node receives and produces.
Answer
outputs
Explanation
Each node maintains local information about its inputs and outputs and knows how to calculate its own local gradient.
- 49A node does not need to know the full network structure; it uses its local information and the downstream gradient it_____.
Hint
The value is passed back to the node from later operations.
Answer
receives
Explanation
A node combines its local derivative with the gradient received from downstream to calculate gradients for its own inputs.
- 50The boundaries of nodes or layers are flexible: operations can be split into simple arithmetic steps or grouped into a compound function with a known_____.
Hint
A convenient node may package a function whose rate of change is already available.
Answer
derivative
Explanation
Node boundaries can be chosen wherever useful; a compound function with a known derivative can be treated as one atomic operation.
- 51When vector inputs are used, gradients are passed as vectors or matrices of_____.
Hint
Each entry records how an output changes with respect to a corresponding input element.
Answer
partial derivatives
Explanation
For vector and matrix operations, gradients consist of partial derivatives arranged in vector or matrix form.
- 52The gradient vector or matrix has the same size and shape as the corresponding data or weights vector or_____.
Hint
The arrangement of gradient entries matches the structure of the differentiated quantity.
Answer
matrix
Explanation
Gradient entries occupy the corresponding positions and the gradient has the same shape as the data or weights being differentiated.
- 53The inner product of two vectors is the operation commonly used by a fully connected or_____layer.
Hint
This layer combines inputs and weights through a dot product.
Answer
linear
Explanation
A fully connected or linear layer computes an inner product between data and weights.
- 54If z is the dot product of vectors x and w, the gradient of z with respect to x is_____.
Hint
The derivative with respect to one vector is the other vector.
Answer
w
Explanation
For the inner product, the gradient with respect to x is w.
- 55If z is the dot product of vectors x and w, the gradient of z with respect to w is_____.
Hint
Switch which vector is treated as the differentiated input.
Answer
x
Explanation
For the inner product, the gradient with respect to w is x.
- 56In a linear layer, the gradient with respect to the input data is needed to propagate gradients to_____.
Hint
These are the earlier operations that supplied the layer's inputs.
Answer
upstream nodes
Explanation
The input gradient is passed backward to the upstream nodes in the network.
- 57In a linear layer, the gradient with respect to the weights is needed to update the layer's own_____.
Hint
This gradient supports learning the layer's parameters.
Answer
weights
Explanation
The weight gradient is used by the learning algorithm to update the layer's parameters.
- 58For an elementwise activation function, each output element is obtained by applying the same scalar function to the corresponding input element_____.
Hint
Each coordinate is processed without relying on other coordinates.
Answer
independently
Explanation
An elementwise operation acts separately on each input vector element, so the output contains the scalar function applied to each element.
- 59For an elementwise operation, the gradient vector contains the individual scalar derivatives evaluated at each input_____.
Hint
Each coordinate's derivative corresponds to that coordinate's value.
Answer
element
Explanation
The gradient vector is formed from the derivative of the scalar function at each individual input element.
- 60The gradient of the softmax function requires the entire Jacobian because each output element can depend on all the input_____.
Hint
The dependence is not restricted to matching coordinates.
Answer
elements
Explanation
Softmax is a vector function of vector inputs, and its output elements depend on all input elements, requiring a Jacobian.
- 61Combining softmax with cross entropy simplifies the gradient because many extraneous Jacobian elements_____.
Hint
The combined loss avoids passing around the full set of derivative terms.
Answer
disappear
Explanation
With cross entropy loss, many of the extra Jacobian terms cancel or disappear, leaving a simple gradient vector.
- 62When softmax is combined with cross entropy, bundling them into one layer avoids passing around the_____.
Hint
It is the full matrix of partial derivatives that the combination makes unnecessary.
Answer
Jacobian
Explanation
Treating softmax and cross entropy as one layer can avoid explicitly passing the full Jacobian through the network.
- 63For a layer with multiple outputs, its weights form a matrix, so the gradient must be a matrix with the same_____.
Hint
Each weight needs a corresponding gradient entry.
Answer
shape
Explanation
The gradient must contain derivatives for all weight-matrix elements and therefore has the same shape as the weight matrix.
- 64In batch or mini-batch processing, gradients for a data matrix can be combined by taking their sum or their_____.
Hint
This aggregation produces an average across the batch.
Answer
mean
Explanation
The full data-matrix gradient may be reduced by taking either a sum or a mean of the gradients.
- 65Using the mean of batch gradients tends to make gradients more stable and more comparable across different batch_____.
Hint
The benefit concerns comparing batches with different numbers of examples.
Answer
sizes
Explanation
A mean gradient is generally more stable and is less dependent on the size of the batch than a sum.
- 66A network-level data structure or class manages the larger network structure and communication between_____.
Hint
These are the components that contain local operations and exchange values.
Answer
layers
Explanation
Although each layer is self-contained, a data structure or class tracks the overall network and coordinates communication among layers.
- 67The forward pass processes nodes in input dependency order, so all of a node's inputs must be calculated before the node is_____.
Hint
A node cannot operate until its required values are available.
Answer
called
Explanation
The forward pass follows input dependencies: all inputs to an operation must be ready before the operation is evaluated.
- 68The forward pass propagates data from the network inputs through the operations to the_____.
Hint
This is where the final network output is produced.
Answer
end
Explanation
During the forward pass, data moves from the inputs all the way through the network to its final stage.
- 69After the forward pass reaches the final stage, the network calculates the_____.
Hint
It measures the model's error for the current output.
Answer
loss
Explanation
The final stage of the forward computation calculates the loss, which then provides the starting point for backward gradient propagation.
- 70The backward pass starts with the loss and propagates loss gradients toward the network_____.
Hint
Gradients move in the reverse direction from the forward data flow.
Answer
inputs
Explanation
The backward pass begins at the end of the network and propagates gradients backward through each layer to the inputs.
- 71During the backward pass, each layer combines its local derivative with the gradient received from_____.
Hint
This gradient comes from later operations closer to the output.
Answer
downstream
Explanation
Each layer uses the downstream gradient and its own local derivative to calculate gradients for earlier nodes.
- 72Once the backward pass has calculated all gradients, the model can begin the process of_____.
Hint
This stage uses gradients to change model parameters.
Answer
learning
Explanation
After all gradients are known, the learning algorithm or optimizer can use them to update the network's weights.
- 73Backpropagation calculates gradients, but it is not itself the process of_____.
Hint
A separate learning algorithm decides how to use the gradients.
Answer
optimisation
Explanation
Backpropagation computes gradients; an optimizer, such as gradient descent or one of its variants, uses them to perform optimization.
- 74After an optimization policy updates weights using their individual gradients, training repeats with another forward pass and another_____.
Hint
The repeated cycle alternates computing predictions and propagating gradients.
Answer
backward pass
Explanation
The learning process iterates forward computation, backward gradient computation, and parameter updates until a stopping criterion is reached.
- 75A neural network without hidden layers can represent logistic regression or softmax regression, whose losses are_____.
Hint
These simple models do not have the typical non-convex landscape of networks with hidden layers.
Answer
convex
Explanation
Simple networks without hidden layers can represent logistic or softmax regression, models with convex losses.
- 76Networks with hidden layers are almost always_____.
Hint
Their loss landscapes can contain local minima rather than having a simple convex shape.
Answer
non-convex
Explanation
Unlike the simple no-hidden-layer cases, multilayer perceptrons are almost always non-convex.
- 77Because hidden-layer networks are non-convex, optimization may risk getting stuck in_____.
Hint
These are minima that need not be the global minimum.
Answer
local minima
Explanation
A non-convex loss landscape can contain local minima that may trap an optimization process.
- 78How serious the local-minimum issue is depends on the data, network structure, and the task being_____.
Hint
Consider the particular objective the model is trying to improve.
Answer
optimised
Explanation
The practical significance of local minima varies with the data, the network architecture, and the optimization task.
- 79For some deep-learning problems, including some computer-vision cases, evidence suggests that local minima are not necessarily bad approximations of the global minimum; these are sometimes called_____local minima.
Hint
The term distinguishes harmful local minima from those that approximate the global solution adequately.
Answer
bad
Explanation
In some commonly applied deep-learning settings, local minima may not pose a significant problem; the term “bad local minima” refers to minima that are poor approximations of the true global minimum.

Ask anything
We've read this whole study set, so questions about it get the best answers.