Encode a sequence with a vanilla tanh RNN and return only the final hidden state. This is the context vector a classic sequence-to-sequence encoder hands to the decoder.
Implement solve(X, h0, Wx, Wh, b).
Returns. Return the last hidden state as a NumPy vector.
Example 1
Input:
solve([[1.0], [2.0]], [0.0], [[1.0]], [[0.5]], [0.0])
Output:
[0.983041]
Example 2
Input:
solve([[0.0], [0.0]], [1.0], [[1.0]], [[0.0]], [0.0])
Output:
[0.0]
No results yet
Run your code to check it against the examples, or submit to run every test.