Hello, in the routine modelf, how do we represent s_t-1 and c_t-1 ??
"
Iterate for π‘=0,β―,ππ¦β1t=0,β―,Tyβ1:
Call one_step_attention(), passing in the sequence of hidden states [πβ¨1β©,πβ¨2β©,β¦,πβ¨ππ₯β©][aβ¨1β©,aβ¨2β©,β¦,aβ¨Txβ©] from the pre-attention bi-directional LSTM, and the previous hidden state s<tβ1> from the post-attention LSTM to calculate the context vector ππππ‘ππ₯π‘<π‘>context.
Give ππππ‘ππ₯π‘<π‘>context to the post-attention LSTM cell.
Remember to pass in the previous hidden-state sβ¨tβ1β© and cell-states cβ¨tβ1β© of this LSTM
"
TMosh
June 30, 2022, 7:35pm
2
Those are the current s and c variables.
Theyβre updated as the βnextβ values when the function returns.
When I try s, I get the following error on one_step_attention when I run the unit test:
TMosh
June 30, 2022, 9:07pm
5
Maybe the problem is with how youβre computing s_prev in one_step_attention().
@TMosh n one_step_attention, i compute s_prev as repeator(s_prev) which gives it the same shape as a. thatβs what is the requirement. I i think that was ok
TMosh
June 30, 2022, 9:59pm
7
That seems OK.
{remainder of reply edited}
sent the notebook via DMβ¦
TMosh
July 1, 2022, 5:30am
9
I sent you a reply message.
For other students who find this thread, check that youβre using the correct function parameters for the units and states.
I am also getting this error. How did you solve this issue. According to the error the problem is with the concatenation step. Could you please help me?
Error:
TMosh
September 28, 2023, 10:30pm
11
See this line of code in one_step_attention()
Try using parenthesis instead of square brackets.
The square brackets make it a list, but the parenthesis make it a tuple. It might help.
I am getting the same error and I canβt figure out what could be wrong with my units and states parameters. I have passed the state as returned from the bidirectional lstm and the post-attention state that was initialized earlier and updated by the post_activation_lstm layer.
What am I missing?
TMosh
November 7, 2023, 5:11pm
13
There are at least two different errors discussed in this thread.
Which βsame errorβ do you have? Please post a screen capture image.
TMosh
November 7, 2023, 5:42pm
15
Should be an array (using square brackets) not a tuple (using parenthesis).
See if that helps.
I tried, still getting the same error.
TMosh
November 7, 2023, 5:47pm
17
Please post a new image of the error that shows your call to Bidirectional(β¦).
TMosh
November 7, 2023, 5:48pm
18
Also, did you save your notebook and the re-run the one_step_attention() cell, so that your changes were included?
The error does not show my call to Bidirectional(β¦), but here is the whole thing, in two images (sorry, my laptop screen is small)
I did re-run all the cells and the error is still there.
TMosh
November 7, 2023, 8:56pm
20
In one_step_attention(), did you use s_prev = repeator(s_prev)?
TMosh
November 7, 2023, 8:57pm
21
I asked to see your call to Bidirectional(β¦) for a reason.
I wanted to see how you are setting the βaβ variable.