Week3 Assignment : AssertionError: Wrong values for A2

I am getting error in “# GRADED FUNCTION:forward_propagation”
I wrote lines for getting W1,b1,W2,b2 and for calculating Z1,A1,Z2,A2. I got the following error.

AssertionError: Wrong values for A2

***Expected output***

A2 = [[0.21292656 0.21274673 0.21295976]]

A2 from my code is [[-0.86360952 -0.86388209 -0.86355916]]

Thanks for any clues.

Are you sure you applied the sigmoid activation function at the output layer? The A2 values should all be between 0 and 1, right? But your values are all negative. So how could that happen?

I used tanh as activation function for generation A1, A2.
Generation of W1,b1,W2, b2 looks fine as all tests are passed for that cell.

Just to make sure we’re on the same page here: you have fixed your code to use tanh for the hidden layer and sigmoid for the output layer, right? That’s what the instructions tell you to do.

Thanks for reply. It was my mistake. I used tanh for both A1, A2. Now I change A2 formula and it is working.