W1-Ex3-lstm_cell_forward

I got AssertionError: wrong values for ft. I’m wondering do we need to use sigma as equation 1?

πšͺβŸ¨π‘‘βŸ©π‘“=𝜎(𝐖𝑓[πšβŸ¨π‘‘βˆ’1⟩,π±βŸ¨π‘‘βŸ©]+𝐛𝑓)

I implemented the formula without sigma, because it is not explained in the descriptions.

 ft =  np.dot(Wf, concat) + bf

The forget gate output if 0, forgets the saved state and if close to 1, remembers the saved state. Here’s the equation as given in the markdown cell.
image

You need the sigmoid function since it clamps matrix multiplication and addition to range [0, 1].

1 Like