Question: Question 3 . XOR Problem In this question, we'll train a neural network using backpropagation by hand. Don't worry, we will only train the network

Question 3. XOR Problem
In this question, we'll train a neural network using backpropagation by hand. Don't worry, we will only train the network for a single iteration.
Our neural network will have two input features x1 and x2, and two hidden units h1 and h2. The hidden units h1 and h2 will use the ReLU activation, and for final prediction y we will use the sigmoid activation to obtain a prediction between 0 and 1.
Our training example will look like this:
-x(1)=[0,0]T,t(1)=0
-x(2)=[0,1]T,t(2)=1
-x(3)=[1,0]T,t(3)=1
-x(4)=[1,1]T,t(4)=0
Part (a)
Our initial weights and biases will look like this:
W(1)=[0111],b(1)=[00],W(2)=[11],b(2)=[0]
Compute the forward pass for each of the four examples. That is, for each x(n), compute h1,h2 and the prediction y. Use the notation m1 and m2 to denote the pre-activations values of the hidden states, so that h1=relu(m1) and h2=relu(m2). Use z to represent the logit of the prediction, so that y=(z).
2
You may also use the vector representations h=[h1h2],m=[m1m2], but always start with the scalar representations first.
Part (b)
Suppose that we are using a mini-batch size of 1, and that we are using L(x(4),t(4)) to estimate the cost function. Use backpropagation to compute the below terms. For the vector and matrix derivatives, always start with the scalar derivatives of its elements before putting them together in vector or matrix.
Update (Feb 1): Please use the cross-entropy loss.
?bar(L)=1?b
ar(y)=?b
ar(z)=?b
ar(wk(2))=?b
ar(b(2))=?b
ar(hk)=?b
ar(mk)=?b
ar(Wjk(1))=?b
ar(bk(1))=
Part (c)
Assuming a learning rate of 0.5, perform one iteration of weight update based on the values you obtained from part (b).
Question 3 . XOR Problem In this question, we'll

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!