Question: ## Part 3 . Model Building: Backwards Pass We are ready to complete the function that computes the backward pass of our model! You should
## Part Model Building: Backwards Pass
We are ready to complete the function that computes the backward pass of
our model!
You should start by reviewing the lecture slides on backpropagation.
One difference between the slides and our implementation here is that the
slides express the required computations for computing the gradients of
the loss for a single data point
However, our implementation of backpropagation is further vectorized to
compute gradients of the loss for a batch consisting of multiple data points
We begin with applying the backpropagation algorithm on our forward pass
steps from earlier. Recall that our model's forward pass is as follows:
beginalign
bfxa &textrmthe onehot vector for word
bfxb &textrmthe onehot vector for word
bfxc &textrmthe onehot vector for word
bfva &bfWwordbfxa
bfvb &bfWwordbfxb
bfvc &bfWwordbfxc
bfv &textrmconcatenatebfvabfvbbfvc
bfm &bfWbfvbfb
bfh &textrmReLUbfm
bfz &bfWbfhbfb
bfy &textrmsoftmaxbfz
L &mathcalLtextrmCrossEntropybfybft
endalign
Following the steps discussed in this week's lecture, we should get
the following backwardpass computation verify this yourself!:
beginalign
overlinebf z &bf ybf t
overlineW &overlinebf zbf hT
overlinebf b &overlinebf z
overlinebf h &WToverlinez
overlineW &overlinebf mbf vT
overlinebf b &overlinebf m
overlinebf m &overlinebf hcirc textrmReLUbf m
overlinebf v &WT overlinebf m
overlinebf va &dots
overlinebf vb &dots
overlinebf vc &dots
overlinebf Wword &dots
endalign
Task: What is the error signal $overlinebf va$
How does this quantity relate to $overlinebf v$
To answer this question, reason about the scalars that make up the elements of
$overlinebf v$ Which of these scalars also appear in $overlinebf va$
Express your answer by computing vabarrepresenting the quantity $overlinebf va$
given vbarrepresenting the quantity $overlinebf v$
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
